- Start a connection-scoped downstream Ping keepalive loop immediately after upgrading the Responses WebSocket connection instead of waiting for stream forwarding to begin.
- Guard background Ping writes with non-blocking mutex acquisition so active data writes are not contended while blocked Ping writes are still interrupted on terminal close.
- Preserve the socket cancellation cause in response forwarding and add regression coverage for post-upgrade, upstream-bootstrap, and blocked-Ping close paths.
Closes: #7407
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
- Add a single-space reasoning_content placeholder on assistant tool-call turns without replayable thinking text when is-compat and request reasoning are active.
- Reconcile tool-call placeholder reasoning after canonical thinking resolution so model suffixes and capability normalization govern final inclusion before payload rules.
- Add unit and executor regression tests covering absent/whitespace thinking, disabled thinking, suffix overrides, and final payload overrides/filters.
Closes: #7398
Co-authored-by: Dylan <1990016@gmail.com>
Preserve an absolute heartbeat deadline across config,
cluster, and telemetry messages so ordinary subscription
traffic cannot mask a stalled heartbeat. Only an
empty-payload PONG renews liveness and resets reconnect
failures, and messages arriving after the deadline are
treated as timeouts
- Treat thinking.display="updates" as an enabled reasoning summary mode when extracting Claude summary configuration so translated requests emit target visibility controls such as Antigravity includeThoughts.
- Preserve an existing "updates" display mode when applying enabled summary configuration back onto Claude request documents instead of overwriting it with "summarized".
- Add unit and cross-protocol translation regression tests for Claude thinking.display="updates".
Closes: #7393
Co-authored-by: Dylan <1990016@gmail.com>
- Document in config.example.yaml and RoutingConfig.SessionAffinity that Merkle LCP compaction matching requires at least 2 shared trailing turns.
- Note that clients whose compaction replaces all earlier turns with a summary should send X-Session-ID or another explicit session ID to preserve credential affinity.
Closes: #7390
Co-authored-by: Dylan <1990016@gmail.com>
- Include claude-fable-5-2 in preserved-thinking block binding so replayed signed thinking blocks default to drop_block on prefix mismatch.
- Consolidate 2.1.321 per-turn effort and timing model capability checks to cover Fable 5.2, Sonnet 5.5, and Mythos 5.2 while keeping Haiku 5.5 excluded from timing.
- Update the baseline software profile test failure message to match 0.128.0/v26.12.1 and add regression tests for 2.1.321 timing and preserved thinking.
Closes: #7386
Co-authored-by: Dylan <1990016@gmail.com>
Anthropic now rejects claude-fable-5-2 from Claude Code versions older than
2.1.290, so every cloaked (non-Claude-Code) request for the model failed with
400 "Claude Code 2.1.280 does not support this model".
Update the emulated CLI baseline to the measured 2.1.321 release:
- User-Agent claude-cli/2.1.321, Stainless package 0.128.0, runtime v26.12.1,
billing cc_version and default fallback version.
- Rebuild Anthropic-Beta assembly from native 2.1.321 captures:
thinking-token-count moves after advisor-tool, effort precedes
dangerous-tool-use, message-threads is added when the body carries a thread
object, mid-conversation-system is only sent when requested, and the quota
probe omits the claude-code beta.
- Recognize Fable 5.2 and Haiku 5.5 for progress display, per-turn control and
effort handling, matching the observed client.
- Add a regression test that reproduces each captured 2.1.321 beta header and
the billing fingerprint.
Fixes#7386
- gate automatic image_generation tool injection for use_responses_lite catalog models on actual Responses-Lite routing (including credential and model header overrides) or presence of reasoning effort
- retract untouched auto-injected image_generation tools during single-pass payload finalization when user payload rules configure reasoning effort or switch to an incompatible route
- update Codex executor and payload barrier regression tests across HTTP and WebSocket streaming and non-streaming paths
Closes: #7384
Co-authored-by: Dylan <1990016@gmail.com>
- Register Claude Fable 5.2 in the Anthropic collection with thinking levels, image input support, and updated pricing description.
- Register Gemini Omni 1.2 Flash across Google, Vertex, and Gemini CLI collections with thinking token ranges and multimodal input/output support.
- Synchronize Watcher.authDir and rebind the fsnotify directory watch when SetConfig or reloadConfig updates the authentication directory.
- Read the active auth directory across snapshots, full rescans, and incremental file events while discarding stale pre-switch directory events.
- Add regression tests covering runtime auth-dir reloads, shared credential filenames, concurrent SetConfig updates, and stale event isolation.
Closes: #7160
Co-authored-by: Dylan <1990016@gmail.com>
- Exclude unrouted 404 responses without upstream activity or API error evidence from per-request and forced error log dumps so high-frequency probes cannot evict diagnostic dumps from the error-logs-max-files ring.
- Avoid initializing or retaining streaming log writers and temporary part files when Gin matches no route for a 404 response while preserving routed 404 and panic error dumps.
Closes: #7363
Co-authored-by: Dylan <1990016@gmail.com>
- Hijack mock CONNECT proxy connections before writing 200 OK and forward buffered client bytes so TLS ClientHello records are not truncated under CPU contention, while isolating Codex refresh test journals.
- Wait for client request payloads and test completion before closing mock websocket connections in Codex keepalive upload tests.
- Cancel the in-flight HTTP upstream context before writing response.incomplete downstream during local websocket interrupts.
Closes: #7379
Co-authored-by: Dylan <1990016@gmail.com>
- Move top-level automatic prompt caching markers onto the last cacheable block and remove the top-level field during ensureCacheControl so cloaked requests avoid TTL mismatches and duplicate breakpoints.
- Extend the Claude cache_control stream scanner and helper routines to account for top-level cache_control when counting, enforcing the 4-block limit, and normalizing or upgrading TTLs.
Closes: #7366
Co-authored-by: Dylan <1990016@gmail.com>
Add attempt-scoped HomeSelection metadata carrying the reused and
additional flags, scheduling route model, and credential policy
through usage records to the Redis queue. Mark retained executions
and Codex duplex successors as reused so Home can compensate later
turns after completion without redispatching or reacquiring a
concurrency slot.
Mark split additional-model records as additional so they never add
scheduling charges, while preserving independent per-response
execution IDs for deduplication. Document the deferred accounting
and add coverage across conductor, duplex, reporter, and queue.
Extend weighted pinned accounting beyond session affinity so pinned
and ordinary requests share the same credits even when affinity is
disabled. Route scheduler, legacy, mixed, and bare selector picks
through the shared weighted pool, exclude zero-weight credentials
before priority selection, and preserve single-provider transport
preference for mixed requests.
Devin reports the prompt in three disjoint parts: uncached (field 2), cache
write (field 4) and cache read (field 5). The executor summed only uncached +
cache read, so a cache miss on the GPT route (almost all cache write)
reported ~3 input tokens for a full prompt, and the Claude route lost the
written part on every first request. CPA's own token accounting expects the
total to include writes and marked those responses inconsistent; the
Claude-format translator already subtracts read + write from the total.
Live: GPT-6.1 Sol miss was 3 uncached + 6103 written, reported as 3 input;
the next request read 6103 of 6106. Updates the #5910 regression test.
Route the CLI OAuth flow through a chosen proxy and persist it as the
new credential's proxy_url, matching the management API's session
proxy behavior.
Replace string pool keys and map-based credit state with SHA-256
digest keys and sorted slice members holding weight, current, and
pending credits in a single allocation. Reservations now retain
only the member index instead of a weights map and auth ID.
Verify full pool identity on digest hits and chain collisions so
unrelated candidate pools never share credits or weights. Update
tests to access pool credits through test helpers.
Charge session-affinity hits, parent inheritance, LCP matches,
and pinned requests against the eligible weighted pool without
moving existing bindings, so new sessions favor under-served
credentials and request ratios stay approximately weighted.
Scope settled credits per eligible credential set, capped at
+/-32 pool rounds, with in-flight reservations that commit on
local selection success and release on failure.
Map IsFork metadata to X-Node-Kind: fork when dispatching to
Home so forked sessions keep their lineage kind alongside
explicit kinds such as compaction. Clone dispatch headers
before adding the Home-only header to avoid mutating caller
headers, and cover fork, compaction, and ordinary children
with session hierarchy tests.
- Normalize model state, scheduler shard, and cooldown lookups case-insensitively while preserving stored model key casing.
- Atomically migrate route-alias cooldowns to the resolved upstream model key when OAuth model aliases or credentials are updated.
- Add regression tests covering mixed-case alias targets, pre-existing alias cooldown migration, and concurrent persistence windows.
Closes: #7360
- Add optional credential_scoped metadata and documented routing/cooldown error code constants to pluginabi.Error so plugin executors can report account-wide 429 limits.
- Preserve credential-scoped classification on rpcError across synchronous RPC envelopes and streaming error callbacks while prioritizing credential quota scope over model-only or cooldown-skipping error codes.
- Recognize credential_quota error codes in core auth cooldown classification and cover whole-credential cooldown propagation and error events with regression tests.
Closes: #7359
- Revert post-message_stop response body draining and detachable request context from Claude streaming execution so completed streams close immediately instead of returning connections to the idle pool.
- Set MaxIdleConnsPerHost to -1 on the default Claude Code uTLS transport to disable idle connection reuse for OAuth and unpooled credentials while preserving the Connection: keep-alive wire header and explicit connection-pool opt-in.
- Add regression tests verifying short-lived default Claude Code connections, explicit per-key pool reuse, and non-reused streaming connections.
Closes: #7357
- Add the "never" option for routing.session-affinity-rebind-on to preserve established session bindings across all credential failures and refuse cross-credential failover across primary, fallback-key, and Merkle LCP paths.
- Scope retry rounds and Antigravity credits fallback to the bound credential under "never" mode, returning 503 session_auth_retry on transient unavailability and 429 or upstream errors on quota/auth blocks.
- Add unit and end-to-end regression tests covering selector refusal, retry rounds, empty candidate sets, Antigravity credits fallback, and runtime config reload.
Closes: #7348
- Accept refresh=true or refresh=1 on the plugin store listing endpoint to bypass the 1-hour latest-release cache TTL for installed plugins.
- Track last check timestamps on release cache entries with a 10-second per-key refresh floor while preserving GitHub rate-limit cooldowns and in-flight coalescing.
- Add unit tests and update v8 management API documentation for the refresh query parameter.
Closes: #7333
- Track SSE event newline boundaries across streamed image chunks and suppress keep-alive comments while inside an incomplete SSE event.
- Reset streaming keep-alive tickers when downstream bytes are written and ensure terminal error events start on a clean SSE boundary.
Closes: #7330
- Map explicit output_config.effort to reasoning_effort in ConvertClaudeRequestToOpenAI when the thinking object is omitted.
- Preserve existing budget_tokens, disabled thinking, model suffix, and final payload rule precedence across translation and thinking stages.
- Add regression tests for standalone effort translation, chained thinking normalization, and finalized OpenAICompatExecutor payloads.
Closes: #7327
- Add NewDetachableContext in executor helpers so upstream requests follow downstream cancellation until message_stop and detach afterward before the handler cancels the request context.
- Close the output stream channel first and then drain up to 64 KiB of the remaining raw upstream response body to EOF so net/http returns completed streaming connections to the idle pool.
- Treat valid message_stop data lines in the translated streaming path as completion before translation so terminal-event cancellation does not abort connection pooling.
Closes: #7326
- Ignore whitespace-only reasoning deltas and non-streaming reasoning entries when no thinking block is currently active so Anthropic-incompatible blank thinking blocks are never emitted.
- Allow whitespace reasoning segments to extend already-open streaming thinking blocks, tool-call-buffered thinking chunks, and non-streaming thinking builders.
- Add streaming and non-streaming regression tests covering whitespace-only and intra-thought whitespace reasoning.
Closes: #7325