Commit Graph

1174 Commits

Author SHA1 Message Date
Luis Pater
57bde35179 fix(executor): preserve upstream usage on apply patch failures
- Buffer and publish observed upstream usage when apply patch transformation or translation encounters an error in Meta and xAI executors
- Add stream usage buffer helpers to report failure metrics with captured upstream token usage

Closes: #6427
2026-10-07 09:31:03 +08:00
Luis Pater
39632e52a6 fix(claude): keep system prompt at top level for leading user message runs
- Update cloaking check to retain caller system instructions at the top level when a conversation begins with multiple consecutive user messages followed by assistant turns

Closes: #6426
2026-10-07 08:57:39 +08:00
Luis Pater
eca1d11385 fix(claude): keep system prompt at top level for single terminal user turn
- Update terminal user run check in Claude cloaking logic so conversations ending with a single user turn keep caller system instructions at the top level instead of relocating them into mid-conversation messages

Closes: #6423
2026-10-07 08:40:41 +08:00
Luis Pater
dbc4aad9e9 fix(gemini): ignore context cancellation after terminal chunk in Vertex stream
- Detect terminal stream chunks and avoid recording client cancellations as execution failures once completion events have been delivered

Closes: #6421
2026-10-07 08:16:52 +08:00
Luis Pater
a2976eb8a3 fix(claude): share OAuth tool alias store across scoped executor copies
- Pre-allocate `oauthToolAliases` in Claude and Kimi executor constructors so request copies created via `ForAPIKey` reuse the same store
- Replace struct-level mutex with package-level mutex for lazy store allocation to prevent copying mutexes by value

Closes: #6401
2026-10-06 05:45:17 +08:00
Luis Pater
d2597a24e4 fix(openai): preserve unknown encrypted content in responses compat mode
- Retain unknown-format `encrypted_content` during reasoning signature sanitization when compatibility mode is enabled
- Continue stripping empty signatures and known foreign provider signatures in compat mode

Closes: #6399
2026-10-06 05:07:50 +08:00
Luis Pater
c7b4d573f9 fix(codex): record reasoning effort after applying payload overrides
- Record reasoning effort from finalized upstream payload after cache helper processing across execution, streaming, compaction, and image requests

Closes: #6388
2026-10-05 17:08:02 +08:00
Luis Pater
0ea4e1dcb4 fix(openai): complete responses stream on clean EOF after finish reason
- Track pending completion state in OpenAI-to-Responses translator when item output is complete and a finish reason is received
- Synthesize terminal `[DONE]` event on clean EOF when response completion is pending instead of failing the stream

Closes: #6381
2026-10-05 15:55:38 +08:00
Luis Pater
3e83083b92 Merge pull request #6386 from router-for-me/logs
Unify model reporting and enhance logging for context hash rejections
2026-10-05 14:34:00 +08:00
Luis Pater
eb6a768d10 feat(claude): support explicit prompt cache options
- Honor `prompt_cache_options.mode = "explicit"` to suppress automatic `cache_control` insertion while preserving client-defined cache breakpoints
- Strip `prompt_cache_options` from request payloads before forwarding upstream and during token counting

Closes: #6380
2026-10-05 14:16:37 +08:00
hkfires
40f4df07b7 feat(antigravity): enhance context hash rejection logging and batch retry logic 2026-10-05 13:24:20 +08:00
hkfires
17dc1b81c2 feat(antigravity): enhance context hash rejection logging and introduce replay phases 2026-10-05 11:41:11 +08:00
hkfires
611ebba415 refactor(executor): unify model reporting and replay logs
Replace Codex-specific response model APIs with shared model observation and remove redundant substitution warning throttling. Consolidate repeated Antigravity context-hash rejection messages into a single request-level log while preserving rejection details across index rebuilds.
2026-10-05 11:10:54 +08:00
Luis Pater
a4acc9f752 fix(antigravity): treat client disconnect after terminal stream chunk as success
- Track terminal chunks including finish reasons, stop messages, and completion events during streaming
- Commit replay settlements and publish observed usage instead of reporting stream failure when the client disconnects after a terminal chunk

Closes: #6376
2026-10-05 06:25:53 +08:00
Luis Pater
4e4dede481 fix(antigravity): surface backend errors and support multi-line stream payloads
- Buffer and assemble multi-line or split JSON chunks until a valid JSON payload is formed
- Intercept upstream backend error objects during streaming and surface them as terminal errors with appropriate status codes

Closes: #6357
2026-10-05 04:32:35 +08:00
Luis Pater
d31b61cb87 fix(websockets): propagate upstream disconnect errors during session activation
- Track terminal connection errors on websocket session when upstream read loops fail or receive unexpected binary payloads
- Return recorded terminal errors immediately during session activation to prevent callers from blocking indefinitely after upstream disconnects
- Reset terminal error state when configuring new connections

Closes: #6354
2026-10-05 04:05:41 +08:00
Luis Pater
678a92578c feat(claude): preserve OAuth tool aliases across thread continuations
- Add bounded in-memory store to retain Claude OAuth tool alias mappings keyed by message ID
- Restore alias mappings for thread continuation requests omitting tool declarations, returning a request-scoped not found error when state is missing
- Record tool aliases on execution and streaming response completion

Closes: #6346
2026-10-04 23:18:38 +08:00
Luis Pater
26e5efbbdf fix(claude): reserve cache breakpoint for thread continuation
- Decrement `maxBlocks` when a `thread` field is present in payload to reserve a cache breakpoint for Anthropic thread continuation

Closes: #6338
2026-10-04 21:00:20 +08:00
Luis Pater
5d890405b5 fix(claude): keep system messages top level for terminal user turns
- Add `claudeMidConversationSystemMessagesAtEnd` to detect consecutive user messages ending the message array
- Append forwarded system blocks to top-level `system` payload instead of inserting mid-conversation message turns when trailing user turns are present

Closes: #6336
2026-10-04 20:32:07 +08:00
Luis Pater
c997cbb58a feat(httpwire): introduce error-aware response flushing helper
- Add `FlushResponse` to prefer error-aware flushing and unwrap wrapped response writers
- Bypass Gin's void `Flush` while maintaining header accounting via `WriteHeaderNow` to keep transport errors observable

Closes: #6332
2026-10-04 17:33:19 +08:00
Luis Pater
cbc4cd5532 feat(interactions): support antigravity session continuation and model detail lookup
- Add `InteractionsSessionCache` to preserve Antigravity interaction continuations across tool call rounds
- Automatically restore and inject `previous_interaction_id` and `environment_id` in Gemini interactions executor
- Normalize Antigravity tool identity mappings in OpenAI responses translator
- Add `/v1/models/*model` endpoint to support retrieving individual model details

Closes: #5190
2026-10-04 04:23:31 +08:00
Luis Pater
868e137f6c feat(payload): introduce payload finalizer for protobuf and multipart requests
- Add `PayloadFinalizer` to apply configuration rules at the final serialization barrier
- Support decoding, modifying, and re-encoding Devin protobuf business fields
- Add multipart form-data payload normalization to JSON for media payload rules

Closes: #5067
2026-10-04 03:01:34 +08:00
sususu
9b9c2bdf54 feat(antigravity): support Claude 5.5 CAQS thinking signature replay 2026-10-03 17:31:27 +08:00
Luis Pater
a3b77566ad fix(codex): publish main usage before image tool usage in execute
- Publish primary model usage prior to image tool usage during response execution

Closes: #6311
2026-10-03 16:14:51 +08:00
Luis Pater
ea8ffd5f92 fix(devin): stream content early and defer thought stop for late signatures
- Allow early content streaming for OpenAI formats while preserving ordering behind queued tools
- Defer thought step termination and accumulate signature fragments for OpenAI Responses format
- Flush deferred reasoning step stops when closing open stream steps

Closes: #6306
2026-10-03 15:53:39 +08:00
Luis Pater
5dbce4f3fb perf(claude): prefilter JSON payloads before diagnostic walks
- Add ASCII pre-filter to skip expensive gjson traversals for title helper and 1h TTL checks
- Check raw bytes for target keywords before initiating full JSON walks
- Fall back to full inspection when printable ASCII Unicode escapes are detected

Closes: #6291
2026-10-03 10:48:07 +08:00
Luis Pater
6d57ac9087 fix(claude): pin session date in cloaked reminder to prevent prompt cache invalidation
- Pin local date to continuity context on the first request of a session
- Reuse pinned session date during cloaked date injection across execute and stream flows
- Prevent midnight calendar date flips from invalidating conversation prompt cache prefixes

Closes: #6282
2026-10-03 00:28:35 +08:00
Luis Pater
e2bff0107b Merge pull request #6285 from sususu98/feat/antigravity-connection-debug-trace
feat(antigravity): trace upstream connection reuse in debug logs
2026-10-02 22:42:50 +08:00
hkfires
3be5fa44f9 fix(config): support historical v8 aliases
Accept historical v8 config paths and request bodies while saving the
latest canonical layout. Preserve comments on scalar updates and keep v0
saves from migrating legacy-only files unnecessarily.
2026-10-02 22:36:37 +08:00
hkfires
52d5507dd3 feat(config): add shared upstream provider settings
Move shared Codex, Claude, and xAI provider options under upstream so
they apply consistently to OAuth and API-key credentials. Migrate
historical OAuth paths, preserve OAuth-only header scope, and expose the
new upstream management API path.
2026-10-02 22:36:35 +08:00
sususu
d7c3c0aaaa feat(antigravity): trace upstream connection reuse in debug logs 2026-10-02 22:13:24 +08:00
Luis Pater
8fbf152b5b fix(executor): preserve top-level responses token usage when service tier is present
- Fall back to top-level token usage when Codex response usage contains only service tier metadata
- Propagate parsed service tier while retaining top-level token counts
- Avoid early return during stream usage observation for chunks with zero token counts

Closes: #6261
2026-10-02 16:01:23 +08:00
Luis Pater
30aa1f1200 test(executor): relax connection reuse bounds in transport tests
- Allow connection count slack for concurrent wave dials to prevent flakiness under load
- Assert strictly against unpooled worst case instead of fragile lower bounds on connection count

Closes: #6259
2026-10-02 15:36:10 +08:00
Luis Pater
5ec3144299 fix(gemini): handle split usage metadata and max tokens in responses translation
- Track cumulative usage snapshots from `usageMetadata` and `cpaUsageMetadata` across stream chunks
- Defer terminal response event emission until usage frames arrive or the stream ends
- Map `MAX_TOKENS` finish reason to `response.incomplete` status and incomplete output item states

Closes: #6258
2026-10-02 15:21:46 +08:00
hkfires
2783e10c59 fix(executor): publish antigravity stream usage first 2026-10-02 10:58:36 +08:00
hkfires
cf3102cc03 refactor(executor): optimize translation logic and improve plugin invocation handling 2026-10-02 10:58:36 +08:00
hkfires
9f35c1dcda refactor(signature): improve logging and sanitize logic for Gemini signatures 2026-10-02 10:58:36 +08:00
hkfires
f3fd2f232d fix(signature): suppress routine Gemini bypass logs 2026-10-02 10:58:36 +08:00
Luis Pater
63c04b4bd4 feat(config): introduce client configuration section for codex settings
- Add `ClientConfig` and `CodexClientConfig` structs to `SDKConfig`
- Move `optimize-multi-agent-v2` and add `enable-apply-patch` under `client.codex`
2026-10-02 05:34:30 +08:00
Luis Pater
3ebee06516 fix(interactions): bridge apply_patch tool calls in responses translation
- Handle apply_patch custom tool call streaming deltas and snapshots for Responses API translation
- Track and resolve step indexes, function call identities, and error states across stream events
- Propagate apply_patch tool input errors and upstream failure states in stream and non-stream responses
2026-10-02 03:49:51 +08:00
ggbdpq
b467a83c0f fix(xai): bump pinned grok client version to 1.0.44 for chat-proxy
xAI raised the minimum accepted x-grok-client-version on
cli-chat-proxy.grok.com, so every xAI OAuth chat request through the CLI
chat-proxy failed with HTTP 426 ("Your Grok CLI version (0.2.120) is
outdated"). /v1/models is not gated, so discovery looked healthy while
inference was dead.

Bump the pin to the current stable Grok CLI version (1.0.44) and record
the observed server floor in the constant's comment. Both
x-grok-client-version and the derived User-Agent ship from this one
constant.

Regression tests lock three things: the pinned version meets the known
server floor (red against 0.2.120), the two identity headers stay
derived from the same constant, and the per-auth `header:*` custom
header override still wins over the pin - the documented operator
escape hatch when xAI ratchets the floor again.

Closes #6249

Generated-by: GLM-5.3-Flash (ZCode)
2026-10-01 06:14:37 +08:00
Luis Pater
97f244b8dd fix(codex): pass target executor to compatibility translation and token counting
- Pass target executor identity during Codex token counting and xAI request translation
- Skip tool integer normalization when target executor is Codex during compatibility translation
- Preserve number types in tool parameter schemas during token counting requests
2026-10-01 03:06:59 +08:00
Luis Pater
9e71c20d01 fix(codex): handle upstream stream disconnect before first payload as bad gateway
- Return Bad Gateway error when Codex upstream stream closes before emitting any payload
- Allow failover to subsequent credentials on premature stream disconnect before output
- Map HTTP 408 Request Timeout status to server_error in base error response handlers

Closes: #6247
2026-10-01 02:51:19 +08:00
Luis Pater
67cb32b6d3 fix(codex): determine tool integer normalization by target executor identity
- Base tool integer normalization checks strictly on target executor identity rather than protocol
- Add executor-aware translation helpers to pass target executor identity during request translation
- Ensure non-Codex executors normalize tool integer types for Codex clients regardless of protocol
2026-10-01 02:26:02 +08:00
Luis Pater
a8ffd5a843 fix(codex): skip tool parameter integer normalization for codex executor targets
- Skip normalizing tool parameter number types to integer when the target executor is Codex or Codex WebSocket
- Remove tool integer type normalization from schema cleanup in native Codex execution paths to preserve reserved tool schemas
- Apply tool integer type normalization only for non-Codex upstream targets with Codex client User-Agents

Closes: #6244
2026-10-01 02:04:49 +08:00
Luis Pater
82f8e92b21 fix(executor): support negotiated ALPN protocols in uTLS client
- Select HTTP/2 or HTTP/1.1 transport dynamically based on TLS ALPN negotiation
- Route empty ALPN and HTTP/1.1 requests through a dedicated non-pooled transport reusing the handshaken connection
- Ensure uTLS connections are cleanly closed upon response completion or request failure

Closes: #6223
2026-10-01 00:47:24 +08:00
Luis Pater
e5b5a1cfca fix(kimi): reorder interleaved tool outputs in responses input
- Defer intervening non-tool messages until all batch tool outputs are emitted to keep outputs contiguous
- Apply responses input normalization across standard and streaming executor execution paths

Closes: #6231
2026-09-30 23:39:28 +08:00
Luis Pater
71a5f1f6c5 fix(codex): normalize tool parameter number types to integer for codex clients
- Detect Codex client requests via User-Agent and convert target numeric parameters to integer types
- Support schemas across OpenAI functions, Claude input schema, Gemini declarations, and namespace tools
- Apply normalization during executor payload processing, multi-agent request translation, and WebSocket streaming

Closes: #6237
2026-09-30 22:27:18 +08:00
Luis Pater
f33f04d6c0 fix(codex): convert agent_message in compat mode without multi-agent optimization
- Enable multi-agent input rewriting when model compatibility mode is active, even if `optimize-multi-agent-v2` is disabled
- Ensure `agent_message` items are converted into portable user messages for third-party endpoints under API key configurations

Closes: #6233
2026-09-30 17:57:51 +08:00
Luis Pater
6004ebdfdb fix(claude): fail open on unmapped oauth mcp tool aliases
- Forward unmapped Claude OAuth MCP tool aliases unchanged instead of returning an error
- Log a warning when no request-local tool match is found to prevent stream termination

Closes: #6208
2026-09-30 12:04:58 +08:00