Commit Graph

1230 Commits

Author SHA1 Message Date
Luis Pater
4e8a4125ac feat(config): add operator overrides for Claude header defaults and client request ID modes
- Add `anthropic-beta-strip`, `anthropic-beta-append`, `inject-diagnostics`, and `client-request-id` options to `ClaudeHeaderDefaults`.
- Support `on`, `off`, and `passthrough` modes for `client-request-id` header handling in Claude requests.
- Sanitize and normalize configured beta override lists and client request ID configuration values.

Closes: #5093
2026-10-15 00:57:18 +08:00
Luis Pater
9db0729f5f feat(config): add operator overrides for Claude header defaults and client request ID modes
- Add `anthropic-beta-strip`, `anthropic-beta-append`, `inject-diagnostics`, and `client-request-id` options to `ClaudeHeaderDefaults`.
- Support `on`, `off`, and `passthrough` modes for `client-request-id` header handling in Claude requests.
- Sanitize and normalize configured beta override lists and client request ID configuration values.

Closes: #5093
2026-10-15 00:57:02 +08:00
Luis Pater
5efe97582c feat(antigravity): flatten multi-branch tool unions for Claude model requests
- Introduce `CleanJSONSchemaForAntigravityClaudeTool` and model-aware schema sanitization helpers to flatten multi-branch `anyOf`/`oneOf` unions specifically for Antigravity Claude tool parameter schemas.
- Preserve multi-branch union support for Gemini model variants while preventing Claude backend HTTP 400 validation errors on nested unions.
- Ensure proper inheritance of nullable markers and idempotency across the translator and executor chain.

Closes: #3662
2026-10-14 21:43:22 +08:00
Luis Pater
b3dc6c3fe5 refactor(config): move tls-handshake-timeout-seconds to root request configuration
- Relocate `tls-handshake-timeout-seconds` from `upstream.claude` to root-level request settings.
- Update configuration structures, validation logic, and tests accordingly.

Closes: #6615
2026-10-14 20:59:02 +08:00
Luis Pater
345cc9d5a8 feat(claude): add timeout and retry logic for silent TLS handshakes
Closes: #6615
2026-10-14 20:23:35 +08:00
Luis Pater
7f2f17d76f feat(gemini): treat MALFORMED_FUNCTION_CALL as retryable API error in Claude translation
- Translate Gemini `MALFORMED_FUNCTION_CALL` responses into Claude API error payloads instead of refusal stop reasons.
- Capture translated stream errors in Gemini and Vertex executors to ensure proper error propagation, usage reporting, and state management.

Closes: #6606
2026-10-14 12:08:35 +08:00
Luis Pater
a19a8ecde3 feat(registry): add gemini-3.8 model variants and update test cases
- Update model identifiers to `gemini-3.8-flash-high` and `gemini-3.8-flash` in executor tests.

Closes: #6602
2026-10-14 10:17:01 +08:00
Luis Pater
0d18d3b365 feat(claude): support model-specific default max tokens from registry in OpenAI chat completions
- Introduce `defaultClaudeChatMaxTokensForModel` to determine default max tokens based on model metadata and fallback rules.
- Update `ConvertOpenAIRequestToClaude` to apply model-specific default max tokens and handle null `max_tokens` or `max_completion_tokens`.
- Implement `stripTranslatedDefaultMaxTokens` in Claude executor to allow payload default rules to override synthesized max tokens when omitted by the caller.

Closes: #6601
2026-10-14 08:40:02 +08:00
Luis Pater
57d005fe6c fix(codex): strip out-of-range int64 numeric bounds from tool schemas
Closes: #6579
2026-10-14 03:45:14 +08:00
Luis Pater
40ce0e0121 feat(kimi): support schema normalization for namespaced tools and input tool lists
Closes: #6578
2026-10-14 03:12:26 +08:00
Luis Pater
7795de19ca feat(sse): implement CodexSSEScanner for improved event data handling
Closes: #6575
2026-10-14 02:54:02 +08:00
Luis Pater
51952a7b2f feat(httptransport): add request-scoped HTTP transport decorator
- Introduce `sdk/httptransport` package with `Decorator`, `WithDecorator`, `WithoutDecorator`, `InheritDecorator`, and `Decorate` functions.
- Propagate transport decorators from incoming HTTP request contexts in `BaseAPIHandler.GetContextWithCancel`.
- Apply transport decoration after client transport selection across proxy-aware, Devin, uTLS, and Antigravity HTTP clients.

Closes: #5616
2026-10-13 13:01:12 +08:00
Luis Pater
a0fd8448f5 fix(schema): preserve multi-branch anyOf/oneOf unions during schema sanitization
- Retain multi-branch `anyOf` and `oneOf` unions instead of flattening them into a single branch.
- Normalize `oneOf` to `anyOf` on native Gemini/Antigravity schema carriers while preserving `oneOf` when standard constraints are allowed.
- Materialize required-only union branches using parent object properties.
- Strip null and boolean `false` branches from unions, applying `nullable: true` and description hints where appropriate.

Closes: #3662
2026-10-13 10:04:32 +08:00
Gracjan Kubicki
97ba1e8961 fix(claude): keep prompt cache when tool_search discovers the first deferred tool
Anthropic keeps the prompt cache when deferred tools are added, but not when a request goes from no deferred tool to one. Codex hides deferred tools until a search returns them, so the request after the first discovery always missed the cache. Native tool search now declares one constant deferred anchor tool ahead of discovered tools, so discoveries only append to tools[].
2026-10-12 20:28:18 +02:00
Luis Pater
fb87727da0 Merge pull request #6543 from RoySRose/pr/claude-oauth-wrapped-full-mcp-name
fix(claude): restore passthrough MCP tools wrapped with their full mcp__ name
2026-10-13 00:53:07 +08:00
Luis Pater
a27799ec2b Merge pull request #6548 from gracjankubicki/fix/tool-search-golden-date
test(claude): pin executor clock in tool_search disabled golden
2026-10-12 21:45:38 +08:00
Luis Pater
1e37b52b2a fix(executor): preserve websocket sessions across reload and auth removal
Closes: #6549
2026-10-12 19:42:54 +08:00
Gracjan Kubicki
77cf88b088 test(claude): pin executor clock in tool_search disabled golden
The OAuth path injects a currentDate reminder, so the golden recorded on 2026-10-11 failed on any other day. Pin claudeCodeCurrentTimeFunc to the recording day and reset Claude diagnostics in renderToolSearchExecutorGolden.
2026-10-12 10:26:17 +02:00
Luis Pater
7b0319fb1c feat(codex): support Sign in with ChatGPT 2026-10-12 11:45:25 +08:00
RoySRose
02fc76b149 fix(claude): restore passthrough MCP tools wrapped with their full mcp__ name
With cloaked Claude OAuth, the model sometimes emits a caller-owned MCP tool
under the request-local virtual server while keeping the tool's full name,
e.g. mcp__<virtual>__mcp__<server>__<tool>. The existing recoveries only
handle the <server>__<tool> and <tool> tails, so this form is forwarded as an
undeclared tool name and the client cannot dispatch it.

Add a first recovery step that maps the suffix back when it is exactly the
full name of a declared passthrough tool. Ambiguous suffixes still fail
closed through the existing recovery path.
2026-10-12 11:53:16 +09:00
Luis Pater
a27183143e fix(antigravity): drop trailing thought-only model turns
Closes: #6530
2026-10-11 20:45:18 +08:00
Luis Pater
15d2148bc2 fix(gemini): ensure trailing user turn for function response with media
Closes: #6524
2026-10-11 17:58:34 +08:00
Luis Pater
ce518c9bcf test(claude): cover a reload between tool_search fallback and translation 2026-10-11 14:26:57 +08:00
Luis Pater
29bd0415b9 fix(claude): pin upstream.claude.tool-search per request 2026-10-11 14:21:00 +08:00
Luis Pater
03a3cfecb5 feat(claude): honor upstream.claude.tool-search in executor, catalog and server 2026-10-11 14:08:49 +08:00
Luis Pater
8eed08efc8 fix(claude): drop cache_control from deferred tool_search tools 2026-10-11 11:20:09 +08:00
Luis Pater
11f04c2077 feat(codex): advertise tool search only for natively supported Claude routes 2026-10-11 11:09:17 +08:00
Luis Pater
52992659ec feat(claude): fall back to pre-tool-search translation on unsupported upstreams 2026-10-11 11:06:04 +08:00
Luis Pater
48ad3487b2 feat(executor): add Responses tool_search strip and legacy model helpers 2026-10-11 11:01:28 +08:00
Luis Pater
37fe2608ee feat(usage): propagate access provider and native key metadata to usage records
- Inject API key, access provider, and native key flags into the request context during authentication
- Add `IsNativeKey` and `AccessProvider` fields to usage records, plugin API types, and redis queue payloads
- Provide context helper functions and automatic fallback resolution in the usage manager and reporter

Closes: #6509
2026-10-10 22:16:00 +08:00
Luis Pater
cad1b50347 fix(devin): do not seed input token estimates for claude streams
- Avoid seeding `message_start` with full-input token estimates in Devin streaming
- Rely on authoritative cache-aware token usage reported in response frames

Closes: #6505
2026-10-10 21:48:20 +08:00
Luis Pater
5dbd92a0e0 fix(auth): preserve upstream error cooldown on canceled stream contexts
- Record credential and model cooldowns when stream execution encounters an upstream error despite context cancellation
- Prioritize reading ready stream chunks before handling context cancellation in conductor
- Defer Codex websocket disconnect notifications until error frames are delivered to the stream

Closes: #6503
2026-10-10 20:26:36 +08:00
Luis Pater
be8c35f294 fix(claude): ignore invalid and null cache control entries in executor
- Use `isValidClaudeCacheControl` when inspecting `cache_control` fields across system prompts, tools, and message contents
- Prevent null or non-object cache control entries from counting against limits or interfering with TTL normalization and injection logic

Closes: #6491
2026-10-10 08:01:26 +08:00
Luis Pater
d318bcc3af fix(codex): handle late response interrupts on websocket sessions
- Track terminal response IDs per connection to idempotently handle late interrupts targeting completed turns
- Prevent late interrupts from contaminating subsequent requests or returning false errors on idle retained connections
- Add thread-safe diagnostic logging of sanitized interrupt outcomes in the Responses websocket handler

Closes: #6483
2026-10-09 21:35:40 +08:00
Luis Pater
76c87ce91d fix(xai): reset terminal error on websocket connection configuration
- Clear terminal error state when configuring a replacement xAI websocket connection to prevent stale error propagation

Closes: #6480
2026-10-09 20:26:25 +08:00
Luis Pater
e9c8769a7a fix(executor): normalize and restore non-portable tool call IDs
- Normalize tool use and tool result IDs in Claude message payloads to adhere to character constraints
- Encode non-portable tool call IDs in Devin executor responses and restore original IDs before request construction

Closes: #6478
2026-10-09 19:44:24 +08:00
sususu
f8e4a84074 fix(openai-compat): measure streaming TTFT on effective token frames 2026-10-09 19:00:58 +08:00
Luis Pater
2d8ec73b33 fix(claude): preserve mid-conversation effort directives during system insertion
- Skip directive-only system turns when locating the insertion point for mid-conversation system messages
- Prevent system blocks from being prematurely placed before subsequent user turns when effort directives are present

Closes: #6477
2026-10-09 17:43:09 +08:00
Luis Pater
51bde0ff96 fix(codex): preserve resolved upstream model in direct openai image requests
- Check configured upstream models and aliases before normalizing direct OpenAI image model names
- Support requested model resolution across JSON and multipart image payloads

Closes: #6458
2026-10-09 10:10:50 +08:00
Luis Pater
2bc236d2fc feat(claude): support responses compaction in claude executor
- Handle compaction trigger requests by generating summaries and sealing antigravity compaction capsules
- Expand replayed compaction capsules into message history before translation and filter foreign compaction items
- Preserve tool definitions with `tool_choice: none` or flatten tool blocks when tool definitions are missing
- Support streaming compaction execution and map cache creation and read token usage

Closes: #6466
2026-10-09 03:24:45 +08:00
Luis Pater
8080967991 fix(claude): ignore overage billing resets in unified rate limit parsing
- Ignore unified reset timestamps matching overage reset boundaries to prevent cooling down credentials until monthly billing reset
- Filter candidate rate limit deadlines exceeding the 7-day window limit
- Treat rejected overage claims with absent or healthy shared utilization as model-scoped rejections

Closes: #6465
2026-10-08 22:14:59 +08:00
Luis Pater
6331b38bba feat(openai): support response.interrupt in responses websocket handling
- Intercept and process `response.interrupt` control frames immediately on the downstream websocket reader
- Forward interrupts to active upstream Codex websocket sessions without starting a new turn or rewriting payload fields
- Support canceling in-flight HTTP turns via local interrupt handling
- Allow session-staged Home credentials to authorize interrupts

Closes: #6456
2026-10-08 21:32:26 +08:00
Luis Pater
249e9ef976 fix(meta): preserve foreign reasoning encrypted content in responses requests
- Introduce `sanitizeOpenAIResponsesReasoningEncryptedContentKeepForeign` to retain unknown-format reasoning signatures
- Update Meta executor to preserve foreign reasoning encrypted payloads for third-party models like Muse

Closes: #6450
2026-10-08 13:03:21 +08:00
Luis Pater
2d5351b3e5 feat(vertex): add support for native gemini interactions api
- Extract shared Gemini Interactions helpers for payload translation, input sanitization, thinking, and SSE streaming
- Add `interactions` configuration option to Vertex credentials
- Support native non-streaming and streaming Interactions API execution in Gemini Vertex executor

Closes: #6445
2026-10-08 12:39:31 +08:00
Luis Pater
0f96f568e4 refactor(translator): update openai and interactions request converters to return errors
- Update OpenAI and OpenAI Responses to Interactions request converters to return `([]byte, error)`
- Register request converters directly in internal translator registry instead of sdktranslator checked requests
2026-10-08 03:00:04 +08:00
Luis Pater
34e73c75a3 fix(xai): add proxy support and semver validation to Grok CLI updater
- Pass configured proxy URL to the npm registry updater client
- Validate fetched versions against strict semver and minimum server version floor (`1.0.13`)
- Update default fallback client version to `1.0.46`
- Manage background updater lifecycle and context via service lifecycle initialization
2026-10-08 02:39:32 +08:00
Luis Pater
298649f677 Merge pull request #6446 from jellyfish-p/feat/grok-cli-dynamic-version
feat(xai): dynamically fetch latest Grok CLI version from npm registry with fallback
2026-10-08 02:30:27 +08:00
Luis Pater
f51624aa35 fix(translator): report unsendable user turn attachments in openai responses to interactions
- Track dropped attachments and reject emptied user turns during OpenAI Responses to Interactions translation
- Register checked request translator for OpenAI Responses to Interactions format conversion
2026-10-08 02:11:20 +08:00
Luis Pater
7cd8f7bac7 Merge pull request #6441 from soilSpoon/fix/attachment-parts
fix(translator): stop dropping attachments and empty turns
2026-10-08 02:09:31 +08:00
Jellyfish
90654da573 feat(xai): dynamically fetch latest Grok CLI version from npm registry with fallback
- Fetch latest @xai-official/grok client version from npm registry on startup
- Periodically refresh Grok CLI version every 3 hours without multiple retries
- Update hardcoded fallback version to 1.0.50 if npm registry is unreachable
- Dynamically inject active version into x-grok-client-version and User-Agent headers
2026-10-08 00:59:27 +08:00