Track output item IDs and resolve item_reference inputs to their
owning credential, including for local OAuth model aliases, so
stored Responses continuations stay pinned to the issuing account.
Treat credential-status failures from Copilot route planning as
credential-scoped upstream attempts and route them through the
normal failure pipeline in sync, count, streaming, and Home
execution, enabling cooldown and failover instead of aborting.
Snapshot and restore account catalogs and Fusion entitlements for
Home dispatch, bound to the credential, trusted origin, model, and
expiry. Concrete models carry only endpoint and reasoning defaults,
while entitled Fusion tiers carry the ordered directory and aliases.
Resolve Home routes from the restored catalog, expose the required
SDK API, and pin Fusion continuations via published aliases and the
Home caller scope. Replay completed draft tool exchanges to later
phases, suppress repeated draft actions, and report usage for every
Fusion phase, including failures, with additional-phase attribution.
Cache the translated reply for each tool-result submission so
retries replay identical non-streaming and streaming responses
without re-running upstream inference, while failed attempts
release the key and evicted replies return a conflict.
Track delivered tool call IDs across all phases of a turn and
reject upstream repeats of answered calls. Capture draft-only
reasoning, prose, signatures, and encrypted Responses state
before exposing its tool batch, then restore that private
history for Chat, Responses, and Messages continuations
without leaking it to clients or reviewers.
Drop hardcoded temperature/top_p from fusion review requests
that reasoning models may reject, and normalize line endings
in embedded CLI prompts.
Publish fusion-standard, fusion-high, and fusion-max based on the
Fusion tiers enabled by /meta, instead of the single Auto model.
Route balance through /auto and higher tiers through /model/fusion
with validated solo, cascade, and critique plans, catalog-bounded
fallbacks, and per-phase reasoning efforts. Execute draft, review,
repair, and revision phases without leaking speculative output,
reviewer content, or session tokens to clients.
Pin tool and response continuations to the originating credential,
prevent reissuing answered tool calls, apply payload rules as the
final barrier on routing and inference payloads, and update the CLI
identity and headers to 1.0.117.
BREAKING CHANGE: copilot/auto is no longer published; use
copilot/fusion-standard, copilot/fusion-high, or
copilot/fusion-max instead
Add the virtual copilot/auto model for accounts whose /meta
default tier is enabled, resolved from account plan and
published only while the entitlement remains valid.
Select concrete models via /auto with scoring and RL
multi-turn policies, bounded prompt history, token refresh,
duplicate handling, and expiry checks before inference.
Rebuild portable history across Chat, Responses, Messages,
and Gemini route switches, including stored response and
item continuations and Gemini tool-call ID normalization.
Keep Auto state scoped by account, caller, and explicit
session, and redact session and RL state tokens from logs.
Avoid full-payload copies when evaluating payload rules and reading HTTP
request bodies, cutting heap allocation amplification on multi-megabyte
base64 requests by >80% with zero behavioral changes:
- Evaluate single-item payload query predicates directly on ojson.Result
without copying item.Raw into a temporary "[...]" buffer (with exact
fallback for edge/malformed syntax).
- Resolve clean array "@reverse.<N>" paths via zero-copy ForEach traversal
instead of ojson.modReverse full-array cloning.
- Fast-path scalar, empty-container ([] / {}), and type-mismatch checks in
payloadResultEquals to skip moego/json.Unmarshal on large arrays, and use
bytes.TrimSpace in normalizedPayloadJSON.
- Cache compiled moego/regexp patterns in payload.replace with a bounded map.
- Release originalRequest in ClaudeInputTokenState once disabled or handled,
and only retain replayRequestPayload in Antigravity stream when replayScope
is valid.
- Preallocate raw request body buffers from Content-Length (capped at 4 MiB)
in ReadRawRequestBody to avoid io.ReadAll slice-doubling copies.
Populate functionCall.id and functionResponse.id when translating OpenAI Chat Completions requests to Gemini so parallel calls to the same function retain 1-to-1 correlation, matching the Claude and OpenAI Responses translators.
Extend StripVertexOpenAIResponsesToolCallIDsDoc to also strip tool call IDs for the openai source format on Vertex AI where REST schemas do not define an id field.
- Exclude the msg prefix from same-prefix hierarchy parent matching in auth session aliasing and usage reporting so Turn 2 message-hash pairs are no longer misclassified as subagents.
- Preserve existing hierarchy parent detection for explicit non-msg session prefixes and agent markers.
- Add regression tests covering SubagentAffinity=false retention, alias binding, rebind-on-never refusal, result cleanup, Home session aliasing, and usage hierarchy filtering.
Closes: #8191
- Canonicalize and merge snake_case tool_config and function_calling_config fields into camelCase toolConfig before setting VALIDATED mode on Claude requests, preserving non-conflicting fields without emitting duplicate proto-JSON keys.
- Recognize, cap, and strip all four generationConfig/generation_config maxOutputTokens/max_output_tokens paths across buildRequestForModelDoc and CapAntigravityMaxOutputTokensDoc while merging mixed generation config containers.
- Add regression tests covering Claude tool_config canonicalization, non-Claude max_output_tokens stripping, and snake_case generation_config output capping.
Closes: #8183
- Strip thinkingConfig and thinking_config in CapAntigravityMaxOutputTokensDoc when clamping a numeric Claude thinking budget would fall below 1024 while leaving non-numeric, dynamic, and level-based configs untouched.
- Recognize numeric snake_case max_output_tokens aliases capped by model MaxCompletionTokens in effectiveMaxTokensDoc and apply the same catalog output cap in buildRequestForModelDoc.
- Add unit tests covering sub-1024 Claude budget stripping, snake_case max_output_tokens handling, and catalog-limit clamping.
Closes: #8165
- Derive a hashed grantScope fallback in ApplyAntigravityAgentEnvelope when antigravity_model_enum_scope is empty and RegistrationEpoch is zero, using account-level identifiers before falling back to ephemeral tokens while keeping local registration epochs unchanged.
- Add regression tests covering distinct Home accounts, sanitized Home dispatches, shared-project token fallback, same-account access token rotation, and preserved local Manager.Update sessions.
Closes: #8167
- Extract sanitizeGeminiInteractionsItemDoc on *ojson.Doc and apply it to both top-level input steps and nested input[].content[] parts, compacting dropped nested thoughts and preserving nested function_call IDs.
- Promote non-blank call_id verbatim to id when function_call.id is missing, empty, or whitespace-only before stripping call_id, and skip content traversal on kept top-level thought steps.
- Add regression tests covering nested function_call/thought sanitization, Vertex bare-Tink scoping, verbatim call_id promotion, and combined top-level/nested thought compaction.
Closes: #8153
- Treat leading "assistant" turns equivalently to "model" turns in EnsureGeminiLeadingUserContentDoc.
- Recognize snake_case function_call, function_response, and function_response.parts media in Gemini turn boundary helpers.
- Add regression unit tests covering leading assistant turns, snake_case tool responses with and without nested media, and trailing thought-bearing tool parts.
Closes: #8155
- 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
- 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
- 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
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.
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.
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.
- Generate random and deterministic session IDs as signed 64-bit decimal values, using FNV-1a for stable IDs.
- Preserve negative signs in reasoning replay keys and test positive/negative ID coverage.
Closes: #7857
- Format request.generationConfig.thinkingConfig.thinkingLevel using uppercase trimmed enum names in the Antigravity thinking applier to match official protojson wire output.
- Add unit and executor regression tests covering uppercase thinkingLevel serialization, fallback levels, idempotency, and payload override precedence, and update existing Antigravity test expectations.
Closes: #7850
- Expand the Responses-to-Codex translator include allowlist to preserve Codex-verified entries (`web_search_call.action.sources`, `web_search_call.results`, and `output.encrypted_content`) alongside required `reasoning.encrypted_content` while keeping the zero-copy fast path.
- Restore all official OpenAI Responses `include` values in Codex HTTP and WebSocket executors before user payload finalization when targeting non-ChatGPT OpenAI Responses upstreams (SIWC or custom `codex-api-key` endpoints).
- Strip newly allowed Codex-only include entries in xAI and Meta executors before payload finalization to keep shared-translator non-OpenAI behavior unchanged, and add unit and executor regression tests.
Closes: #7833
- Prefer credential-scoped derived session IDs over raw incoming request.sessionId values when auth.ID is set, and deterministically scope direct incoming session IDs via ScopeAntigravitySessionIDForAuth across standard, image, and web_search requests without synthesizing sessionId when absent.
- Preserve verbatim incoming request.sessionId when auth.ID is empty while keeping reasoning replay keying and final payload barrier rules unchanged.
- Add regression tests covering Gemini, native Antigravity, image, web_search, unenriched direct calls, subagent isolation, anonymous auth preservation, and payload override/filter barriers.
Closes: #7838
- 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
- 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
- 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
- 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 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.
- 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.
- 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
- 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