Commit Graph

5158 Commits

Author SHA1 Message Date
Supra4E8C
04525503ae docs: add SubRouter to sponsor list 2026-11-25 14:09:16 +08:00
Luis Pater
8ba2b68306 fix(thinking): detach extracted usage effort labels from JSON buffers
- Clone the normalized level string in reasoningEffortFromConfig so ExtractReasoningEffort and ExtractTranslatedReasoningEffort do not retain the underlying request or payload byte slice.
- Add ownership regression tests verifying extracted usage effort labels do not alias large JSON input buffers across supported formats.

Closes: #8062
2026-11-25 12:57:35 +08:00
Luis Pater
2d50f315fd fix(antigravity): update Hub fallback and changelist map to 2.35.1
- Bump antigravityFallbackVersion to 2.35.1 so pre-refresh requests report the latest verified Hub release.
- Add verified changelist entries for Hub 2.35.0 (cl=1028447422) and 2.35.1 (cl=1029194470) so mapped versions no longer pin back to the 2.34.0 build metadata.
- Update version resolution test expectations to cover the new mappings and the unmapped-version pin behavior.

Closes: #8031
2026-11-25 12:49:56 +08:00
Luis Pater
5b857eccbf fix(registry): remove obsolete GPT-6.1 Terra model entry
Closes: #8012
2026-11-25 12:40:57 +08:00
Luis Pater
e6eee6b684 feat(devin): add new model entries to the registry
- Register new SWE, GPT, Gemini, and Nemotron models with their capabilities and thinking levels.
- Update the SWE-2 Lightning display name.
2026-11-25 12:30:12 +08:00
Luis Pater
8cd6817b83 fix(translator): separate terminal finish_reason from delta payloads in OpenAI streams
- Split Antigravity and Gemini OpenAI Chat streaming terminal frames carrying delta payloads into a payload chunk followed by a dedicated empty-delta terminal chunk with usage metadata.
- Deduplicate terminal finish_reason emissions per choice across duplicate frames and preserve cached response metadata across split Antigravity chunks.
- Add regression tests covering multi-tool terminal frames, streaming tool-call closes, multi-candidate deduplication, and empty-delta terminal chunks.

Closes: #8039
v8.1.3
2026-11-25 12:22:02 +08:00
Luis Pater
20c60014b8 fix(translator): isolate multi-choice OpenAI non-stream responses into separate Gemini candidates
- Build an independent Gemini candidate document and local parts slice per OpenAI choice instead of sharing allParts and overwriting candidates.0.
- Preserve existing reasoning, reasoning_details, array content, tool call, thoughtSignature, finishReason, and index handling per candidate while keeping candidate role as model.
- Replace the legacy multi-choice overlay test with regression tests asserting multi-candidate isolation.

Closes: #8041
2026-11-25 12:15:51 +08:00
Luis Pater
de47205034 fix(gemini): normalize assistant image data URLs and merge tool response follow-up turns
- Reuse the shared OpenAI file-data normalizer for assistant image parts to preserve base64 payloads with media parameters or metadata whitespace.
- Merge follow-up user turns into the preceding Gemini tool response turn in original part order while preserving demoted system and developer boundaries.
- Add regression tests and update multi-turn tool response assertions without altering tool response content serialization.

Closes: #8038
2026-11-25 12:09:45 +08:00
Luis Pater
5a64cfa109 fix(translator): restore sanitized OpenAI tool names in Gemini chat-completions responses
- Build the Gemini OpenAI Chat Completions response tool name map from effective function tool declarations matching request-side allowed_tools filtering and collision exclusion instead of Claude-only top-level names.
- Pass nil for originalRequestRawJSON when ConvertAntigravityResponseToOpenAINonStream delegates after restoring function names to prevent double restoration on chained aliases.
- Add streaming, non-streaming, allowed_tools round-trip, and Antigravity chained-alias regression tests.

Closes: #8037
2026-11-25 12:04:47 +08:00
Luis Pater
5fec95cf4e fix(codex): filter unsupported input modalities on named model templates
- Filter inherited input_modalities through filterCodexInputModalities on the named-template branch in buildCodexClientModelsWithToolCapabilities, removing supports_image_detail_original when image input is absent.
- Remove stale audio input_modalities entries for gpt-6.2-sol and gpt-5.5 in the embedded Codex client model catalog and add regression tests.

Closes: #8036
2026-11-25 11:58:26 +08:00
Luis Pater
2fbac976e6 fix(translator): preserve OpenAI reasoning fields and array content in Gemini responses
- Extract reasoning from reasoning_content, reasoning, and reasoning_details (including reasoning.summary entries) with priority deduplication in both streaming and non-streaming OpenAI-to-Gemini response paths.
- Parse array-structured delta.content and message.content into ordered Gemini thought and text parts instead of serializing raw JSON literals.
- Add streaming and non-streaming regression tests covering reasoning fields, reasoning_details variants, and array content segments.

Closes: #8034
2026-11-25 11:56:19 +08:00
Luis Pater
531aea156a fix(util): normalize numeric protobuf Schema.Type enums in Gemini schemas
- Decode numeric protobuf Schema.Type enum values (1..7) to lowercase JSON Schema type strings via *ojson.Doc in NormalizeJSONSchemaNumericConstraints while preserving literals and special property keys.
- Normalize schemas prior to nested wrapper cleaning, Claude 5.5 structured output prompt fallback, Interactions response_format emission, and snake_case Gemini pass-through schema fields.
- Add regression tests covering schema cleaners, Antigravity executor paths, and Gemini-ingress translators.

Closes: #8032
2026-11-25 11:41:46 +08:00
Luis Pater
e36449bc91 fix(translator): parse native Claude JSON, stop reason, and usage in Gemini non-stream response
- Adapt native Claude Messages JSON payloads via ClaudeMessagesJSONToSSE before aggregating Gemini non-stream responses so text, thinking, tool calls, response ID, and usage are preserved.
- Merge message_start and message_delta usage metadata with accurate Gemini prompt, cache-read, thinking, candidate, and total token accounting, and map delta.stop_reason max_tokens to MAX_TOKENS.
- Add regression tests covering native Claude Messages JSON payloads, segmented Anthropic SSE streams, cache token accounting, and thinking token bounds.

Closes: #8033
2026-11-25 11:37:06 +08:00
Luis Pater
ffa5511251 feat(thinking): parse extra_body.google.thinking_config on OpenAI Chat requests
- Parse thinking_level/thinkingLevel and thinking_budget/thinkingBudget from Google extra_body thinking_config variants as a lower-precedence fallback in OpenAI effort extraction and Antigravity intent routing.
- Apply the same fallback precedence during OpenAI Chat to Antigravity and Gemini request translation so upstream thinkingConfig matches extracted reasoning_effort metadata.
- Add unit and executor regression tests covering snake_case/camelCase variants, precedence rules, and Antigravity grouped-model routing.

Closes: #8018
2026-11-25 11:07:29 +08:00
Luis Pater
c39b20d452 fix(codex): force supported_in_api and default visibility on fallback client models
- Explicitly set supported_in_api to true and default visibility to list for non-image synthesized fallback entries in applyCodexClientModelMetadata so third-party models do not inherit restrictive flags from the fallback template.
- Add a regression test verifying that synthesized third-party models advertise supported_in_api=true and visibility=list even when the fallback template has supported_in_api=false and visibility=hide, while image models remain hidden.

Closes: #8008
2026-11-25 11:07:28 +08:00
Luis Pater
d71e9dcd7d fix(auth): recognize codex-acp user agents in Codex SIWC bypass
- Match codex-acp and codex_acp client identifiers in IsCodexClientUserAgent so ACP Codex requests bypass use_siwc and use outer Codex OAuth credentials.
- Add regression tests with the full @agentclientprotocol/codex-acp User-Agent covering SIWC bypass selection and Codex HTTP/WebSocket execution paths.

Closes: #8011
2026-11-25 11:07:27 +08:00
Luis Pater
ff9339feaa fix(claude): prefix Google input token limit errors with prompt is too long
- Normalize Google/Gemini invalid_request_error input token limit messages in claudeErrorDetailFromText by prepending Anthropic's canonical "prompt is too long: " prefix so Claude Code can trigger automatic compaction.
- Match "input token count" followed by an optional parenthesized count and "exceeds the maximum" while avoiding double-prefixing and preserving non-matching errors.
- Add regression tests covering JSON responses, committed SSE errors, parenthesized count variants, idempotency, non-400 statuses, and output-token-limit false positives.

Closes: #8003
2026-11-25 11:07:25 +08:00
Luis Pater
da4396fd8a fix(antigravity): synthesize fallback Claude message ID when responseId is missing or blank
- Generate a unique msg_-prefixed fallback message ID in both streaming and non-streaming Antigravity-to-Claude response translators when response.responseId is absent or whitespace-only, while preserving trimmed non-empty upstream IDs.
- Add regression unit tests covering missing, empty, whitespace-only, and valid responseId values across streaming and non-streaming paths.

Closes: #8005
2026-11-25 11:07:22 +08:00
Luis Pater
f3cbdc5dab Merge pull request #8023 from router-for-me/codex
fix(codex): preserve configured display name
2026-11-24 21:22:16 +08:00
hkfires
237cbdaaf2 fix(codex): preserve configured display name
Use the catalog display name only as a fallback when no
configured name is present, so provider-specific names such as
Copilot variants are not overwritten.
2026-11-24 21:13:51 +08:00
Luis Pater
0acf4713ec Merge pull request #8022 from router-for-me/namespace
fix(management): namespace copilot and devin model IDs in v8
2026-11-24 20:45:30 +08:00
hkfires
28e5ae280d fix(musecode): infer copilot ownership for models
Add copilot type and copilot/ prefix handling so dynamic
models report owned_by=copilot instead of falling back to
the vendor inferred from the base model name. Also document
devin as a supported OAuth model-settings channel.
2026-11-24 20:26:36 +08:00
hkfires
2a33e20579 fix(management): namespace copilot and devin model ids in v8
Prefix static and plugin-static model IDs for copilot and devin
with "<channel>/" on the v8 model-definitions endpoint so the
returned IDs match those used for OAuth rule matching before
aliases and credential prefixes are applied. Leave v0 responses,
registry-fallback models, and other channels unchanged.
2026-11-24 20:09:47 +08:00
Luis Pater
b82d3d4eda fix(signature): skip empty thoughtSignature paths when scanning Gemini fallbacks
- Continue scanning geminiPartThoughtSignaturePaths when an existing signature field is empty, whitespace-only, or null so valid fallback signatures are promoted instead of shadowed.
- Preserve empty-field detection by returning ("", true) when all existing signature paths are empty, and add unit tests covering fallback promotion and all-empty cleanup.

Closes: #8001
2026-11-24 17:50:43 +08:00
Luis Pater
237e074044 fix(proxyutil): preserve direct and none proxy modes in Redact
- Recognize case-insensitive direct and none keywords via a shared helper so Redact aligns with Parse instead of returning "<invalid proxy URL>".
- Add unit tests covering empty input, direct-mode keywords with case and whitespace variants, and invalid suffixed inputs in TestRedactProxyURL.

Closes: #8002
2026-11-24 17:28:58 +08:00
Luis Pater
7be2a67842 fix(signature): handle snake_case function_call and function_response in Gemini thought signature sanitizer
- Detect snake_case function_call and function_response parts alongside camelCase in both the sanitization pass and fast-path check so valid first-call bypass sentinels are preserved and response signatures are stripped.
- Include nested function_call and function_response thought signature paths in geminiPartThoughtSignaturePaths and add regression tests covering snake_case, mixed-case parallel calls, and nested signatures.

Closes: #8000
2026-11-24 11:47:32 +08:00
Luis Pater
e9dd8bada7 fix(executor): refresh replay cache snapshot after pairing-failure invalidation
- Add DeleteAntigravityReasoningReplayItemsIfUnchangedWithSnapshot in internal/cache to atomically return the newly written tombstone snapshot across local memory and Home KV modes.
- Update scope.cacheSnapshot in prepareAntigravityGeminiReasoningReplayPayloadDocWithOptions when conditional invalidation succeeds so the next turn's Commit CAS persists instead of silently dropping replay state.
- Add regression tests covering memory/KV commit recovery after pairing degradation and concurrent-write isolation.

Closes: #7997
2026-11-24 11:29:54 +08:00
Luis Pater
3b20ee2246 fix(auth): keep gemini, vertex, and aistudio in distinct LCP namespaces
- Update canonicalLCPProvider to map only google and gemini to gemini so vertex and aistudio use separate LCP affinity namespaces.
- Propagate Home LCP session, provider, generation, and node-kind metadata from HomeDispatchSelection into execution and failure reporting.
- Add regression tests for cross-provider LCP isolation and Home LCP namespace, stale-failure, and compaction metadata propagation.

Closes: #7995
2026-11-24 11:28:19 +08:00
Luis Pater
9bce482522 fix(antigravity): reject invalid HTTP 200 responses in CountTokens
- Validate that HTTP 2xx CountTokens responses are valid JSON objects before checking in-band errors or token counts, returning 502 Bad Gateway on empty, HTML, malformed, or non-object bodies.
- Strictly parse numeric totalTokens as a non-negative int64 via strconv.ParseUint before translation, rejecting missing, fractional, negative, or overflowing values while preserving explicit zero counts.
- Add hermetic regression tests covering invalid HTTP 200 CountTokens responses across formats alongside valid zero and positive counts.

Closes: #7992
2026-11-24 10:41:12 +08:00
Luis Pater
fe571afe83 fix(antigravity): emit complete tool calls once in OpenAI streams
- Emit unmarked complete functionCall arguments immediately as closed JSON deltas instead of fragmenting every call and appending duplicate closing deltas at stream end.
- Support Vertex partialArgs and willContinue streaming tool call continuations while preserving late unmarked continuations on their original tool call index.

Closes: #7966
2026-11-24 10:39:44 +08:00
Luis Pater
d1bdee850b fix(antigravity): reject empty SSE responses in non-stream execution
- Return a retryable 502 zero-output status error in executeClaudeNonStream when an HTTP 200 SSE stream yields no valid JSON payload, preserving context errors and avoiding replay commits or credits failure-state resets.
- Add hermetic regression tests covering empty, HTML, and sentinel-only SSE bodies across Claude and OpenAI formats while confirming valid SSE responses without finishReason still succeed.

Closes: #7991
2026-11-24 10:21:19 +08:00
Luis Pater
20be744e80 fix(antigravity): reject empty successful streams
- Return a retryable 502 when an upstream HTTP 200 stream contains no valid SSE JSON payload.
- Cover empty and HTML responses while preserving valid terminal synthesis without finishReason and credits failure state.

Closes: #7990
2026-11-24 10:00:44 +08:00
Luis Pater
6c2308a10f fix(cache): preserve Gemini sentinel with empty scope
- Return the static Gemini signature sentinel before empty-scope cache fail-closed handling.
- Cover required and explicit empty scopes while preserving non-Gemini cache isolation.

Closes: #7988
2026-11-24 09:54:56 +08:00
Luis Pater
0286e5d178 fix(cache): normalize signature cache model groups
- Normalize model identifiers before grouping GPT, Claude, and Gemini signature caches.
- Add regression coverage for mixed-case keys, lookups, and Gemini sentinel validation.

Closes: #7989
2026-11-24 09:54:35 +08:00
Luis Pater
14a95b19e2 fix(antigravity): preserve thinking-group output caps
- Preserve smaller caller output limits while applying thinking-group catalog caps.
- Clamp Claude thinking budgets and normalize output token aliases before payload rules run.

Closes: #7985
2026-11-24 09:48:07 +08:00
Luis Pater
60abf6ba15 fix(pluginhost): advertise Windows plugin support without cgo
- Select the plugin-capable support flag on Windows even when CGO is disabled.
- Add a regression test for Windows no-CGO build constraints.

Closes: #7977
2026-11-24 08:36:11 +08:00
Luis Pater
237fa0e4f4 fix(interactions): map Claude stop reasons to statuses
- Translate Claude native and SSE terminal reasons into Interactions API terminal statuses.

- Preserve usage-only stream deltas until a stop reason arrives and cover all response modes with regression tests.

Closes: #7975
2026-11-24 08:21:54 +08:00
Luis Pater
37082b6203 fix(claude): preserve inline interaction tool arguments
- Emit Claude input JSON deltas for non-empty arguments supplied in step start events.
- Ignore semantically empty argument objects so later argument fragments remain valid.

Closes: #7976
2026-11-24 08:20:07 +08:00
Luis Pater
927ed39803 fix(openai): default empty responses tool arguments
- Emit a valid empty JSON object string for Responses function calls with omitted or empty arguments.
- Add regression coverage for omitted and explicitly empty function call arguments.

Closes: #7974
2026-11-24 08:19:18 +08:00
Luis Pater
335b69879d fix(codex): handle nil auth in websocket streams
- Guard websocket stream authentication logging so nil credentials do not panic.
- Add regression coverage for compact and required-websocket nil-auth paths.

Closes: #7970
2026-11-24 07:26:32 +08:00
Luis Pater
e9a92d25e7 fix(antigravity): restore standalone model enum discovery
- Check the in-memory model enum snapshot when local KV storage is inactive.
- Cover missing, matching, and stale standalone snapshots with regression tests.

Closes: #7969
2026-11-24 07:24:36 +08:00
Luis Pater
3dc07c08fe fix(openai): preserve interactions steps on null finish reasons
- Ignore null and empty finish reasons so ordinary stream chunks keep the current interaction step open.
- Add a regression test covering consecutive content deltas followed by a terminal finish reason.

Closes: #7973
2026-11-24 07:23:01 +08:00
Luis Pater
32625f13de fix(meta): report clean eof before terminal event
- Emit a truncated 502 stream error when Meta closes before response.completed or response.incomplete.
- Record failed usage with accumulated details and cover the regression with an end-to-end stream test.

Closes: #7971
2026-11-24 07:22:22 +08:00
Luis Pater
9e19ffd334 fix(gemini): merge multipart interaction user turns
- Merge adjacent pure-user contents before serializing Gemini interaction requests to satisfy role alternation.
- Add regression coverage for preserving text and image part order within a single user turn.

Closes: #7972
2026-11-24 07:19:36 +08:00
Luis Pater
38067a2997 fix(antigravity): align outbound request wire format
- Preserve normalizer request IDs and correlation labels while generating slash-delimited native fallbacks.
- Normalize native tool output keys and single-part system instructions across Antigravity request paths.

Closes: #7967
2026-11-24 07:06:16 +08:00
Luis Pater
06225fcf6e fix(antigravity): preserve signature cache scope on first refresh
- Retain the pre-refresh grant identity when initializing signature cache metadata for legacy credentials.
- Add a regression test proving cached Claude thinking signatures remain recoverable after the first token rotation.

Closes: #7968
2026-11-24 07:06:15 +08:00
sususu98
62c419e049 fix(translator,executor): preserve native Claude max_tokens and remove Vertex silent cap
- Replace ClaudePositiveMaxTokens with ClaudeMaxTokensRaw to forward raw JSON numeric max_tokens verbatim (including 0 for Claude cache pre-warming and >65536 values for Gemini 4 long decodes) without silent filtering, truncation, or clamping.
- Remove silent maxOutputTokens capping from GeminiVertexExecutor so Vertex requests (including Gemini 4 long decodes up to 1,048,576 tokens) follow official Vertex API semantics.
- Avoid intermediate slice allocation in ClaudeStopSequences with ForEach.
- Synchronize captured request bodies via buffered channels in claude_generation_config_regression_test.go and add end-to-end gemini-interactions coverage.
2026-11-24 00:17:13 +08:00
sususu98
ac415c083a fix(translator,executor): harden Claude generation constraints and Vertex max output token cap
- Centralize Claude max_tokens, stop_sequences, and output_config.format parsing in internal/translator/common/request.go to filter invalid/non-positive values and clamp huge max_tokens deterministically.
- Use the shared helpers in Gemini, Antigravity, and Interactions Claude request translators, adding Interactions response_format mapping and removing dead schema deletes.
- Apply provider output token capping across all Vertex execute/stream paths before the payload config barrier, using float comparison to close fractional and overflow bypasses.
- Add unit and executor regression tests covering translators, Antigravity Claude 5.5 prompt fallback, and Gemini/Vertex API key and service account paths.
2026-11-23 23:29:33 +08:00
Luis Pater
328423486a fix(translator): preserve Claude generation constraints
- Translate stop sequences and JSON schema output settings into Gemini generation configuration.
- Preserve max output tokens for Gemini and cover both Gemini and Antigravity request paths.

Closes: #7964
2026-11-23 23:04:54 +08:00
Luis Pater
f73b8132d0 fix(claude): stabilize advisor system prompt placement
- Select top-level caller system placement from the initial advisor tool declaration to keep the conversation prefix stable.
- Apply the same advisor-aware layout to message and count-token requests and cover both phases with a regression test.

Closes: #7941
2026-11-23 23:00:31 +08:00