Commit Graph

5143 Commits

Author SHA1 Message Date
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
Luis Pater
85225381d8 fix(antigravity): isolate signature cache by credential
- Scope Claude signature recovery and writes to the active credential.
- Preserve scoped cache continuity across verified token refreshes.
- Fail closed for unscoped recovery and credential replacement.
- Add stream and non-stream multi-account isolation regression coverage.

Closes: #7960
v8.1.2
2026-11-23 22:46:33 +08:00
Luis Pater
e049c336b6 fix(vertex): normalize Imagen predict protocol
- Convert Imagen requests and responses consistently across API-key and service-account execution paths.
- Handle non-streaming Imagen JSON directly on stream APIs while preserving final payload rule ordering.

Closes: #7955
2026-11-23 22:46:31 +08:00
Luis Pater
bffe6e7ea1 fix(antigravity): isolate connection pools after credential replacement
- Scope pooled transports by stable auth identity and a digest of the refresh grant.
- Add a regression test proving replacement credentials use a distinct TCP connection.

Closes: #7961
2026-11-23 22:46:30 +08:00
Luis Pater
aeed971579 fix(gemini): suppress pending filter frames on stream errors
- Prevent buffered Gemini policy text from reaching clients after scanner failures.
- Reject truncated successor frames and cover Gemini and Vertex authentication paths.

Closes: #7956
2026-11-23 22:46:28 +08:00
Luis Pater
d3d2817d25 fix(antigravity): preserve mixed native tools in chat requests
- Combine function declarations with code execution and URL context tools when translating mixed Chat Completions requests.
- Update native tool regression coverage while retaining the dedicated Google Search isolation behavior.

Closes: #7959
2026-11-23 22:46:27 +08:00
Luis Pater
3307446a82 fix(antigravity): normalize assistant image data URLs
- Reuse the shared OpenAI file-data normalizer for assistant image parts to preserve base64 payloads with media parameters.
- Add a regression test covering parameterized assistant image data URLs.

Closes: #7958
2026-11-23 22:46:25 +08:00
Luis Pater
ae3d80f70d fix(antigravity): honor retry hints on capacity errors
- Parse structured and header retry hints for HTTP 503 capacity responses.
- Verify the propagated delay is used by model cooldown scheduling.

Closes: #7957
2026-11-23 22:46:24 +08:00
Luis Pater
ee5225e16f fix(auth): preserve parent affinity after fork failure
- Exclude fork parent cache aliases from result-driven affinity updates.
- Add a regression test proving failed forks retain the parent binding.

Closes: #7952
2026-11-23 22:46:23 +08:00
Luis Pater
d2b7dbbdbc fix(codex): default missing Claude tool input arguments
- Normalize omitted or blank Claude tool_use input to an empty JSON object string for Codex.
- Add a regression test that verifies the argument value and its JSON string type.

Closes: #7939
2026-11-23 22:46:21 +08:00
Luis Pater
f5ef0c0f8e fix(auth): preserve stream bootstrap attempt identity
- Rewrap stream bootstrap errors with the original attempt ID across new and existing bootstrap paths.
- Add regression coverage for preserving outer and inner attempt metadata.

Closes: #7953
2026-11-23 22:46:20 +08:00
Luis Pater
75d03aea2c fix(thinking): disable invalid Claude budgets
- Disable Claude thinking when max tokens cannot fit the minimum supported budget.
- Add regression coverage for minimum and sub-minimum output token limits.

Closes: #7954
2026-11-23 22:46:18 +08:00
Luis Pater
dd866f6c04 fix(gemini): default omitted tool arguments to empty object
- Emit valid JSON object strings for parameterless streaming and non-streaming tool calls.
- Cover both Gemini response paths with regression assertions for string type and value.

Closes: #7938
2026-11-23 22:46:17 +08:00
Luis Pater
dc2455d998 fix(antigravity): validate compaction summaries
- Reject incomplete summaries before sealing Antigravity compaction responses.
- Preserve cached and reasoning token details in compaction responses and streams.

Closes: #7934
2026-11-23 22:46:15 +08:00
Luis Pater
2b7af40e01 fix(gemini): preserve parameterless Claude tool calls
- Default missing Claude tool input to an empty object so Gemini receives a matching functionCall.
- Add regression coverage for functionCall and functionResponse pairing when input is omitted.

Closes: #7937
2026-11-23 22:46:14 +08:00
Luis Pater
5621004e1c fix(translator): preserve Claude max token finish reason
- Keep max token stream termination as MAX_TOKENS for Gemini clients.
- Cover max token and default stop termination behavior with regression tests.

Closes: #7936
2026-11-23 22:46:13 +08:00