Commit Graph

3178 Commits

Author SHA1 Message Date
Luis Pater
30efd7c4fd feat(plugin): add request lifecycle plugin with interception and termination capabilities
- Implemented a Go-based dynamic library plugin for request lifecycle management.
- Added concurrency controls, keyword-based request termination, and response handling.
- Supported optional capabilities for request interception and active lifecycle termination.
- Included tests for schema compatibility, concurrency limits, and policy-based termination.
- Added build instructions and configuration details in README.
- Updated host support for lifecycle plugin RPC methods.

Closes: #4568
2026-07-28 03:22:18 +08:00
Luis Pater
61a6f08d18 feat(models): add metadata for Gemini 3.1 Pro Preview, 3.5 Flash Lite, and 3.6 Flash models
- Added detailed specifications for `Gemini 3.1 Pro Preview`, `Gemini 3.5 Flash Lite`, and `Gemini 3.6 Flash` models, including token limits, generation methods, and thought levels.
- Updated `models.json` to include entries for all three versions.

Closes: #4555
2026-07-28 02:14:23 +08:00
Luis Pater
7b233fa316 test(server): add minimal reasoning level in Codex-supported levels test 2026-07-28 01:55:34 +08:00
Luis Pater
3d5ec8628e feat(models): add minimal reasoning level to Codex client models
- Introduced a new reasoning level, `minimal`, to the `codexClientAllowedReasoningLevels` map.
- Updated response-building logic to include descriptive messaging for the `minimal` level.

Closes: #4542
2026-07-28 01:54:16 +08:00
Luis Pater
3073dab0b6 feat(models): add metadata for Gemini 3.5 Flash Lite and Gemini 3.6 Flash models
- Added detailed specifications for `Gemini 3.5 Flash Lite` and `Gemini 3.6 Flash` models, including token limits, generation methods, and thought levels.
- Updated `models.json` to include entries for both versions across relevant segments.

Closes: #4521
2026-07-28 01:21:47 +08:00
Luis Pater
27b4660633 refactor(translator): simplify token usage metadata extraction in OpenAI responses
Closes: #4498
2026-07-27 22:07:45 +08:00
Luis Pater
6914478562 feat(config): add support for disabling model list cloaking in Claude Code
- Introduced `DisableCloakingModelList` in `ClaudeCodeConfig` to control model ID cloaking in Anthropic model list responses.
- Updated relevant APIs and handlers to respect the new configuration.
- Added comprehensive tests for enabling/disabling cloaking behavior and config-driven hot reload scenarios.
- Extended example configuration and documentation to include the new setting.

Closes: #4473
2026-07-27 18:16:41 +08:00
Luis Pater
181242b1c0 feat(translator): enhance tool output parsing with support for input_image types
- Added handling for `input_image` in `toolOutputContentPart` and updated related parsing logic.
- Introduced `hasToolOutputImagePart` to check content for image-related types.
- Improved `setToolCallOutputContent` to handle structured content with image parts recursively.
- Refined detail extraction and type mapping for `input_image` and `image_url` cases.

Closes: #4458
2026-07-27 17:54:50 +08:00
sususu98
02f15e3ca0 Merge pull request #4554 from yinkev/fix/session-affinity-native-signals
fix(auth): prefer native client session signals for affinity
2026-07-27 16:21:41 +08:00
kyinhub
c1f16b706e fix(session): reject edge control characters 2026-07-27 16:18:18 +08:00
kyinhub
c702c9ac21 fix(auth): preserve live home alias groups 2026-07-27 16:18:18 +08:00
kyinhub
a97b1ae622 fix(auth): prefer native client session signals for affinity 2026-07-27 16:18:18 +08:00
Luis Pater
e49b1cc76f feat(store): add guard for watcher-originated auth file deletions
- Implemented `guardWatcherAuthRemovalLocked` to prevent unauthorized watcher-triggered deletions of tracked auth files.
- Updated `PersistAuthFiles` to handle redundant watcher events safely after intentional deletions.
- Improved error handling for git tree and repository inspections during watcher removal validation.
- Enhanced `commitAndPushLocked` logic to perform additional checks before committing changes.
- Added comprehensive tests to validate watcher-originated deletion safeguards and correct behavior for explicit deletions.

Closes: #4438
2026-07-27 07:05:19 +08:00
Luis Pater
59aa35a434 feat(util): add NormalizeClaudeToolInputSchema for input schema normalization
- Introduced `NormalizeClaudeToolInputSchema` in `util` package to standardize tool input schemas for compatibility with Claude.
- Replaced local `normalizeClaudeToolInputSchema` implementations in translator functions with the new utility method.
- Improved handling of schema validation, union elimination, and property merging.
- Removed redundant code in response and chat-completions translators, streamlining schema normalization logic.

Closes: #4428
2026-07-27 06:06:26 +08:00
Luis Pater
8423cce2d1 feat(executor): add configurable injection of x_search tool for xAI requests
- Introduced `InjectXSearch` in `XAIConfig` to enable automatic injection of the native `x_search` tool when not explicitly declared.
- Updated `XAIExecutor` to honor the `InjectXSearch` configuration, ensuring consistent tool availability.
- Enhanced configuration handling with support for dynamic diffing to track changes in `InjectXSearch`.
- Added comprehensive tests to validate `InjectXSearch` behavior, including preparation and tool choice synchronization.
- Updated example config and documentation to outline `InjectXSearch` usage.

Closes: #4339
v7.2.102
2026-07-27 04:41:24 +08:00
Luis Pater
f329b9d10c feat(store): add PostgreSQL-backed cooldown state persistence
- Introduced `PostgresCooldownStateStore` for saving and loading cooldown states in a PostgreSQL database.
- Supported runtime cooldown state management with efficient upsert and deletion.
- Added configurable integration via `PostgresStoreConfig` and updated schema management to include cooldown-related tables.
- Included tests to validate persistence, normalization, and concurrent handling of cooldown state records.
- Enabled overriding cooldown state stores via service builder and SDK configuration.

Closes: #4254
2026-07-27 03:46:55 +08:00
Luis Pater
6491ce3991 refactor(translator): improve tool name handling and resolve conflicts
- Enhanced handling of unique and ambiguous tool names for `custom` and `function` types.
- Consolidated name validation and shortening logic for clarity.
- Refactored `resolveToolCall` to standardize tool call processing.
- Improved support for tool name disambiguation and metadata mapping.

Closes: #4208
2026-07-27 02:33:38 +08:00
Luis Pater
4d9bf9160a fix(translator): handle [DONE] and completion states for OpenAI responses
- Added `Completed` flag to manage response completion.
- Adjusted logic to handle `[DONE]` content and state transitions correctly.
- Improved handling for incomplete responses ensuring proper output generation.

Closes: #4167
2026-07-27 01:58:44 +08:00
Luis Pater
57ef784224 feat(executor): implement local token counting for Claude requests
- Added `CountClaudeInputTokens` for estimating token usage with O200kBase tokenizer.
- Enhanced `ClaudeExecutor` to handle token counting locally, reducing dependency on upstream services.
- Introduced validation for token count requests for improved error handling.
- Updated tests to cover local token counting behavior and invalid request handling.

Closes: #4103
2026-07-27 00:50:11 +08:00
Luis Pater
90c2ff90de fix(executor): add failure tracking and reporting for video execution
- Introduced `ExecutorUsageReporter` to monitor and report failures.
- Enhanced HTTP client with tracking capabilities.
- Ensured proper publishing of execution reports.

Closes: #4085
2026-07-27 00:01:49 +08:00
Luis Pater
58ede93e33 refactor(translator): enhance tool call handling for streaming responses
- Introduced `toolCallStreamState` to manage tool call state transitions.
- Improved support for `custom_tool_call` types with fallback handling.
- Refactored argument emission logic for better clarity and flexibility.
- Added utility methods for managing and retrieving tool call states.

Closes: #4078
2026-07-26 23:51:19 +08:00
Luis Pater
22ec415975 fix(auth): replace return with break in filestore equality checks
- Changed `return` to `break` in `filestore.go` to correctly exit the loop without prematurely terminating the function.

Closes: #4585
2026-07-26 23:06:27 +08:00
Luis Pater
411dc9a9c3 Merge pull request #4591 from cyclopentadiene/fix/claude-oauth-sse-tool-names
fix(executor): restore OAuth tool names for non-stream OpenAI responses
2026-07-26 22:25:38 +08:00
Luis Pater
2135379c24 Merge pull request #4588 from adityavkk/fix/preserve-sdk-executors
fix(sdk): preserve custom executors during auth sync
2026-07-26 22:15:08 +08:00
Luis Pater
61db3a0a63 docs(readme): sync Claude Dialects translations 2026-07-26 21:42:02 +08:00
Luis Pater
027428f007 Merge pull request #4539 from stefandevo/add-claude-dialects
Add Claude Dialects to 'Who is with us?'
2026-07-26 21:40:06 +08:00
cyclopentadiene6
08e5515703 fix(executor): restore OAuth tool names from SSE responses 2026-07-26 23:28:18 +10:00
adityavkk
96f4b0019c fix(sdk): preserve custom executors during auth sync 2026-07-26 08:33:46 -04:00
Luis Pater
fa42a9d434 Merge PR #4546 into dev 2026-07-26 19:11:32 +08:00
Luis Pater
42a00a2a65 Merge PR #4573: preserve tool_result ordering v7.2.101 2026-07-26 14:43:28 +08:00
Luis Pater
7cb71ed6b2 feat(home): add NewLifetime method and improve reconnect failover handling
- Introduced `NewLifetime` to create fresh `Client` instances while maintaining cluster failover state.
- Enhanced reconnect failure tracking with `markReconnectFailure` conditions for various connection stages.
- Reset reconnect failure counter on successful reconnections to ensure stable client behavior.
- Updated tests to verify failover mechanics, subscription handling, and heartbeat recovery scenarios.
- Improved lifetime management in `service_home` with reuse of `previousClient` for seamless client transitions.
2026-07-26 14:31:46 +08:00
Luis Pater
fe4ae4989c chore(pluginhost): refactor and remove unused interceptors and executor methods
- Removed deprecated interceptor and executor-related methods, including `callRequestInterceptor`, `callResponseInterceptor`, and `callStreamChunkInterceptor`.
- Consolidated unused logic and pruned redundant imports to streamline `adapters.go`.
- No functional changes.
2026-07-26 14:31:45 +08:00
sususu98
94cf4674d7 fix(translator/codex): keep single thinking block per reasoning item in streaming translator (#4581)
Keep a single Claude thinking block open across multiple reasoning summary
parts for one Codex reasoning item, and finalize it only when output_item.done
delivers the item's final encrypted_content.

Previously, each summary part closed the preceding thinking block with the
pre-content encrypted_content snapshot captured at output_item.added. This
emitted N thinking blocks with placeholder signatures for one reasoning item,
causing client replay to append redundant placeholder reasoning items into
conversation history.

Add regression tests verifying that multi-part summary reasoning items produce
exactly one thinking block signed with the final encrypted_content.
2026-07-26 12:21:37 +08:00
Luis Pater
f6c32ec3ff feat(runtime): implement derived session identity features and tests
- Added utilities for generating stable session identities, including `DerivedSessionID`, `DerivedSessionUUID`, and `ProviderSessionUUID`.
- Introduced support for Antigravity's negative decimal `DerivedAntigravitySessionID` mapping.
- Enhanced metadata handling for provider-scoped UUID stabilization and consistent session identity inference.
- Added comprehensive tests for stability, namespace isolation, and preferred execution session prioritization.
2026-07-26 03:07:21 +08:00
Code_G
29406436c3 fix(executor): keep tool_result blocks first when injecting the cloaking reminder
`prependToFirstUserMessage` always inserted the `<system-reminder>` text block at
index 0 of the first user message's content array. When a client sends a history
that begins with an assistant `tool_use` turn, that first user message is the
`tool_result` carrier, and Anthropic requires those blocks to stay at the head of
the message. Prepending pushed them out of first position, so the upstream
rejected the whole request with:

    messages.N: `tool_use` ids were found without `tool_result` blocks
    immediately after: <id>

Append the reminder instead when the content array already leads with a
`tool_result` block; behaviour is unchanged for every other message shape.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 03:02:43 +09:00
sususu98
a4d18cb04a fix(antigravity): scope schema sanitization (#4571) 2026-07-26 01:52:20 +08:00
Luis Pater
41f6ea8950 feat(runtime): enhance response preparation for xAI executor output controls
- Added logic to `preserveXAIResponsesOutputControls` for retaining supported controls (`max_output_tokens`, `temperature`, `top_p`, `top_k`) during translation.
- Removed unsupported fields such as `stop` where necessary to align with xAI's Responses API.
- Updated tests to validate the preservation and removal of fields across various input scenarios.
- Improved payload configuration handling with additional unit tests for ensuring compatibility with model-specific overrides.

Closes: #4464
2026-07-26 00:56:57 +08:00
Luis Pater
27fc3169bb feat(runtime): improve executor binding logic and add config-based executor handling
- Added `UsesConfig` to `XAIAutoExecutor` for determining config-based binding.
- Refactored `Service` to support thread-safe executor registration, using a new mutex (`executorRegistrationMu`).
- Improved executor rebind logic to prevent unnecessary replacements unless forced or required by config updates.
- Updated handling of config updates to correctly replace stale XAI executors.
- Enhanced the test suite for edge cases in executor binding and replacement for multiple providers.

Closes: #4567
v7.2.100
2026-07-26 00:16:48 +08:00
Luis Pater
95d5b2485f fix(runtime): skip deferred tools when injecting cache_control
- Updated `ensureCacheControl` to inject cache_control into the last non-deferred tool instead of the last tool.
- Adjusted `injectToolsCacheControl` to ignore tools marked with `defer_loading` for prompt caching.
- Added unit tests to validate behavior for deferred tools, existing cache_control, and mixed tool arrays.

Closes: #4561
2026-07-25 23:20:17 +08:00
sususu98
62a2c0d374 fix(antigravity): sanitize unsigned thinking signatures in OpenAI Chat Completions for Claude models (#4562)
Fixes #4514 by sanitizing unsigned thinking signatures for Claude target models in OpenAI Chat Completions requests to Antigravity.

- Export SanitizeAntigravityClaudeGeminiRequestSignatures in gemini request translator and call it for Claude target models in OpenAI Chat Completions requests.
- Use json.Decoder with UseNumber() in SanitizeAntigravityClaudeGeminiRequestSignatures to preserve exact JSON number precision (preventing float64 truncation of large integers and high-precision numbers during unmarshal/marshal).
- Add unit tests verifying unsigned reasoning_content sanitization, empty turn dropping, exact number precision preservation, and functionCall signature stripping for Claude target models.
2026-07-25 17:34:52 +08:00
Luis Pater
ace2e843cb feat(models): add new models Claude Opus 5 and Gemini 3.6 Flash
- Extended `models.json` with Claude Opus 5, a premium high-context model by Anthropic.
- Added Gemini 3.6 Flash (High) by Antigravity, with advanced token and thinking configurations.
2026-07-25 16:56:11 +08:00
Luis Pater
284ccc4f2b Merge pull request #4538 from yueziji/fix/windows-plugin-response-buffer-upstream
fix(pluginhost): stabilize Windows plugin response buffer
2026-07-25 15:10:26 +08:00
Luis Pater
f04605d84f fix(translator): prevent duplicate message delta processing in Claude response handler
Closes: #4544
2026-07-25 14:35:41 +08:00
sususu98
72886356dd fix(antigravity): preserve complete reasoning replay (#4525) 2026-07-25 14:07:31 +08:00
Supra4E8C
a14dfc779f fix(docs): update Claude API registration links in README files 2026-07-25 12:13:03 +08:00
Chén Mù
5ac5debdc2 Merge pull request #4553 from router-for-me/log
feat(logging): add debug logging for OAuth selection in home execution
2026-07-25 09:44:17 +08:00
hkfires
3727d87cef feat(logging): add debug logging for OAuth selection in home execution 2026-07-25 09:17:20 +08:00
Luis Pater
f8dffa0522 feat(logging): log Codex media forwarding start with detailed fields
- Implemented logging for Codex remote media forwarding start events, including detailed connection and credential metadata.
- Added `formatLogFieldValue` for quoting specific log fields and ensured newline safety in log output.
- Enhanced unit tests to validate log content, escaping, and field inclusion.
v7.2.99
2026-07-25 07:51:43 +08:00
Luis Pater
49be36aef6 feat(live): add TCP proxy for Codex Live WebRTC relay
- Implemented a TCP proxy for WebRTC candidate tunneling in Codex Live, supporting passive TCP candidates on port 443.
- Restricted tunneling to globally routable public IPs and added safeguards for rejecting unsafe/private targets.
- Added robust validation of STUN BindingRequest frames before forwarding to upstream candidates.
- Includes extensive unit tests for proxying behavior, candidate validation, and tunnel edge cases.
2026-07-25 07:12:28 +08:00
Luis Pater
ebc7446929 feat(diff): enhance config diff and relay updates for Codex Live Media
- Added comprehensive diffing for Codex live media relay settings, including support for public IP, UDP port ranges, and ICE server changes.
- Introduced `displayOptionalValue` utility to handle optional values in diff outputs.
- Improved test coverage for config change detection, ensuring no sensitive information leakage.
- Replaced `allow-private-remote-ips` with the new `disable-private-remote-ips` property, adding YAML backward compatibility.
- Updated Codex live handler to differentiate media relay configuration changes and runtime updates.
2026-07-25 06:09:50 +08:00