- Update Codex request translators for OpenAI, Claude, Gemini, Interactions, and OpenAI Responses to correctly extract and preserve `max_output_tokens` or equivalent token limit fields.
- Remove automatic deletion of `max_output_tokens` during request cleanup to ensure token limits are respected across execution paths.
Closes: #7230
- Add native-entrypoints to ClaudeHeaderDefaults to allow custom entrypoints to be treated as native Claude Code clients.
- Update Claude client detection, device profile scoping, and helper request matching to respect configured native entrypoints.
Closes: #7224
- Attach request-scoped web search result cache lookup before Responses to Claude request translation so cached search hits are restored before evaluating turn citations.
- Strip web_search_result_location citations from assistant text blocks whenever a web_search_tool_result in the same assistant turn ends up without content while preserving the response text.
Closes: #7213
- Rewrite embedded exec_command and write_stdin phrases across all Devin tool descriptions regardless of tool name or mixed occurrences so Codex code-mode exec tools are not rejected.
- Classify Devin MCP configuration and content-policy 403 permission_denied errors as request faults in clienterror.IsRequestFault so the conductor neither retries nor cools down credentials.
Closes: #7198
- Treat a rejected overage or 7d_oi response with an allowed 7d window and omitted 5h headers as model-scoped while keeping present malformed or exhausted 5h utilization credential-scoped.
- Add unit and executor regression tests verifying that Fable weekly rejections without 5h headers do not cool the credential or block sibling Opus requests.
Closes: #7197
- Replace tidwall/gjson and tidwall/sjson with github.com/MoeForge/moego/ojson
and encoding/base64 with github.com/MoeForge/moego/base64 across the main
module and examples
- Introduce cross-method *ojson.Doc request rewriting pipelines across
thinking, signature, client/codex, runtime/executor/helps, pluginhost, and
all provider executors with FinalizePayloadDoc as the final semantic barrier
- Convert all consecutive JSON mutations (>= 2 Set/SetRaw/Delete operations)
to batch edits on ojson.Doc
- Upgrade read-only byte paths to ojson.GetBytesNoCopy,
ojson.GetManyBytesNoCopy, and util.ParseGJSONBytesNoCopy with explicit
strings.Clone ownership protection across streaming and persistent state
- Use base64.StdEncoding.ValidateString for zero-allocation signature checks
and base64.EncodeDataURL for single-allocation data URL construction
- Preserve original developer message roles, content, and relative positions when converting OpenAI Responses input items to Chat Completions messages while keeping unsupported attachment refusal scoped to user turns.
- Add translator and openai-compat executor regression tests covering system, developer, user, assistant, and tool-call message ordering across streaming and non-streaming requests.
Closes: #7174
Ensure TransportCache.Get and detachMatching always release c.mu via defer
when a caller-supplied callback panics, preventing the cache mutex from being
permanently wedged after recovery. Also mark entries as retired in Purge() to
match evictLocked, CloseKey, and detachMatching.
Fixes#7162
- Fail forced refreshes when rejected refresh tokens remain unchanged without disk rotation and preserve rejected access token markers across no-op refreshes.
- Require a valid active access token when sign-in is required before restoring active routing status during refresh and lifecycle updates.
- Return the redacted credential entry view from the v8 management credential refresh endpoint.
Closes: #7135
- Resolve strict "<level>-fast" requests (parenthesis suffix or body thinking_level) to "<base>-<clamped-level>-fast" in ResolveDevinChatModelUID instead of silently falling back to the default effort.
- Treat a bare "fast" request as the default-effort fast variant so "(fast)" no longer resolves to the plain default UID; private aliases, special families, and the lightning tier keep their existing handling.
- Add regression coverage for the fast suffix and body-level forms plus pinning cases for private aliases and lightning models.
Closes: #7144
Subscription keys return HTTP 403 client_attestation_denied when the
request still looks like muse-build/1.3.0. Stamp the headers captured
from Muse Code 1.4.14-R7309.1: muse-build/1.4.14, X-Client-Id tbh:exec,
and a fresh session id set.
- Keep an empty connection-pool block as an opt-in. Synthesising it to nil
silently disabled pooling for `connection-pool: {}` and for keys inheriting
an empty group block.
- Fold the transport kind into the pool key and pool the Claude Code uTLS
transport per credential. Anthropic upstreams previously shared one
transport across keys and ignored the key's pool settings.
- Fence generations per publisher instead of process-wide. Building or
reloading one service no longer retires the pools another service is
still serving, which degraded it to one transport per request.
Give the generic proxy-aware clients a reusable transport per api-key
credential, driven by the `connection-pool` block added in the previous commit.
- Pools are keyed by credential scope (auth ID, then path/source, then a digest
of refresh/access/API-key material, then anonymous), normalized proxy target
(authenticated proxies fold a SHA-256 digest of user:pass into the key so each
proxy identity or sticky-session username keeps its own pool without storing
plaintext secrets in the cache key or logs), and the resolved settings. Two
keys therefore never share a TCP/TLS connection regardless of whether the
proxy is unauthenticated, authenticated, direct, or inherited.
- Capacity is a 512-entry LRU: one key keeps a warm pool, 100 keys keep one each,
and 100000 keys fall back to the historical one-transport-per-request behavior
when the cache is full. Each transport is bounded to MaxIdleConnsPerHost
instead of the cloned default of 100 idle sockets, so idle sockets stay at
capacity*max no matter how many keys exist.
- Dead peers are detected without request timeouts: 30s TCP keepalive on every
dialed connection (including SOCKS5, which used proxy.Direct before) plus the
idle timeout, 300s by default. Measured against ollama.com, an idle pooled
connection was still reusable after 600s; the 90s that used to bound this path
was net/http's own IdleConnTimeout, not an upstream limit.
- Explicit 0 or negative values disable keep-alives (including when proxy-url is
empty), invalid durations are parsed once per pool instead of warning per
request, and pooling works with or without an explicit proxy-url while keeping
priority for context-injected RoundTrippers when proxy-url is empty.
- Config snapshots carry a generation so a request holding an obsolete snapshot
cannot repopulate the cache after a reload. Generation 0 means the config never
passed the fence and stays poolable, so callers that build their own config are
not silently downgraded.
- Add supported thinking levels (`low`, `medium`, `high`) to the Antigravity `claude-opus-5-5-high` and `claude-sonnet-5-5-high` model definitions so hybrid capability validation preserves explicit `thinkingLevel` settings instead of converting them to `thinkingBudget`.
- Add regression tests covering `ApplyRequestThinking` and streaming/non-streaming Antigravity executor requests for both Claude 5.5 models.
Closes: #7133
- Add `client.claude.show-codex-commentary` config and propagate the request-scoped display policy through HTTP and WebSocket Codex executors.
- Mirror public Codex `commentary` messages into visible Claude text blocks alongside the `cpa:commentary:v1` thinking marker in streaming and non-streaming responses without altering genuine reasoning or token accounting.
- Deduplicate only the exact adjacent mirrored commentary text block during Claude-to-Codex request replay when enabled.
Closes: #7129
- Mark locally synthesized missing-[DONE] stream errors as stream-truncated in OpenAICompatExecutor so auth cooldown and cross-credential replay are skipped while preserving the 502 error.
- Add regression tests verifying that incomplete HTTP 200 OpenAI-compatible streams do not cool down credentials or exhaust the pool into auth_unavailable.
Closes: #5283
Keep the error-only upstream request capture policy on the connection
context, before model routing and upstream execution begin. Check it before
accessing pooled Gin state so delayed plugin callbacks retain the policy
even after cancellation or Gin context reuse.
Preserve ordinary HTTP error capture, failed upgrade handling, and full
request logging. Cover large repeated requests, late callbacks, real
WebSocket logging, and Codex duplex routing with regression tests.
Related: #6960
- Update the Gemini OpenAI Responses tool search call item ID prefix from ts_ to tsc_ so replayed search items pass Codex upstream validation after switching models.
- Normalize legacy ts_ and unprefixed tool_search_call item IDs in SanitizeCodexInputItemIDs on outbound Codex requests while preserving call_id and avoiding ID collisions.
Closes: #7084
Existing request interceptors wrap the full request body in a JSON RPC envelope with Base64 encoding and skip subsequent duplex WebSocket business frames, causing ~3.33x memory and CPU amplification when rewriting small fields such as Codex `<timezone>` and `<current_date>` in large contexts.
- Add schema v8 raw request body patch methods (`request.patch_body_before` and `request.patch_body_after`) and capabilities (`request_interceptor_patch_body_before/after`, `request_body_patcher_before/after`) that pass raw `Body []byte` directly across the C ABI without JSON/Base64 request wrapping
- Add `RequestBodyEdit`, `RequestBodyPatchResponse`, and `RequestBodyPatcher` in `sdk/pluginapi` with single-pass host splicing, bounds/overlap validation, `json.Valid` verification, no-op original body reuse, and sequential multi-plugin chaining
- Eliminate redundant full-body slice clones in handler/conductor request interceptor application paths
- Run before-auth and after-auth request interceptors on subsequent duplex WebSocket `response.create`, `response.append`, and `response.steer` messages
Closes: #7072
- Track the running response identity in the Codex websocket session and reject interrupts that do not target it, so an interrupt after response.completed is never forwarded upstream while turn teardown is pending.
- Gate the handler's local interrupt path by explicit turn ownership and close it before terminal payloads are written downstream, preventing fabricated response.incomplete events and silently dropped claimed frames.
- Add deterministic regression tests covering late and unknown interrupts across completion, failure, queued rejection, upstream loss, and HTTP fallback turns.
Closes: #7065
When an upstream Codex WebSocket returns an early 429 usage_limit_reached (via an error or response.failed frame) before any downstream payload chunk is emitted, notifying UpstreamDisconnectChan caused the Responses WebSocket handler to close the client connection and cancel the request context before the conductor could fail over to another eligible credential.
Suppress downstream disconnect notification on pre-output upstream WebSocket errors and treat bootstrap usage-limit terminal failures as failover-eligible while bootstrap buffering is active, allowing the conductor to retry another credential on the same downstream WebSocket connection.
Fixes#7051
- Build un-defaulted original request payloads for xAI image generation and edit handlers and propagate them via execution context so payload default rules can distinguish omitted client fields from built-in defaults.
- Pass normalized original requests into the xAI image executor payload finalizer and report finalized response_format values back to handlers via metadata callbacks across streaming and non-streaming responses.
- Add unit and handler regression tests covering payload default, default-raw, and override rules for xAI image endpoints.
Closes: #7048
- Attach content-free log diagnostics to Devin apply_patch 502 rejections with fixed reason categories, argument byte counts, prefix shapes, and parse error classes.
- Buffer and recover complete, well-framed bare Codex patches from Devin invalid_json_str arguments via applypatch.WrapInput after a clean EOS trailer in streaming and non-streaming execution.
- Keep truncated streams, trailer errors, mixed argument sources, and malformed patches fail-closed without exposing patch content.
Closes: #7046
Keep the client's /v1/responses websocket open when an upstream Codex websocket drops during or between turns, report correlated non-closing error frames without replaying in-flight turns, fence pre-loss queued input across handler and executor boundaries, and preserve pinned credential affinity across Home turn releases.
Closes: #7028
- Strip SSE data prefixes and ignore control lines before initializing stream state.
- Cover translated content, usage, and completion across vertex authentication paths.
Closes: #7025
Without a protobuf wrapper, the ciphertext after the Tink prefix byte is
indistinguishable from uniform random bytes. Matching only the 0x01
prefix byte claimed about 1/256 of unenveloped payloads as Gemini: xAI
encrypted_content starting with 0x01 was then rejected by the Grok
validator and dropped from replay, and Kimi signatures were misclassified.
- require the observed Vertex key id (8f3d6b5f) in addition to the
prefix byte; a rotated key falls back to the bypass sentinel, which is
the behavior before bare-Tink recognition
- expose IsGeminiVertexBareTinkSignature and scope the Gemini
Interactions sanitizer: the public endpoint drops bare-Tink thought
steps, the Vertex Interactions endpoint keeps them
- restore the xAI seed and Kimi ordering tests that had been adjusted
around the false positive, and add regressions for a 0x01-leading Grok
payload and an unknown key id
- Classify Codex turn-rate and model-capacity 429s as transient per-model rate limits via a new executor contract, honour upstream Retry-After headers behind quota resets, and cool only the reporting model without quota labelling or exponential backoff.
- Carry the trusted retry deadline to terminal clients and retry scheduling across direct, streaming, bootstrap, and Home paths, keeping Home aggregated deadlines authoritative over per-attempt hints.
Closes: #7017