- Enforce active short-cooldown checks at CountTokens entry without credits bypass and share model-aware schema sanitization with buildRequestDoc before payload finalization.
- Route CountTokens HTTP 429 responses through shared 429 state bookkeeping with single idle-transport eviction per response and bound CountTokens response reads to 1 MiB.
- Add regression tests covering short-cooldown gating, 429 bookkeeping, bounded response reads, model schema sanitization, and payload-finalizer ordering.
Closes: #7786
- Skip overwriting functionCallingConfig.mode with VALIDATED in buildRequestDoc when the request already specifies mode NONE under camelCase or snake_case proto-JSON paths, canonicalizing non-canonical NONE strings in place.
- Add regression tests covering OpenAI Chat Completions, OpenAI Responses, Claude, Gemini, proto-JSON alias spellings, and final payload rule precedence on Antigravity Claude models.
Closes: #7792
- Evict non-reusable ephemeral xAI websocket ID states when their last in-flight stream ends, while preserving explicit session states from options or request metadata.
- Add 24-hour idle TTL expiration with periodic background cleanup and in-flight protection to xaiWebsocketIDStateStore without bounding total entry count.
- Coordinate persistent session and ID state acquisition and teardown under store.mu so CloseExecutionSession and bulk shutdown clear both stores atomically.
Closes: #7746
- Add ParseRetryDelayWithHeaders in executor helps to fall back to HTTP Retry-After headers (including explicit 0-second hints) when a 429 body carries no retry delay while preserving body precedence and Gemini positive-only semantics.
- Thread httpResp.Header into applyAntigravity429State, decideAntigravity429WithHeaders, and newAntigravityStatusErrWithHeaders across Execute, executeClaudeNonStream, ExecuteStream, and CountTokens, passing nil headers for mid-stream SSE 429 frames.
- Add regression tests covering header fallback, threshold classification, explicit zero-second handling, MarkResult cooldown scheduling, and all four Antigravity request paths.
Closes: #7821
- Short-circuit AntigravityExecutor.HttpRequest with a request-scoped 503 when tos-pause-window is active before token acquisition or upstream dialing.
- Normalize outgoing Host from the request URL, allocate a fresh header map without mutating caller headers, adopt updated auth snapshots after token refresh, and apply per-credential header:* attributes consistently with buildRequestDoc and CountTokens.
- Strip credential-configured custom headers, custom Host, and Authorization on cross-origin redirects, with race-checked regression tests.
Closes: #7824
- Introduce a dedicated antigravityClaude55Model matcher covering low, medium, high, max, and reasoning effort suffixes so structured output requests fall back to prompt instructions instead of leaving native responseSchema and forcing VALIDATED tool mode.
- Keep the direct Claude claude55Model matcher scoped to its existing variants in claude_tool_choice.go to avoid changing direct Claude tool_choice normalization.
- Add regression tests covering Antigravity structured-output conversion and direct Claude tool_choice boundaries across all six new effort variants.
Closes: #7823
- Mark Antigravity 403 VALIDATION_REQUIRED and 401 inference/auth errors as credential-scoped and close idle pooled transports on 403 TOS_VIOLATION and VALIDATION_REQUIRED.
- Propagate non-429 credential-scoped cooldowns to auth-level retry state and model projections so sibling models stop selecting blocked credentials.
- Separate refresh-clearable auth/grant cooldowns from non-auth credential cooldowns across OAuth refresh, token rotation, shadow unwrapping, and restart recovery.
Closes: #7814
- Delegate SOCKS5/SOCKS5H Transport.DialContext calls in BuildHTTPTransport through proxy.ContextDialer so caller deadlines and cancellation abort stalled dials and handshakes without adding a fixed dialer timeout.
- Isolate Antigravity project-discovery HTTP/1.1 transports via newAntigravityProjectDiscoveryHTTPClient with deferred CloseIdleConnections so canceled credential acquisition cancels abandoned in-flight dials without affecting the shared pool.
- Add SOCKS5/SOCKS5H cancellation, deadline, tunnel, and HTTP client regression tests verifying prompt request exit and peer socket closure.
Closes: #7819
- Set httpReq.Host from the resolved loadCodeAssist base URL and apply static credential-scoped header:* attributes without reading pooled caller Gin contexts or session IDs.
- Invoke applyAntigravityTOSState on bounded 403 responses in updateAntigravityCreditsBalanceForTask while reusing task/epoch and context cancellation guards so superseded refreshes cannot arm pool-wide TOS pauses.
- Add race-tested regression tests covering Host resolution and overrides, detached background header safety, and active versus superseded/canceled 403 TOS_VIOLATION handling.
Closes: #7820
Resolve Copilot routes from Home-provided model info when Home is
enabled, allowing models absent from the local catalog to execute,
stream, and count tokens. Attach resolved info before after-auth
interception and skip the local catalog refresh in Home mode.
Expose Copilot device-login completion and model discovery through
the SDK. Fix Codex token counting for string inputs, string message
content, and role-only messages.
- Carry typed OpenAI reasoning arrays through streamed and non-streamed Responses without changing their bytes.
- Replay signed thoughts only on the Devin route and cover fragmented and late signatures across tool turns.
Closes: #7805
- 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.