- Recognize non-empty string audioTranscription and audio_transcription parts in InspectGeminiZeroOutputPayload while preserving thought-only classification.
- Support snake_case audio_transcription parts in OpenAI Chat Completions Gemini streaming and non-streaming response translators so admitted transcripts are delivered to clients.
- Add regression unit tests covering zero-output inspection, non-stream checks, stream guard emission, and OpenAI transcript translation.
Closes: #8150
- Guard trailing frame emission in Gemini and Vertex Interactions streaming executors so buffered partial frames are only flushed on clean EOF with an active context, while preserving trailing newline detection via ScanInteractionsSSELines to prevent unterminated whitespace from triggering in-loop flushes.
- Record non-nil scanner errors in internal API response diagnostics before EndApplyPatchStream finalization so raw read failures are never lost while keeping the sanitized 502 downstream apply_patch contract intact.
- Add regression tests covering mid-frame scanner errors, canceled-context diagnostic recording, apply_patch scanner error diagnostics, unterminated whitespace tails, and clean EOF trailing frames.
Closes: #8138
- Escape opts.Alt with url.QueryEscape at all six upstream URL construction sites across GeminiExecutor and GeminiVertexExecutor to prevent query parameter injection and URL parsing errors.
- Rename the shadowed local url string variables to endpointURL at those sites and add regression tests covering Execute and ExecuteStream for Gemini and Vertex API key and service account paths.
Closes: #8137
- Filter non-terminal SSE usageMetadata in both Vertex service-account and API-key streaming paths before translation while preserving internal usage accounting and trailing usage-only frames after a finish signal without traceId.
- Add regression tests covering API-key and service-account streaming across Gemini, OpenAI, and Claude formats for single-frame and split-terminal usage delivery.
Closes: #8134
- Check GeminiFilterBlockMessage and geminiPromptBlockErrorMessage before flushing buffered filter frames or setting sawFinishReason across GeminiExecutor and both GeminiVertexExecutor streaming loops so terminal and consecutive filter-blocked frames with promptFeedback.blockReason return HTTP 400.
- Preserve finish-signal tracking when a buffered frame is flushed by a subsequent normal response frame.
- Add streaming regression tests covering single and consecutive filter-blocked frames with SAFETY and PROHIBITED_CONTENT across Gemini, Vertex API key, and Vertex service account paths.
Closes: #8133
- Extract and inspect only the URL path in a shared helps.VertexAPIVersionSuffix helper so bare version-like hostnames such as http://vertex1 or http://v1-gateway still receive /v1 in both Vertex API-key model URLs and Vertex OpenAPI base URLs.
- Add regression tests covering bare version-like hostnames, ports, trailing slashes, and explicit version paths for vertexAPIKeyModelsURL and Vertex OpenAPI base URL builders.
Closes: #8122
- Require numeric validation for maxOutputTokens, topP, topK, and thinkingBudget so null or invalid values no longer coerce to 0 or disable thinking while keeping temperature omitted per #4071 and #4383.
- Support snake_case Gemini SDK fields for generation_config, thinking_config, function_declarations, parameters_json_schema, and mixed thinking summary paths.
- Align stripTranslatedDefaultMaxTokens in ClaudeExecutor with the translator's Gemini generationConfig and positive maxOutputTokens alias selection.
Closes: #8112
- Resolve single and multi-tool tool_choice names through shortMap (emitting allowed_tools subsets for multi-entry ANY whitelists) and remove the legacy raw-byte helper.
- Support snake_case Gemini SDK fields across request and response tool name mapping and default missing or non-object functionCall.args to "{}".
- Require numeric thinkingBudget and string thinkingLevel values in both Gemini-to-Codex translation and shared thinking config extraction so null values do not disable reasoning.
Closes: #8098
- Guard nil bufio.Scanner before calling scanner.Err() on Vertex Imagen streaming paths for both service account and API key auth.
- Recognize and normalize Meta response.done terminal events across streaming and non-streaming translation paths with regression tests.
- Align Antigravity issue 7000 boundary and apply_patch empty-stream test assertions with single-part system instructions and issue 7990 transient zero-output retries.
Publish upstream 401 and 429 responses from Antigravity project
discovery during home auth preparation so credential failures are
attributed using the effective token and upstream model.
Thread the upstream model through prepareHomeRequestAuth via
context and generalize the home credential failure publisher to
support non-401 statuses. Add coverage for execute, stream, and
count paths, including delegated plugins and refreshed tokens.
Advertise ready executor plugins and their supported credential
providers in Home auth dispatch, and let Home select a plugin via
executor_plugin. Resolve the live plugin bound to the credential
provider, prepare credentials through the provider preparer
including Antigravity token refresh, and preserve the upstream
model and model info for plugin execution.
Add the ExecutorAuthProviders capability over the plugin RPC
boundary and surface unavailable Home plugin executors as a
terminal 503 without retrying other credentials.
- 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
- 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
- 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
- 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
- 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
- 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
- Guard websocket stream authentication logging so nil credentials do not panic.
- Add regression coverage for compact and required-websocket nil-auth paths.
Closes: #7970
- 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
- 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
- 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.
- 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.
- 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
- 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
- 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
- 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
- Prevent buffered Gemini policy text from reaching clients after scanner failures.
- Reject truncated successor frames and cover Gemini and Vertex authentication paths.
Closes: #7956
- Parse structured and header retry hints for HTTP 503 capacity responses.
- Verify the propagated delay is used by model cooldown scheduling.
Closes: #7957
OpenAI Chat/Responses and xAI appliers accept effort levels
only, so numeric budgets on hybrid models were not clamped
to supported levels. Clear Min/Max on a copy of the model
info before conversion, preserving catalog capabilities.
Use ClampLevel for the Devin swe-1-7 medium variant so
budget-derived levels select the correct upstream UID.
Add regression tests for Copilot, Devin, and OpenAI-compat
chat covering body and suffix budgets across formats.
Replace custom Devin level ordering and clampEffort logic with
thinking.ParseLevelSuffix and thinking.ClampLevel, adapting to the
updated ConvertBudgetToLevel signature. Ties now resolve to the
lower effort per canonical rules, updating affected tests.
Document devin as a supported OAuth channel in config.example.yaml
with model alias and excluded model examples.
Add an xhigh upper bound of 32768 so larger budgets map to max
instead of xhigh. Convert translated budgets to adaptive effort
for hybrid Claude and Interactions models in validation rather
than in the Gemini-to-Claude translator, which now preserves the
budget for model-aware handling.
Validate user-defined models before normalization so translated
budgets are clamped to model limits while custom settings are
preserved. Reuse the canonical budget conversion for Devin and
prefer the lower effort on ties only for budget-derived levels.
- Retain pending Gemini filter errors when trailing stream frames contain no visible content.
- Reuse zero-output inspection so valid code and media content still disambiguate buffered filter frames.
- Add streaming regressions for terminal metadata, empty media placeholders, and executable code content.
Closes: #7918
- Retain candidate grounding metadata when terminal SSE chunks omit it.
- Add a regression test for citations from an earlier response chunk.
Closes: #7919
- Keep pending Gemini filter errors when trailing usage or finish frames contain no real content.
- Cover terminal metadata and empty text carrier regressions for Claude non-stream execution.
Closes: #7915
- Clamp Claude thinking budgets when the model output limit reduces maxOutputTokens below an accepted requested ceiling.
- Add regression coverage for Antigravity Sonnet and Opus models, including case-insensitive model resolution.
Closes: #7916
Resolve model enums per credential and correlate agent request IDs with session labels. Preserve the reference key order for agent envelopes and remove formatting whitespace when serializing all model requests.
Copilot Chat can ignore assistant history sent as plain text
content blocks, so flatten it to a string even for native
OpenAI requests. Leave annotated blocks and native user
content untouched, and keep payload overrides as final barrier.
- Flatten single-part and multi-part plain-text content arrays on cross-protocol assistant messages to strings in NormalizeCopilotRequest while preserving native Chat arrays, annotated blocks, and multimodal content, and guard Claude empty-string assistant content-to-null conversion behind tool_calls checks.
- Split CopilotExecutor.httpRequest into prepareAuthorizedRequest and doHTTPRequest so RecordAPIRequest runs only after credential and trusted-origin validation, capturing the final post-override wire payload and masked headers without logging direct HttpRequest callers.
- Capture upstream response metadata via RecordAPIResponseMetadata before decompression and header stripping, log non-2xx and non-stream bodies via AppendAPIResponseChunk, and record transport, decode, read, invalid-JSON, upstream-error, and translation failures via RecordAPIResponseError.
- Add request-scoped helps.BindAPIResponseStreamLogger and logging.APIResponseSnapshotter (snapshotted and closed during ResponseWriterWrapper.Finalize) with per-attempt synchronization so asynchronous copilotStream callbacks retain no *gin.Context reference and cannot race with or pollute reused pooled Gin contexts.
- Add regression and race tests covering Copilot Chat assistant text replay, non-stream and SSE stream upstream logging, error paths, payload override finality, multi-attempt retries, and concurrent mid-callback Gin context reuse.
- Scope Antigravity permanent failures, balances, hints, cooldowns, Home KV keys, and refresh state by credential registration.
- Fence late asynchronous publications and reclaim retired in-process state after same-ID credential replacement.
- Add regression coverage for standalone and Home KV paths, including zero-epoch replacements and equal timestamps.
Closes: #7795
- Defer replayAccumulator.Commit in executeClaudeNonStream and cacheAntigravityReasoningReplayFromResponse in Execute until after ApplyPatchTranslationError, empty translation output, and TranslatedClaudeErrorPayload checks pass.
- Preserve pre-grounding response bytes for Execute replay extraction while relying on Commit's existing context.WithoutCancel detachment and leaving non-2xx body reads unchanged by design.
- Add KV-backed regression tests covering rejected apply_patch and translated Claude error turns across both non-streaming paths as well as successful persistence.
Closes: #7888
Introduce SourceModelID as the canonical provider-qualified
source behind each published route and store the Devin catalog
with bare IDs, qualifying it only at publication and lookup.
Generalize Copilot's published-route selection, cooldown
migration, websocket matching, and execution resolution to
Devin, and match OAuth settings and payload rules against the
canonical source so aliases and prefixed routes share config.
Handle qualified model IDs from newer Homes, preserve explicit
prefixed alias names, and resolve Devin auto effort against
catalog-supported levels instead of defaulting to high.
- Inspect top-level JSON error payloads on HTTP 2xx responses in Execute and route them through shared upstream error bookkeeping while deferring credits failure state clearing until response success is confirmed.
- Evict credential-scoped idle pooled transports on all 403 and 401 errors across Antigravity execute, streaming, and count-tokens paths, including mid-stream SSE error frames.
- Add regression tests covering HTTP 200 in-band errors in Execute and keep-alive connection eviction on HTTP and mid-stream 403/401 errors.
Closes: #7882