Commit Graph

4264 Commits

Author SHA1 Message Date
Luis Pater
dfe0a0effe fix(antigravity): omit tool_calls from default streaming delta template
- Remove `"tool_calls": null` from the OpenAI chunk template so `tool_calls` is omitted when absent

Closes: #6514
2026-10-10 22:37:11 +08:00
Luis Pater
37fe2608ee feat(usage): propagate access provider and native key metadata to usage records
- Inject API key, access provider, and native key flags into the request context during authentication
- Add `IsNativeKey` and `AccessProvider` fields to usage records, plugin API types, and redis queue payloads
- Provide context helper functions and automatic fallback resolution in the usage manager and reporter

Closes: #6509
2026-10-10 22:16:00 +08:00
Luis Pater
cad1b50347 fix(devin): do not seed input token estimates for claude streams
- Avoid seeding `message_start` with full-input token estimates in Devin streaming
- Rely on authoritative cache-aware token usage reported in response frames

Closes: #6505
2026-10-10 21:48:20 +08:00
Luis Pater
5dbd92a0e0 fix(auth): preserve upstream error cooldown on canceled stream contexts
- Record credential and model cooldowns when stream execution encounters an upstream error despite context cancellation
- Prioritize reading ready stream chunks before handling context cancellation in conductor
- Defer Codex websocket disconnect notifications until error frames are delivered to the stream

Closes: #6503
2026-10-10 20:26:36 +08:00
Luis Pater
b0debb3537 fix(codex): shorten over-length tool call IDs in chat completions
- Truncate and hash tool call IDs exceeding 64 characters to comply with Codex limits
- Handle collisions with existing call IDs to ensure deterministic and unique tool call mappings

Closes: #6501
2026-10-10 13:18:36 +08:00
Luis Pater
763b41d4fe Merge pull request #6499 from seakee/docs/update-cpamp-description 2026-10-10 10:35:35 +08:00
seakee
5cff76dd2a docs: refresh CPA-Manager-Plus descriptions in multilingual READMEs 2026-10-10 10:29:19 +08:00
Luis Pater
be8c35f294 fix(claude): ignore invalid and null cache control entries in executor
- Use `isValidClaudeCacheControl` when inspecting `cache_control` fields across system prompts, tools, and message contents
- Prevent null or non-object cache control entries from counting against limits or interfering with TTL normalization and injection logic

Closes: #6491
2026-10-10 08:01:26 +08:00
Luis Pater
d318bcc3af fix(codex): handle late response interrupts on websocket sessions
- Track terminal response IDs per connection to idempotently handle late interrupts targeting completed turns
- Prevent late interrupts from contaminating subsequent requests or returning false errors on idle retained connections
- Add thread-safe diagnostic logging of sanitized interrupt outcomes in the Responses websocket handler

Closes: #6483
v8.0.23
2026-10-09 21:35:40 +08:00
Luis Pater
76c87ce91d fix(xai): reset terminal error on websocket connection configuration
- Clear terminal error state when configuring a replacement xAI websocket connection to prevent stale error propagation

Closes: #6480
2026-10-09 20:26:25 +08:00
Luis Pater
9612b7ac07 Merge pull request #6490 from router-for-me/home
fix(auth): skip local filtering for home dispatch
2026-10-09 19:47:59 +08:00
Luis Pater
e9c8769a7a fix(executor): normalize and restore non-portable tool call IDs
- Normalize tool use and tool result IDs in Claude message payloads to adhere to character constraints
- Encode non-portable tool call IDs in Devin executor responses and restore original IDs before request construction

Closes: #6478
2026-10-09 19:44:24 +08:00
sususu98
84740392c8 Merge pull request #6488 from router-for-me/fix/openai-compat-stream-ttft
fix(openai-compat): measure streaming TTFT on effective token frames
2026-10-09 19:29:54 +08:00
hkfires
4a8ecf5ceb fix(auth): skip local filtering for home dispatch 2026-10-09 19:23:25 +08:00
sususu
f8e4a84074 fix(openai-compat): measure streaming TTFT on effective token frames 2026-10-09 19:00:58 +08:00
Luis Pater
2d8ec73b33 fix(claude): preserve mid-conversation effort directives during system insertion
- Skip directive-only system turns when locating the insertion point for mid-conversation system messages
- Prevent system blocks from being prematurely placed before subsequent user turns when effort directives are present

Closes: #6477
2026-10-09 17:43:09 +08:00
Luis Pater
9a7db8e36d fix(claude): defer stream message delta emission to trailing usage chunk
- Avoid emitting `message_delta` early when chunks contain a `finish_reason` alongside preliminary usage
- Preserve authoritative token metrics such as `cached_tokens` received in trailing usage-only chunks

Closes: #6475
2026-10-09 12:50:06 +08:00
Luis Pater
51bde0ff96 fix(codex): preserve resolved upstream model in direct openai image requests
- Check configured upstream models and aliases before normalizing direct OpenAI image model names
- Support requested model resolution across JSON and multipart image payloads

Closes: #6458
2026-10-09 10:10:50 +08:00
Luis Pater
67465884ca fix(pluginhost): detach unselected plugins on config apply
- Automatically detach and shut down plugins that are disabled or unselected during configuration reload
- Unload all active plugins when the plugin system is globally disabled

Closes: #6471
v8.0.22
2026-10-09 04:04:08 +08:00
Luis Pater
a881c0361c fix(claude): respect registry completion limit for default responses max tokens
- Use registered model `MaxCompletionTokens` limit when `max_output_tokens` is omitted, allowing limits above the 32k default
- Preserve conservative ceiling for Fable models

Closes: #6468
2026-10-09 03:43:34 +08:00
Luis Pater
2bc236d2fc feat(claude): support responses compaction in claude executor
- Handle compaction trigger requests by generating summaries and sealing antigravity compaction capsules
- Expand replayed compaction capsules into message history before translation and filter foreign compaction items
- Preserve tool definitions with `tool_choice: none` or flatten tool blocks when tool definitions are missing
- Support streaming compaction execution and map cache creation and read token usage

Closes: #6466
2026-10-09 03:24:45 +08:00
Luis Pater
8080967991 fix(claude): ignore overage billing resets in unified rate limit parsing
- Ignore unified reset timestamps matching overage reset boundaries to prevent cooling down credentials until monthly billing reset
- Filter candidate rate limit deadlines exceeding the 7-day window limit
- Treat rejected overage claims with absent or healthy shared utilization as model-scoped rejections

Closes: #6465
2026-10-08 22:14:59 +08:00
Luis Pater
ab151f5d04 fix(antigravity): include thoughts token count in openai completion tokens
- Add `thoughtsTokenCount` to `candidatesTokenCount` when calculating `usage.completion_tokens` for Antigravity OpenAI response translation

Closes: #6463
2026-10-08 21:46:26 +08:00
Luis Pater
6331b38bba feat(openai): support response.interrupt in responses websocket handling
- Intercept and process `response.interrupt` control frames immediately on the downstream websocket reader
- Forward interrupts to active upstream Codex websocket sessions without starting a new turn or rewriting payload fields
- Support canceling in-flight HTTP turns via local interrupt handling
- Allow session-staged Home credentials to authorize interrupts

Closes: #6456
2026-10-08 21:32:26 +08:00
Luis Pater
54946fa3df docs(readme): remove full QQ group in README_CN v8.0.21 2026-10-08 20:04:31 +08:00
Luis Pater
7c2133e201 fix(cliproxy): reconcile concurrent auth updates during batch model registration
- Use latest auth state in model registration to prevent applying stale snapshots
- Reconcile and re-register auths with updated generations after batch registration tasks complete

Closes: #6453
2026-10-08 16:45:45 +08:00
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
v8.0.20
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
f3703e821a Merge pull request #6444 from router-for-me/feat/server-github-token
feat: add global server GitHub token configuration
v8.0.19
2026-10-08 00:38:19 +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
cd9e5acec7 fix(api): compact json error response bodies for SSE compatibility
- Compact valid upstream JSON error response payloads to single-line formatting to ensure compatibility with SSE streams while preserving error data

Closes: #6434
v8.0.18
2026-10-07 21:13:39 +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
v8.0.17
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
935aa6e3ea fix(cliproxy): prevent in-flight token refresh from overwriting concurrently updated credentials
- Ignore in-flight refresh results when the credential version or credentials have been modified concurrently after the initial snapshot

Closes: #6417
2026-10-07 07:40:18 +08:00
Luis Pater
6920ed5dfc fix(cliproxy): propagate credential version and registration epoch in execution results
- Include `CredentialVersion` and `RegistrationEpoch` when recording execution results to prevent late failures from stale credentials or older registrations from cooling down or invalidating updated credentials
- Update `Store` contract to ensure `CredentialVersion` remains immutable during persistence

Closes: #6416
2026-10-07 01:11:22 +08:00
Luis Pater
50d5fe1831 fix(cliproxy): avoid selecting rejected credentials during refresh and preserve active quota cooldowns
- Track `RejectedAccessToken` on 401 failures so rejected tokens are treated as expired and bypassed by concurrent requests while refresh is pending
- Preserve active model quota cooldown states when clearing unauthorized errors upon successful token refresh
- Reschedule token refresh if the refresh operation is canceled

Closes: #6415
2026-10-07 00:14:50 +08:00