3179 Commits

Author SHA1 Message Date
Luis Pater
0a23627d22 fix(config): normalize collection styles and unquote mapping keys in v8 api
- Export `NormalizeCollectionNodeStyles` to traverse document nodes and clear double quotes from string mapping keys
- Apply collection style normalization before YAML marshaling in the v8 management config handler

Closes: #6451
2026-10-08 13:20:41 +08:00
Luis Pater
249e9ef976 fix(meta): preserve foreign reasoning encrypted content in responses requests
- Introduce `sanitizeOpenAIResponsesReasoningEncryptedContentKeepForeign` to retain unknown-format reasoning signatures
- Update Meta executor to preserve foreign reasoning encrypted payloads for third-party models like Muse

Closes: #6450
2026-10-08 13:03:21 +08:00
Luis Pater
2d5351b3e5 feat(vertex): add support for native gemini interactions api
- Extract shared Gemini Interactions helpers for payload translation, input sanitization, thinking, and SSE streaming
- Add `interactions` configuration option to Vertex credentials
- Support native non-streaming and streaming Interactions API execution in Gemini Vertex executor

Closes: #6445
2026-10-08 12:39:31 +08:00
Luis Pater
0f96f568e4 refactor(translator): update openai and interactions request converters to return errors
- Update OpenAI and OpenAI Responses to Interactions request converters to return `([]byte, error)`
- Register request converters directly in internal translator registry instead of sdktranslator checked requests
2026-10-08 03:00:04 +08:00
Luis Pater
34e73c75a3 fix(xai): add proxy support and semver validation to Grok CLI updater
- Pass configured proxy URL to the npm registry updater client
- Validate fetched versions against strict semver and minimum server version floor (`1.0.13`)
- Update default fallback client version to `1.0.46`
- Manage background updater lifecycle and context via service lifecycle initialization
2026-10-08 02:39:32 +08:00
Luis Pater
298649f677 Merge pull request #6446 from jellyfish-p/feat/grok-cli-dynamic-version
feat(xai): dynamically fetch latest Grok CLI version from npm registry with fallback
2026-10-08 02:30:27 +08:00
Luis Pater
f51624aa35 fix(translator): report unsendable user turn attachments in openai responses to interactions
- Track dropped attachments and reject emptied user turns during OpenAI Responses to Interactions translation
- Register checked request translator for OpenAI Responses to Interactions format conversion
2026-10-08 02:11:20 +08:00
Luis Pater
7cd8f7bac7 Merge pull request #6441 from soilSpoon/fix/attachment-parts
fix(translator): stop dropping attachments and empty turns
2026-10-08 02:09:31 +08:00
Jellyfish
90654da573 feat(xai): dynamically fetch latest Grok CLI version from npm registry with fallback
- Fetch latest @xai-official/grok client version from npm registry on startup
- Periodically refresh Grok CLI version every 3 hours without multiple retries
- Update hardcoded fallback version to 1.0.50 if npm registry is unreachable
- Dynamically inject active version into x-grok-client-version and User-Agent headers
2026-10-08 00:59:27 +08:00
Supra4E8C
7c41cd05e4 feat: add global server GitHub token configuration 2026-10-08 00:33:27 +08:00
Luis Pater
e7b22260dd fix(claude): support plain-text and structured response bodies for missing thread errors
- Extend `IsClaudeThreadNotFound` to identify missing thread errors from plain-text error messages in addition to JSON payloads
- Implement `ResponseBody` on executor `claudeThreadNotFoundError` to supply structured JSON error payloads

Closes: #6443
2026-10-07 23:32:21 +08:00
Luis Pater
14dc4e05a0 fix(claude): relocate caller system prompt to messages for OAuth requests
- Relocate caller system prompts into conversation messages when using OAuth to prevent triggering Anthropic's third-party classifier
- Apply the same relocation policy to token counting requests

Closes: #6432
2026-10-07 20:52:17 +08:00
이대희
3b69068e6c fix(translator): stop dropping attachments and empty turns
An attachment a translator could not represent was dropped without a word, and
a turn whose only content was that attachment went upstream as an empty
messages, parts, or input array. The model then answered as if nothing was
attached, or the upstream rejected a request that never named the attachment.

A base64 document now reaches OpenAI as a file part. A file the target cannot
receive, such as container_upload, an OpenAI file_id, or input_audio sent to
Claude, is reported by name so the route answers 400 instead of forwarding an
empty turn. Text beside it still travels.

One rule, ErrIfNothingLeft, decides when to refuse, and RegisterCheckedRequest
carries the refusal on the request envelope. Every executor that translates
checks it before calling upstream. The exported converters keep their []byte
signature, so no caller or sibling test had to change.
2026-10-07 19:21:32 +09:00
Luis Pater
306c9bd824 fix(routing): restrict speech-only models to speech endpoints and refine xAI error scoping
- Reject speech-only models (such as `grok-tts` and `grok-voice-tts-1.0`) on non-speech entry protocols to prevent invalid chat upstream routing
- Mark upstream 404 errors for xAI speech as request-scoped unless indicating model unavailability, preventing unnecessary credential rotation and model cooldowns
- Align xAI speech payload finalizer protocol with `openai` for consistent payload override rules
2026-10-07 13:46:58 +08:00
Luis Pater
061001f8f8 Merge PR #6418: feat(xai): expose Grok TTS on /v1/audio/speech 2026-10-07 13:12:14 +08:00
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
luohui1
6a853dce05 feat(xai): expose Grok TTS on /v1/audio/speech
Route OpenAI speech requests to the official xAI /tts endpoint and register grok-tts and grok-voice-tts-1.0.
2026-10-06 02:49:21 -07:00
Luis Pater
68ea171da2 fix(gemini): handle carrier thinking blocks for signed visible text and tool calls in Claude response translation
- Emit carrier thinking blocks for thought signatures accompanying visible text or tool calls in both streaming and non-streaming responses
- Ensure thinking content and visible text are properly segregated without misclassifying regular output as reasoning

Closes: #6409
2026-10-06 15:43:01 +08:00
Luis Pater
a0d31924e0 fix(gemini): map refusal finish reasons and handle partless stream completion in Claude response translation
- Map Gemini safety, recitation, and malformed function call finish reasons to Claude `refusal` stop reason across streaming and non-streaming responses
- Ensure `content_block` and `message_delta` events are properly emitted on partless stream completions and `[DONE]` signals

Closes: #6408
2026-10-06 15:14:04 +08:00
Luis Pater
d510dccf1b fix(gemini): support camelCase systemInstruction in request translation
- Support `systemInstruction` field alongside `system_instruction` when converting Gemini requests to Claude format

Closes: #6407
2026-10-06 11:44:23 +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
e1e3a811b8 fix(gemini): enforce object type on schema nodes with properties
- Ensure schema nodes defining `properties` explicitly set `type` to `object`
- Prefer `object` type when resolving multi-type unions on nodes declaring `properties`

Closes: #6394
2026-10-05 23:10:26 +08:00
Luis Pater
ba1bbd75d8 fix(gemini): support document blocks in Claude request translation
- Support base64 `document` content blocks alongside `image` blocks when converting Claude requests to Gemini inline data
- Avoid creating empty contents turns when all message parts are filtered or unsupported

Closes: #5960
2026-10-05 18:00:44 +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
30700d4482 Merge pull request #6391 from router-for-me/home
fix(registry): disable Devin catalog for home builds
2026-10-05 16:53:55 +08:00
hkfires
01e2856704 fix(registry): disable Devin catalog for home builds 2026-10-05 16:47:04 +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
68afd0d1b4 feat(codex): support action sources in Claude web search translation
- Extract web search result sources from `action.sources` in item and root payloads in addition to `results`

Closes: #5546
2026-10-05 06:40:32 +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
16d98881d4 feat(codex): preserve URL citations in OpenAI response translation
- Parse and map `url_citation` annotations to OpenAI message and delta annotations for both stream and non-stream responses
- Track emitted text rune offsets to calculate citation start and end indices accurately
- Deduplicate citations across streaming annotation events and message completion updates

Closes: #6361
2026-10-05 05:35: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
5c959cb032 fix(claude): mark missing thread state error for client replay
- Treat Claude missing thread state 404 errors as client errors to bypass credential rotation and cooldown
- Inject `thread_not_found` error code into Claude error response details to signal client-side replay
- Support extracting upstream response bodies across error formatting and classification helpers

Closes: #6344
2026-10-04 21:40:10 +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
1672be5d25 feat(registry): support custom model catalog sources and dynamic reload
- Add `CatalogSources` configuration to allow overriding general, Codex, and Devin catalog sources via URLs or absolute local file paths
- Centralize model catalog fetch, validation, and scheduled background updates in `catalogUpdater`
- Support dynamic catalog source updates and hot reloading during service runtime
- Update `--local-model` flag to use embedded models as defaults while respecting explicit overrides

Closes: #6319
Closes: #5024
2026-10-04 13:35:09 +08:00
Luis Pater
33ec5502c3 fix(claude): refine model version parsing for assistant prefill rejection
- Strip provider namespaces and prefix before evaluating model family
- Parse major and minor version numbers dynamically while ignoring snapshot dates
- Correctly identify unsupported assistant prefill models for Fable, Opus 5+, and Sonnet 4.6+

Closes: #5483
2026-10-04 05:50:40 +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