- Make the prompt caching scope beta optional for Haiku 5.5 helpers without relaxing other identity checks.
- Cover helper detection and verify that streamed title requests preserve the original client and session.
Closes: #7809
- Scan all parts of the first user turn in generateStableSessionIDFromContentsForAuth for the first non-empty text part so multimodal turns retain a stable sessionId across turns.
- Normalize model names to lowercase in buildRequestDoc, geminiToAntigravityDocForAuth, and Execute routing, including lowercase fallback lookup when capping maxOutputTokens.
- Add regression tests covering multimodal Turn 1 session ID stability and case-insensitive Claude, Gemini Pro, and image model handling.
Closes: #7760
- Apply explicitly configured max-idle-conns-per-host even when lower than the base transport limit while preserving larger base limits when omitted, and include explicitness in antigravityTransportKey to avoid cache collisions across reloads.
- Treat max-idle-conns-per-host <= 0 as short-lived connection mode (MaxIdleConnsPerHost = -1) consistent with idle-conn-timeout <= 0 and ProxyConnectionPoolConfig, and align pool cap comments and docs with the 210s limit.
Closes: #7758
- Capture and emit thoughtSignature on non-thought text parts and preserve standalone empty-text signature carriers in convertStreamChunksToNonStream.
- Flush pending text or thought segments at signed and same-chunk part boundaries while preserving whitespace text separated by signatures.
- Add unit and end-to-end regression tests covering non-thought signatures, empty-text carriers, same-chunk boundaries, and whitespace preservation.
Closes: #7755
Add copilot presets to the registry models catalog and intersect
them with per-account /models capabilities, so usable credentials
get cold-start preset routes before discovery and account data
overrides limits, modalities, thinking and endpoint afterwards.
Replace the persisted metadata catalog with an immutable
in-memory Auth.CopilotCatalog with preset and unavailable
sentinels, preserving or revoking it across reloads, account
and origin changes, and re-resolving routes on each attempt.
Run discovery in a dedicated worker pool with per-account
transport, queued cancellation and skip-persist commits, gate
native-executor plugin models on catalog availability, and
remove login-time catalog fetch and embedded effort lists.
Add cmd/fetch_copilot_models to export the raw upstream /models
response atomically without modifying the stored credential.
BREAKING CHANGE: upstream-only Copilot models without a registry
preset are no longer routed, and the persisted copilot_catalog
metadata, ReadCatalog and string FetchCatalog APIs are removed
- Route Antigravity execution-time OAuth refreshes through a Manager refresh coordinator that serializes per-credential refreshes, persists rotated tokens with detached cancellation, updates in-flight MarkResult auth state, and keeps Home-dispatched snapshots isolated from local credentials.
- Preserve non-cancellation context values such as httptransport.Decorator and custom round trippers via context.WithoutCancel while stripping execution-scoped RequestProxyURL across OAuth refresh, project discovery, and credits hint refreshes.
- Add race-tested regression tests covering single refresh persistence, client cancellation, project discovery failure, safety-window crossing, unsupported attachments, Home isolation, request preparation context preservation, and proxy isolation.
Closes: #7749
- Classify genuinely missing Antigravity project_id as a credential-scoped 503 instead of HTTP 400 so broken credentials cool down and rotate.
- Preserve underlying cause chains, transient transport classification, and request-retry round eligibility for transport timeouts, internal discovery deadlines, and incomplete or transient onboardUser failures.
- Preserve full upstream response bodies, single-attempt discovery after token refresh, and structured TOS_VIOLATION and 429 metadata across loadCodeAssist and onboardUser responses.
Closes: #7751
- Replace ad-hoc pendingJSON buffering in ExecuteStream and executeClaudeNonStream with a bounded SSEJSONAssembler that ignores non-data SSE control lines, resets on genuine empty-line event boundaries, and discards oversized event tails until the next empty line.
- Surface all 400-599 mid-stream JSON error frames in executeClaudeNonStream with replay invalidation, TOS state handling, and 429 bookkeeping instead of letting non-403 errors degrade to synthetic 502 or truncated responses.
- Share 429 bookkeeping across HTTP and mid-stream SSE paths in ExecuteStream and executeClaudeNonStream, and defer clearing prior credits failure state until request success is confirmed.
Closes: #7753
- Add a requestScoped flag and IsRequestScoped method on statusErr so executor errors can explicitly opt into request-scoped handling without affecting ordinary status errors.
- Return a request-scoped 503 via newAntigravityTOSPauseStatusErr across Execute, executeClaudeNonStream, ExecuteStream, and CountTokens so the conductor stops immediately without rotating or cooling healthy credentials.
- Add executor and manager regression tests covering non-streaming, Claude non-streaming, streaming, and token-counting paths under an active TOS pause.
Closes: #7748
- Publish a known-unavailable credits hint after inspecting paidTier.availableCredits when the array is missing, empty, or lacks a parseable GOOGLE_ONE_AI entry.
- Bound loadCodeAssist response reads with io.LimitReader and validate JSON before publishing to avoid unbounded reads or false negative hints.
- Add race-tested unit tests covering empty/unmatched availableCredits, stale positive hint replacement, oversized bodies, and invalid JSON responses.
Closes: #7750
- Attach per-auth RoundTripper before prepareRequestAuth and retry once after 401 while fencing credential epoch and version.
- Select text-capable models without forcing gpt-5 on non-Codex/OpenAI providers and restrict max_output_tokens=16 to Codex.
- Honor caller cancellation across preparation, refresh, and stream drain without recording failure or cooldown, with unit and end-to-end tests.
Closes: #7737
Force the stream hint for the OpenAI-to-Claude response translator
whenever ExecuteStream is used, even if the original request set
stream:false or omitted it. Keep the original request unchanged
and add coverage for omitted, true, and false values.
Use GeminiTokenCountJSON for Gemini-format requests instead of
falling back to OpenAI usage JSON, and reuse the shared Claude
input_tokens helper for Claude and OpenAI Response formats.
- Publish Copilot catalog and plugin models with native IDs, aliases, and auth prefixes while preserving suffixed routes.
- Route requests through exact registered Copilot models and send the resolved native model upstream.
- Reconcile Copilot model states and route metadata against published routes; document Copilot support in OAuth alias and error configuration.
Add device OAuth login via `--copilot-login`, trusted-endpoint token
exchange, and per-account model catalog discovery with independent
refresh so accounts expose only entitled Chat, Messages, or Responses
routes.
Implement the executor with official CLI parity defaults, cross-protocol
translation, account-scoped thinking, turn linking, and server-side
replay of private reasoning and signatures, keeping payload rules final.
- Route errPrepare through the same error pipeline as execution errors in all four conductor paths (Execute/CountTokens/Stream/Home): record RetryAfter and CredentialScope, match request-scoped error rules, stop on stop-actions and invalid requests, and preserve the upstream attempt via markUpstreamExecutionAttemptFromContext plus annotateTrustedRetryAfterByHint/syncPreferredUpstreamError so stop responses keep their retry hint.
- Mark upstream attempts only at real HTTP boundaries (OAuth token refresh, project discovery) and propagate upstream Retry-After and credential scope from Antigravity prepare failures, while keeping local missing-credential errors and status-less transport faults from being misclassified or outranking a genuine upstream rejection.
Closes: #7726
- Mark unkeyed message response.output_item.done as seen to prevent duplicate terminal synthesis.
- Preserve fallback output_index tracking for ID-bearing events without colliding with shifted item IDs, require item.type == message in Observe, and skip duplicate response.content_part.added frames.
- Guard Claude HasTextDelta on non-empty deltas, skip empty strings in Interactions codexContentText fallback, reset HasMessageTextDelta on OpenAI Chat response.created, and build Gemini refusal parts via ojson.Doc.
- Track streamed message items in ResponsesStreamOutputTracker and synthesize missing item/part/delta/done events before terminal response.completed or response.incomplete when upstream omits item-level SSE frames.
- Include response.refusal.delta in HasMeaningfulCodexOutputDelta.
- Support refusal content parts and response.refusal.delta across Codex response translators (OpenAI Chat, Claude, Gemini, and Interactions) with regression tests.
- Filter x-anthropic-billing-header: system text and text blocks via util.IsClaudeCodeAttributionSystemText before hashing the Claude replay system lane, matching translator stripping behavior.
- Return an empty lane when system contains only attribution content so per-request cch and cc_prompt_id changes no longer break multi-turn thoughtSignature replay.
- Add regression tests verifying signature replay across changing attribution headers, attribution-only edge cases, and preserved main vs. title lane isolation.
Closes: #7766
- Derive synthesized Antigravity request.sessionId deterministically from auth.ID and canonical, execution, or derived session identity across non-stream, Claude non-stream, and streaming paths.
- Scope the content-based fallback session ID by auth.ID so credential failovers emit a fresh request.sessionId while keeping explicit request.sessionId values and reasoning replay keys unchanged.
- Add regression tests verifying cross-model stability on the same credential and sessionId rotation across credential failover.
Closes: #7706
- Use context.WithTimeout(lifecycle, antigravityCreditsHintRefreshTimeout) for the post-OAuth-refresh credits warm so a stalled loadCodeAssist no longer leaks the goroutine or permanently wedges state.task.
- Keep lifecycle bound to the caller context to preserve issue-6199 caller-cancellation semantics while giving the request an independent bounded budget.
- Add a regression test proving the stalled task self-releases and a subsequent refresh republishes the credits balance.
Closes: #7702
- Track advisor tool_use_id credential ownership in a bounded sliding-TTL store with shared KV first-writer-wins persistence and record minted blocks from 2xx JSON/SSE responses as well as post-rule accepted requests.
- Strip foreign advisor blocks and empty advisor-only turns via ojson.Doc in Execute, ExecuteStream, and countTokensUpstream before cloaking, payload rules, and CCH signing while preserving own-credential advisor state and paired ordinary tool_result blocks.
- Add regression tests covering streaming/non-streaming rebinds, 429 in-request failover, count_tokens, KV persistence/consistency, sliding TTL renewal, and payload-rule barrier ordering.
Closes: #7638
- Add "uniqueItems" to the stripIncompatiblePatternsFromJSON fast-path guard and remove schema-level uniqueItems keys in stripIncompatiblePatterns while preserving literal properties.uniqueItems fields and non-schema user data.
- Update NormalizeCodexToolSchemas documentation and add regression tests across tool-schema, helps, and Codex HTTP and WebSocket executors.
Closes: #7690
- Add session-scoped instruction baselines with validation, expiration, and optional KV storage.
- Preserve instruction state across HTTP and WebSocket turns, rejecting invalid or unreconstructable session requests.
- Prevent internal session markers from reaching upstream or request logs.
- Insert Interactions system instructions as a leading developer message in Codex input instead of forwarding them as `instructions`.
- Preserve instruction text and aliases while keeping Responses-format instructions unchanged.
Allow payload replace rules to target arbitrary existing string
nodes via JSON paths relative to the provider payload root, as a
mutually exclusive alternative to role, positions, and all.
Resolve paths against the pre-write document, deduplicate nodes,
and skip missing, non-string, and computed values. Support queries,
projections, wildcard keys, escaped keys, and identity suffixes
while preserving concrete write tracking. Validate path targets
in config and document the new form in the example config.
Cover WAV and MP3 Chat audio through MetaExecutor streaming and non-streaming requests. Require nested input_audio data/format and reject flattened fields. Avoid injecting an empty format when the caller omits it.
Store bounded local read, dial, and stream errors as diagnostics
instead of rendering them inside API RESPONSE sections, and render
them in the downstream RESPONSE section after status selection.
Prevent handler-synthesized payloads from appending to executor
capture or fabricating upstream responses for failed attempts.
Allow payload replace rules to target system and developer
messages in addition to user, using final upstream roles after
translation. Count Claude system, Gemini systemInstruction,
and Responses instructions as the first system message, while
keeping assistant, tool, thinking, and non-text content
unmodified. Update validation, docs, and executor coverage.
Allow payload.replace entries to use Go RE2 patterns via
{pattern, replacement} alongside existing literal mappings,
including capture expansion such as $1 and ${1}.
Skip invalid regex entries individually with index-only
warnings so valid replacements still apply without leaking
pattern text. Update YAML/JSON parsing, validation, docs,
and executor handling while preserving ordered, per-block
replacement semantics across supported layouts.
Move Claude prompt-cache stripping before payload finalization so
user-injected values survive, and extract count-tokens betas only
after finalization without changing business semantics.
Capture Codex instructions and xAI transcript input before payload
rules for duplex, replay, and compaction inheritance, and reuse the
exact finalized xAI websocket frame on retries. This prevents rules
from being applied twice, overwritten, or accumulating across turns.
Compute replacements during a single ForEach traversal and collect
only changed values before mutating the document, avoiding array
allocations and second lookups for unchanged text. Stop scanning
after the last targeted user position.
- Read nested body/error HTTP status codes in parseCodexWebsocketErrorWithCooling and clearCodexReasoningReplayOnWebsocketError so Retry-After and request headers are preserved on typeless WebSocket errors.
- Guard responsesSSEPayloadHasError and SSE error inference behind explicit event/payload type checks so non-error frames such as response.metadata containing body.error are not rewritten into terminal errors.
- Build OpenAI Responses stream error and failed chunks directly through ojson.Doc with single-exit serialization, supporting scalar error strings without map mutations.
- Preserve valid top-level and body envelope HTTP error status codes when normalizing typeless Codex SSE failures and Responses SSE frames.
- Normalize scalar and blank WebSocket error fields purely via ojson.Doc.
Add ordered literal replace rules that rewrite existing user
text at selected one-based positions, or all users, in the final
upstream payload after overrides and before filters.
Support OpenAI Chat, Claude, Responses/Codex, Gemini, and
Antigravity layouts while leaving system prompts, tools, images,
and thinking untouched. Validate and sanitize rule config,
preserve it through YAML/JSON and runtime cloning, surface it
in config diffs and SDK types, and document it in the example
config.
Normalize string websocket errors without discarding their messages. Recognize untyped and body-wrapped failures across SSE, websocket, and duplex paths while retaining status, headers, and sequence numbers.
Cover transport and format combinations, replay invalidation, credential status precedence, and Responses framing with regression tests.
- Add bio_policy, cyber_policy_violation, misalignment_policy_violation, content_policy_violation, and image_content_policy_violation to request-fault codes so policy rejections stop failover without cooling down credentials.
- Unify trusted error JSON extraction across auth, model-not-found, credit-balance, and request-fault checks while restricting wrapper unwrapping and policy-text matching to prevent prompt-echo false positives.
- Map typeless policy error codes and body.error layouts consistently across Codex SSE/WebSocket, Responses, xAI, and Claude stream translation paths, filling blank messages with official fallback copy.
- Strip thinking suffixes from `advisor_*` tool `model` fields inside `sanitizeClaudeMessagesForClaudeUpstreamWithDebugDoc` before payload config rules run.
- Preserve each advisor tool's own base model and leave non-advisor tool entries untouched.
- Add regression tests covering API key and OAuth flows across `Execute`, `ExecuteStream`, `CountTokens`, payload overrides, and edge cases.
Closes: #7591