- Extract Home credential_options.cloak and slice-valued cloak_sensitive_words under claudeDevicePoolMu without JSON round-tripping.
- Preserve shared DisableClaudeCloakMode defaults when cloak.mode is omitted and avoid splitting comma-containing sensitive-words.
- Report Claude cloak block additions, removals, and sensitive-words content updates in config change details.
Co-authored-by: lzt404 <2596933790@qq.com>
- Preserve explicit non-empty string prompt_cache_retention values from client payloads across Meta request translation while leaving omitted, null, blank, and non-string values unset without injecting 24h by default.
- Synchronize prompt_cache_retention onto the translated original request document so payload default, override, and filter rules remain the final semantic barrier.
- Document the meta protocol option and opt-in prompt_cache_retention default rule in config.example.yaml and add regression tests.
Closes: #7424
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
- Capture bounded per-attempt upstream status, masked headers, response chunks, and transport or stream errors when request-log is false.
- Bind synchronized deferred capture to the HTTP request context and preserve partial HTTP bodies and WebSocket dial or reconnect failures.
- Mask Cookie headers alongside Set-Cookie so forced error logs do not expose session credentials.
Closes: #7420
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
- Surface upstream SSE error, response.failed, and raw JSON failure payloads through xaiStatusErr with mapped HTTP status codes instead of 408 request_timeout.
- Return request-scoped 502 errors for empty and unclosed 2xx streams without triggering transient credential cooldown.
- Avoid misclassifying empty or unclosed non-stream responses as apply_patch argument errors when no custom apply_patch activity occurred.
Closes: #7419
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
- Accept both cli and cli-bg in the native X-App header check so Claude Code background sessions preserve their native request identity instead of receiving the pinned device profile rewrite.
- Add unit and executor regression tests verifying native detection and passthrough for X-App: cli-bg across messages, streaming, count_tokens, and measured helper requests.
Closes: #7412
Co-authored-by: Dylan <1990016@gmail.com>
Co-authored-by: lzt404 <2596933790@qq.com>
Clear top-level text format constraints and filter configuration_update control items when preparing local compaction summary payloads so structured JSON schemas do not overwrite the summary output.
- Detect input_schema property keys outside Claude's ^[a-zA-Z0-9_.-]{1,64}$ pattern by walking JSON Schema subschema positions in tools[] and inline tool_addition definitions.
- Replace affected schemas with an open object and embed the original schema in the tool description before payload rules, so parameters keep their exact names without request or response rewriting.
- Apply the fallback on execute, stream and count_tokens paths with regression tests for Responses and native Claude sources, MCP aliasing and payload-rule ordering.
Closes: #7389
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>
- 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>
- 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>
- 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.
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.
- 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
- 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
- Emit mid-session text-only system and developer message items as role=system turns immediately after the next user message while preserving source order for top-level fallbacks.
- Pin system item placement in the Claude executor before translation so legacy models, strict or uncloaked wire policies, mid-system rebuilds, and local token counts retain the top-level path.
- Centralize the legacy system-reminder model allowlist in internal/util for shared lookup across the translator and executor.
Closes: #7310
- Raise positive integer max_output_tokens below 16 to the Codex minimum on the translated payload across HTTP and WebSocket paths, before user payload rules.
- Send inference verification with a 16-token budget so healthy Codex OAuth credentials are no longer rejected by the upstream minimum.
- Add regression coverage for VerifyInference and small budgets from every Codex source format.
Closes: #7304
- Preserve refresh failure stages and prevent immediate or later grant replay.
- Coordinate durable claims and recovery receipts across file, PostgreSQL, Git, and S3 stores.
- Add regression coverage for retries, concurrency, persistence, and recovery.
Closes: #7289
- Detect compaction_trigger in DevinExecutor Execute/ExecuteStream, generate the summary through the same Devin model, and synthesize a sealed single-item compaction response and SSE stream via the shared helpers.
- Expand replayed CPA compaction capsules into summary context before translation and drop foreign compaction items, so repeated compaction keeps prior context.
- Add a native Devin regression test covering streaming/non-streaming triggers, summary history and tool preservation, payload-rule final barrier, capsule replay, repeated compaction, and OriginalRequest-only triggers.
Closes: #7291
- Raise small Claude output budgets to the Codex minimum before payload rules.
- Cover model selection and budget boundaries across HTTP and WebSocket paths.
Closes: #7282
- Place Gemini tool results in user messages while preserving call pairing.
- Omit incompatible thought signatures and normalize native Base64 for Go clients.
Closes: #7279
- Remove the unconditional X-Tbh-Contributor-Mode header from applyMetaClientIdentity so standard Meta model requests do not send the training opt-in signal.
- Resolve the effective upstream model after payload rules and set X-Tbh-Contributor-Mode: 1 only when the target model ends with -contributor.
- Add regression tests covering standard and -contributor models across Execute, ExecuteStream, and payload model overrides.
Closes: #7272
- Skip auto-injecting hosted image_generation tools on Responses-Lite models and strip unsupported complexity fields from declared image_generation tools on ChatGPT Codex /responses requests.
- Route forced hosted image_generation turns on Responses-Lite models to the compatible GPT-Image-2 base model (default gpt-5.4-mini) with normalized reasoning configuration.
- Map upstream image_generation_user_error terminal events to HTTP 400 Bad Request with actionable remediation guidance for unsupported complexity errors.
Closes: #7270
- Add `IsClaudeSessionDatePinKVActive` and integrate persistent KV store backing for Claude session date pins.
- Ignore `session-date-pin-days` and store pins permanently when local bbolt or Home KV is active.
- Support concurrent CAS-based repair and transient outage recovery for pinned session dates.
Closes: #6799