- Add `ExchangeAntigravityCode`, `FetchAntigravityUserInfo`, and `CompleteAntigravityOAuth` helpers for programmatic authentication.
- Introduce `BuildAntigravityAuthURL` and `AntigravityDefaultCallbackURI` to support custom and default redirect flows.
- Refactor Antigravity credential record assembly into `BuildAntigravityAuth`.
Closes: #5593
- Strip monotonic clock readings using `Round(0)` on calculated quota retry and recover deadlines.
- Ensure quota cooldown times rely on wall-clock timestamps across model and auth states.
Closes: #5590
- Extract `reasoning_tokens` from Codex response usage across streaming and non-streaming responses.
- Map valid non-negative reasoning tokens to `usage.output_tokens_details.thinking_tokens`.
- Clamp reasoning tokens to `output_tokens` and ignore invalid or negative values.
Closes: #5587
- Cap the timer sleep duration to 30 seconds to wake promptly after system suspend.
- Factor out `nextWait` to clamp the maximum wait duration for scheduled credential refreshes.
Closes: #5584
- Buffer text and thinking content arriving while a tool call block is currently open.
- Ensure tool calls are emitted and finalized sequentially to meet Anthropic content block constraints.
- Flush buffered interleaved content blocks after open tool calls are closed.
Closes: #5581
- Add shortMode, idleConnTimeout, and maxIdleConnsPerHost to antigravityTransportKey.
- Prevent stale transport reuse during hot-reload race windows under load.
- Add TestAntigravityTransportKeySeparatesPoolSettingsAcrossReload regression test.
- Route `openai-response` source format requests to dedicated streaming and non-streaming responses handlers.
- Add upstream URL resolution for Kimi Responses API endpoints based on auth attributes.
- Normalize `openai-response` provider format to codex during thinking parameter resolution.
Closes: #5400#5571
2.1.258 attaches x-client-request-id only when the base URL is
api.anthropic.com. Since the helper check made this header optional, a
helper that arrived without one gained a freshly generated UUID on a
custom upstream. Attach it only for a first-party upstream or when the
caller actually sent one, and otherwise keep the header absent as the
real client would.
advanced-tool-use-2025-11-20 is sent only while tool search or another
advanced tool-use feature is on the wire, or when the caller asks for it;
2.1.258 no longer attaches it to plain tool declarations (measured: 158
inline tools, no beta). A caller-supplied afk-mode-2026-01-31 is forwarded
between fast-mode and extended-cache-ttl and is an insertion boundary for
the advisor beta.
2.1.258 Haiku helpers offer the same full compression set as the main
thread and never send X-Stainless-Async. x-client-request-id is attached
only when the client's base URL is api.anthropic.com, so the helper
transport check accepts an empty value or a valid UUID and rejects only a
malformed one.
- Translate `responseJsonSchema` and `response_json_schema` within `generationConfig` to `responseSchema` for Antigravity compatibility.
- Remove deprecated schema keys while preserving existing `responseSchema` fields.
Closes: #5570
- Check `error.message` and `message` for retry advice on upstream `server_error` responses.
- Treat server errors indicating the request can be retried as eligible overload bootstrap failures.
- Replace characters outside `[a-zA-Z0-9_-]` with underscores during tool name shortening to meet Codex upstream requirements.
- Collect tool names across `tools` declarations, `tool_choice`, and assistant `tool_calls` history in requests to ensure consistent shortening and reverse restoration.
Closes: #5564
- Propagate upstream `service_tier` across streaming chunks and non-stream response bodies.
- Set both `cache_write_tokens` and `cached_creation_tokens` in prompt token details while preserving integer precision.
- Validate `cache_write_tokens` format and reject non-integer or malformed values.
Closes: #5543
- Wait for channel buffer capacity instead of dropping queued frames when delivering terminal messages.
- Cancel pending requests with the appropriate cause if terminal delivery is interrupted by context cancellation or session closure.
Closes: #5535
- Build structured output prompt instructions for `json_object` and `json_schema` formats.
- Inject schema and JSON formatting instructions into Claude system blocks for chat completions requests.
- Support `text.format` and fallback `response_format` structured output for OpenAI Responses conversions.
Closes: #5533
- Normalize complex constant `oneOf` and `anyOf` tool parameter schemas into equivalent enums to prevent upstream aborts.
- Escape property keys containing dots and colons during schema updates to prevent invalid path splitting.
- Identify terminal `response.incomplete` events with zero output tokens and no content as upstream failures.
Closes: #5551
- Configure upstream connection pool under antigravity.connection-pool with enabled: false by default.
- In short connection mode, set MaxIdleConnsPerHost = -1 with DisableKeepAlives = false, ensuring immediate TCP termination after response body completion without leaking Connection: close request headers.
- When pooling is explicitly enabled (enabled: true), cap idle-conn-timeout at 210s (leaving a 30s safety buffer below Google Frontend's 240s Keep-Alive cutoff) and default max-idle-conns-per-host to 2 (bounded at 100).
- Refactor TransportCache to execute CloseIdleConnections outside the mutex lock during LRU eviction and matching closes.
- Proactively evict and close idle connections on 429 quota exhaustion across Execute, ExecuteStream, and CountTokens.
- Wire hot-reload diff detection and server reload purge hooks for graceful transport pool updates.
- Detect `collaboration-optimize.` tool conflicts during multi-agent v2 request optimization.
- Restore dot-prefixed tool calls back to the collaboration namespace and base tool name in responses.
Closes: #5524
- Cache trailing thought signatures tied to visible assistant text to keep carriers off the client reasoning timeline.
- Restore and recombine cached text signatures when converting OpenAI Responses input requests back to Gemini.
- Fall back to detached carrier emission when signature caching fails or invariants are unmet.
Closes: #5513
- Ensure subsequent failure updates only extend and do not shorten active model-level or credential-level retry deadlines.
- Retain longer per-model retry deadlines when propagating credential-scoped quota failures across sibling models.
- Avoid promoting sibling non-quota retry deadlines into quota recovery states during credential failure propagation.
- Reflect credential-wide cooldowns in client model projections when no per-model states exist.
Closes: #5501
- Remove or skip emitting `request.tools` across Claude, OpenAI, and Interactions translators when `tool_choice` is set to `none`.
- Support object format `{"type": "none"}` for `tool_choice` in OpenAI chat completions.
- Skip interleaved thinking hint injection in Claude requests when tools are disabled via `tool_choice`.
Closes: #5485
- Maintain non-tool-result content blocks at their original indices in `AlignClaudeToolResults` instead of moving them after results.
- Reorder tool results in-place into their original slot indices based on preceding tool use IDs.
Closes: #5484
- Ensure Gemini, AI Studio, Vertex, and Antigravity requests end with a user turn to prevent upstream errors when trailing with model content.
- Preserve trailing turns that contain a function response and skip trailing adjustments for `countTokens` actions or Claude models.
- Introduce boundary normalization helpers to validate both leading and trailing turn roles.
Closes: #5358
- Fall back to request payload input items or `previous_response_id` during websocket compaction when transcript snapshot is empty.
- Preserve `previous_response_id` in prepared request body for xAI execution.
Closes: #5205
- Add payload detection and preparation helpers for compaction triggers and summary generation.
- Implement AES-GCM sealing and unsealing to store and restore opaque compaction capsules across turns.
- Support expanding compaction capsules into developer context for downstream turns.
- Provide summary text extraction across Gemini, Claude, and OpenAI response formats.
- Add builders for compaction non-stream JSON responses and SSE stream frames.
Closes: #5094
- Add HTTPWireProfile to sdk/pluginapi on HTTPRequest with wire_profile JSON tag
- Decode wire_profile in host callbacks for flat and nested RPC payloads
- Match header casing in httpwire ordered_conn and allow non-HTTP handshakes
- Apply wire profile settings (HTTP/1.1 enforcement, auto compression disable, header ordering) in plugin host HTTP client
- Preserve proxy configuration, custom TLS dialers, redirect handling, and connection lifecycle
Closes: #5062
- Add `upsertAuthResult` to incrementally update only affected model shards after request completion.
- Cache supported model sets per auth using registry epoch tracking to avoid redundant lookups.
- Preserve full shard synchronization for auth lifecycle events and credential-scoped results.
Closes: #5061
- Reuse coresession.ExtractSessionInfo across HTTP headers and request payloads to unify canonical session prefix namespaces with the scheduler.
- Extract hierarchical session identities in two phases: initial extraction from request headers on entry, and authoritative deep extraction once request payloads and metadata are available.
- Support Claude Code multi-level subagents (X-Claude-Code-Agent-Id, metadata.agent_id) and Codex thread fork lineages.
- Propagate SessionID and ParentSessionID across ClientRequestMetadata, UsageReporter, and coreusage.Record without root_session_id.
- Include session_id and parent_session_id in queuedUsageDetail for Home LPushUsage forwarding and Redis consumption with self-loop guards.
- Add comprehensive test coverage for canonical headers, body extraction, ghost parent elimination, and self-referential loop guards.
- Mark Codex usage limit errors as credential-scoped across HTTP and WebSocket executors.
- Support both top-level and nested error structures with case-insensitive matching when parsing retry-after resets.
- Propagate prevalidated candidate context to session affinity and built-in selectors during auth selection.
Closes: #5529
- Detect advisor tool calls and advisor results in conversation history.
- Preserve forwarded system prompt blocks in top-level system instead of splicing them into message turns or prepending reminders.
- Prevent message index shifts that break layout bindings for encrypted advisor results and trigger upstream 400 errors.
Closes: #5470
- Track auth revisions and file observations to detect changes that occur while background auth scans are in flight.
- Invalidate and drop stale scanned auth records in `refreshAuthState` when concurrent file modifications or deletions are observed.
- Reject out-of-order delayed snapshot updates in `dispatchAuthUpdates` using watcher-local revision counters.
Closes: #5528
- Retain `supported_reasoning_levels` as an empty array instead of deleting the key when no reasoning levels are supported or compatible.
- Continue deleting `default_reasoning_level` when reasoning levels are empty.
- Add `gpt-6-astra` model specifications and capabilities to registry models.
- Update Codex client models configuration and instructions for `gpt-6-astra`.
- Bump default Codex client version and user-agent to `0.153.3` in model fetcher tool.