Skip to content

chore(upstream): merge v8.0.51 into custom - #4

Merged
Raghav-56 merged 241 commits into
customfrom
updates/upstream-v8.0.51
Nov 1, 2026
Merged

Raghav-56 merged 241 commits into
customfrom
updates/upstream-v8.0.51

Conversation

@Raghav-56

@Raghav-56 Raghav-56 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Merge official stable v8.0.51 into custom with upstream ancestry preserved.

The account console, account removal, quota guidance, manual Codex account selection, request history, and synchronized config saves remain in place. The merge combines custom account identity and selection with upstream usage metadata and routing. Upstream's expanded interrupt lifecycle and upload synchronization retain the behavior covered by the custom regression tests.

Validation passed locally:

  • Full Go suite with Go 1.26.10: go test ./... -count=1 -p=2. Live discovery ran in an isolated network because the host firewall blocks IPv4 multicast.
  • Account-console tests and upstream-updater tests.
  • Server and config-export builds, go vet ./..., formatting, merge-marker check, and diff secret scan.

Merge with a merge commit. Deployment and live account selection remain separate from this source update.

luispater and others added 30 commits October 20, 2026 08:13
… tool calls for Claude responses

- Map non-streaming stop_reason to tool_use when tool_calls are present unless finish_reason is length or content_filter.
- Allocate distinct streaming tool call accumulators and track position mappings when omitted-index tool call deltas carry a new id across chunks.

Closes: router-for-me#6788
…n-stream Responses translator

- Fall back to `usage.completion_tokens_details.reasoning_tokens` in `ConvertOpenAIChatCompletionsResponseToOpenAIResponsesNonStream` when `usage.output_tokens_details.reasoning_tokens` is absent, aligning non-streaming usage mapping with the streaming path.
- Add regression test coverage for both `completion_tokens_details.reasoning_tokens` and `output_tokens_details.reasoning_tokens` in non-streaming Chat Completions to Responses translation.

Closes: router-for-me#6789
…e (SGLang)

SGLang's OpenAI-compatible server emits reasoning tokens flat on the
usage object instead of nesting them in completion_tokens_details /
output_tokens_details, so the keeper recorded reasoning_tokens=0 for
affected upstreams. Add a third fallback plus bucket detection for the
flat key; regression included.

Fixes router-for-me#6792
Meta streaming armed protocol-aware TTFT tracking but never observed token
events, so usage records kept the first-body-byte fallback even when
substantive output arrived later. Observe Responses events before failure
publication and translation using the existing shared helper.

Add deterministic virtual-clock coverage for content, terminal events,
error fallbacks, downstream translation, and non-streaming timing.

Fixes router-for-me#6664
…I User-Agent

- Forward downstream User-Agent headers in xAI non-CLI-proxy and WebSocket requests with fallback to the Grok workspace User-Agent instead of Go's default HTTP client User-Agent.
- Forward downstream User-Agent headers in OpenAI-compatible requests while retaining cli-proxy-openai-compat as the fallback and preserving custom header overrides.

Closes: router-for-me#6791
Responses reasoning emitted only in response.output_item.done was ignored
until a later token or terminal event. Count non-empty summary and content
text in the shared classifier while excluding empty and encrypted-only
items.

Add deterministic coverage for Meta Responses and Claude downstreams,
classification boundaries, and preservation of an earlier token time.
Refresh the bootstrap-buffering comment to match the shared helper.

Refs router-for-me#6664
…eam-ttft

fix(meta): measure streaming TTFT on effective token frames
…aches

Include the captured client User-Agent in model capability cache and backoff
keys, discard obsolete publications, and cancel stale probes on refresh.

Use release-specific Hub changelists and the daily loadCodeAssist endpoint
for project discovery and credits queries.

Refs router-for-me#6619
…19-antigravity-fingerprint

fix(antigravity): align Hub requests and invalidate versioned model caches
… honor parallel_tool_calls

- Map Claude refusal, model_context_window_exceeded, and pause_turn stop reasons across OpenAI Responses and Chat Completions translators, executors, and streaming handlers.
- Preserve paused server-side web search turns on continuation and map OpenAI Responses parallel_tool_calls=false to Claude tool_choice.disable_parallel_tool_use=true.

Closes: router-for-me#6800
…ranslator

- Hoist ResolveCodexReplayTargetModel out of appendReasoningContent in convertClaudeRequestToCodex so unmapped model names do not rescan the request body for every assistant thinking block.
- Add an allocation regression test and benchmark covering unmapped model names serialized after the message history.

Closes: router-for-me#6804
- Resolve relative path and source attributes against the current working directory in codexBindingPath instead of re-joining them with auth-dir, keeping the auth-dir join only for bare FileName fallbacks.
- Normalize relative auth-dir and credential paths to absolute paths before symlink evaluation in codexBindingPath and resolveSIWCBindFile so confinement checks remain consistent when working directory ancestors contain symlinks.

Closes: router-for-me#6805
… during full scan

- Record auth files whose os.ReadFile fails with errors other than fs.ErrNotExist as incomplete during FileSynthesizer scans and Watcher.reloadClients hash rescans so existing credentials and file indexes are retained.
- Add regression tests covering unreadable auth files and dangling symlinks across full scans, client reloads, and provider reloads.

Closes: router-for-me#6806
- Include a hash of the selected upstream credential identity in claudeWebSearchResultCacheScope so cached encrypted_content is only restored for the credential that produced it.
- Pass auth into web search result cache scope resolution across Execute, ExecuteStream, and CountTokens paths and add regression coverage for credential switching.

Closes: router-for-me#6810
- Record the target credential's start-time account ID in the SIWC bind session and validate disk consistency before starting authorization.
- Require BindCodexSIWC to match the start-time account against both the live in-memory credential and the backing file before persisting SIWC tokens.
- Add unit and management handler regression tests covering account replacement via legacy uploads and watcher updates during active SIWC binds.

Closes: router-for-me#6809
…model-prefix

- Skip the force-model-prefix early return in routingXAIImagesModel for built-in xAI vendor aliases (`xai`, `x-ai`, `grok`) when no credential registers that prefix, allowing fallback to unprefixed xAI credentials.
- Share `isXAIVendorAlias` between xAI image model validation and routing resolution and add regression tests for force-model-prefix behavior.

Closes: router-for-me#6808
…t translations

- Map Gemini functionCall thoughtSignature fields to OpenAI tool_calls extra_content.google.thought_signature when translating Gemini requests to OpenAI chat completions.
- Restore OpenAI tool_calls thought signatures onto Gemini functionCall parts across both non-streaming and streaming response translations while preserving deterministic tool call ordering.

Closes: router-for-me#6807
- Acquire the Codex file lock around in-place disk writes in writeAuthFile when writing or replacing Codex credentials, and resolve symlinked paths in canonicalLockPath so upload and bind paths share the same lock.
- Verify in BindCodexSIWC before atomic replacement that the backing file bytes on disk still match the initial read, preventing uncooperative in-place rewrites from being silently overwritten.
- Add regression tests covering in-place rewrites during SIWC bind commits and legacy uploads contending on the Codex file lock.

Closes: router-for-me#6811
…eaders under cloak_mode never

- Allowlist the sdk-ts Agent SDK entrypoint and recognize its measured Haiku 5.5 helper requests so genuine Claude Code traffic passes through uncloaked.
- Preserve plausible newer Stainless SDK and runtime versions for confirmed clients and retain confirmed-shape caller headers when cloak_mode is never.
- Recognize the Agent SDK CLI identity prompt block alongside existing Claude Code identity strings.

Closes: router-for-me#6812
…ttings

- Add per-model and per-credential openapi and openapi-location settings across Vertex API-key configs, OAuth model aliases/settings, and service-account auth files with precedence over automatic publisher detection.
- Preserve alias-specific OpenAPI overrides across credential prefixes, thinking suffixes, and mixed model arrays while synchronizing explicit OpenAPI location overrides in full and short base URLs.
- Populate publisher ownership and default reasoning levels for Vertex OpenAPI models registered via vertex-api-key configurations.

Closes: router-for-me#6763
…del lookup

- Define MethodHostAuthModels and HostAuthModels request/response types in pluginabi and pluginapi so plugins can query registered models by credential.
- Implement callHostAuthModels in pluginhost to return registry models for all or filtered credentials in the auth manager, including config-backed API keys.

Closes: router-for-me#6815
- Persist the real SIWC token expiration time from expires_in and evaluate local SIWC status using real expiration (or JWT exp) and upstream 401 rejection state without triggering network requests.
- Track SIWC token rejections independently from outer Codex OAuth refreshes, execution retries, and use_siwc toggles until the SIWC token is replaced.
- Expose the read-only v8 management SIWC status endpoint and summary field for Codex credentials.

Closes: router-for-me#6819
…l injection

- Filter out empty and whitespace-only text parts in OpenAI Responses and Chat Completions to Claude request translators while preserving preceding block cache_control ordering.
- Ensure automatic and message-level cache_control injection skips empty or whitespace-only text blocks and stamps the last eligible non-empty block.

Closes: router-for-me#6820
- Treat cancellation after an emitted terminal event as successful completion while retaining observed token usage.
- Preserve buffered usage on genuine stream failures and share terminal detection with Vertex.
- Add regression coverage for terminal disconnects, EOF, usage tails, and read errors.

Closes: router-for-me#6821
UnambiguousToolNameMapFromClaudeRequest encodes MapClaudeToolName semantics in the map itself (empty value for ambiguous canonical keys), so response chunks can use MapToolName without re-scanning the request body. The legacy builder and mapper are unchanged. Differential tests against the legacy mapper cover collisions, escaping, and 500 randomized fixtures.

Refs router-for-me#6816
Switch stream and non-stream tool-name restoration to the precomputed ambiguity-aware map plus MapToolName. Previously every tool call validated the full request JSON and walked its tools array. Behavior is unchanged (see differential tests in internal/util).

Refs router-for-me#6816
Cache the model name and web-search stream mode on Params instead of re-deriving them from both request bodies on every SSE chunk. An explicit resolved flag also caches the empty/disabled cases. Existing callers pass fixed request bytes for the stream lifetime, so outputs are unchanged. Long-history benchmark (128 chunks): ~28ms -> ~0.7ms per stream.

Refs router-for-me#6816
…tor-stream-metadata

perf(translator): cache per-stream request metadata and precompute Claude tool-name mapping
Resolve the reverse tool-name map lazily on first tool use and cache it on the stream params (with an explicit resolved flag) instead of rebuilding it from the original request on every function call. The non-stream path already builds it once and is unchanged. Equivalence tests compare the cached resolver against the uncached one and byte-compare full stream outputs before/after. Long-history benchmark (655 KB request, 8 tool calls): ~726us -> ~140us per stream.

Refs router-for-me#6816
sususu98 and others added 27 commits November 1, 2026 14:14
- Keep an empty connection-pool block as an opt-in. Synthesising it to nil
  silently disabled pooling for `connection-pool: {}` and for keys inheriting
  an empty group block.
- Fold the transport kind into the pool key and pool the Claude Code uTLS
  transport per credential. Anthropic upstreams previously shared one
  transport across keys and ignored the key's pool settings.
- Fence generations per publisher instead of process-wide. Building or
  reloading one service no longer retires the pools another service is
  still serving, which degraded it to one transport per request.
…utors, and close retired pools outside fence lock
…tion-pool

feat(proxy): add opt-in per-api-key upstream connection pooling
Subscription keys return HTTP 403 client_attestation_denied when the
request still looks like muse-build/1.3.0. Stamp the headers captured
from Muse Code 1.4.14-R7309.1: muse-build/1.4.14, X-Client-Id tbh:exec,
and a fresh session id set.
…ants

- Resolve strict "<level>-fast" requests (parenthesis suffix or body thinking_level) to "<base>-<clamped-level>-fast" in ResolveDevinChatModelUID instead of silently falling back to the default effort.
- Treat a bare "fast" request as the default-effort fast variant so "(fast)" no longer resolves to the plain default UID; private aliases, special families, and the lightning tier keep their existing handling.
- Add regression coverage for the fast suffix and body-level forms plus pinning cases for private aliases and lightning models.

Closes: router-for-me#7144
… manual refresh

- Fail forced refreshes when rejected refresh tokens remain unchanged without disk rotation and preserve rejected access token markers across no-op refreshes.
- Require a valid active access token when sign-in is required before restoring active routing status during refresh and lifecycle updates.
- Return the redacted credential entry view from the v8 management credential refresh endpoint.

Closes: router-for-me#7135
…lusher-idle

fix(home): keep the release flusher idle when nothing is pending
…h the stream translator

Plugin executor streams whose output format equaled the requested format bypassed stream translation, so SSE-framed chunks ("data: {...}" plus "data: [DONE]") reached the OpenAI/Gemini handlers unchanged. Those handlers add their own "data:" prefix and terminal marker, producing a doubled "data: data:" prefix and a duplicated [DONE] on the wire.

Built-in executors always run TranslateStream, and the registered same-format translators strip that framing. Route same-format plugin executor streams through the same translation instead of returning the channel or payload unchanged. Formats without a same-format translator keep the existing behavior via the TranslateStream fallback, which returns the payload unchanged, and the OpenAI Responses usage-details fixup still runs after translation.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…nses websocket items

- Sanitize only upstream-originated replay copies (transcript merge and tool-call repair cache entries) so another credential cannot reject them as unknown input.
- Match passthrough members by decoded key name across duplicates and escaped spellings, drop objects emptied by removal, and leave client input, downstream payloads, and invalid JSON unchanged.

Closes: router-for-me#7146
…lisions

- Hash the original email or subject into the xAI credential filename so distinct accounts that sanitize identically no longer overwrite each other.
- Migrate pre-hash and identity-subset predecessors on re-login, keeping the richest known filename and preserved settings without claiming foreign files.

Closes: router-for-me#7145
Credential connection-pool blocks are intentionally absent from the default-value pruning whitelist: a block already present on disk is merged in place and survives, and only zero-valued blocks that exist solely in an in-memory Config are pruned.

Also note that the block is excluded from nested-key pruning, because a removed pool sub-key can mean either delete or inherit the group value.

Comments only, no behavior change.
…translator

- Strip intermediate hex instance identifiers from overlong gateway-namespaced MCP tool names so the shortened 64-character candidate preserves both the server words and the distinct tool name.
- Reuse shortenNameIfNeeded as the base candidate function in buildShortNameMap to keep single-name shortening and reverse tool name mapping consistent.

Closes: router-for-me#7155
…-refresh-token-spin

fix(auth): prevent Codex refresh spin without refresh tokens
…h plugins

- Add AuthProviderEntry and AuthProviderEntries in sdk/pluginapi, forward entries over auth.identifier RPC, and send multi_auth_providers in lifecycle requests.
- Normalize per-entry OAuth display metadata with plugin metadata fallbacks in RegisteredPluginInfo while preserving legacy fields when entries are omitted.
- Expose HTML-sanitized oauth_provider_entries in management plugin list responses alongside oauth_provider and oauth_providers.

Closes: router-for-me#7170
… parameters (router-for-me#7149)

- Recursively convert string-encoded integer values on JSON Schema numeric constraint keywords (minLength, maxLength, minItems, maxItems, minProperties, maxProperties) to JSON numbers while keeping parameters to parametersJsonSchema conversion.
- Traverse only valid schema and subschema containers so string literals and non-schema extension metadata remain untouched.
- Add regression tests covering Gemini, Antigravity, OpenAI, Claude, Codex, and Interactions request translation paths.

Closes: router-for-me#7149
…nt-headers

fix(meta): add Muse tool namespace for subscription requests
…tions

- Preserve original developer message roles, content, and relative positions when converting OpenAI Responses input items to Chat Completions messages while keeping unsupported attachment refusal scoped to user turns.
- Add translator and openai-compat executor regression tests covering system, developer, user, assistant, and tool-call message ordering across streaming and non-streaming requests.

Closes: router-for-me#7174
…eveloper notices

- Allow collectOpenAIResponsesFunctionCallOutputs to continue collecting tool outputs across intervening developer and system messages while pending tool calls remain.
- Compute the subsequent history slice start from one past the last consumed output index to handle non-contiguous output collection accurately.
- Add regression tests covering parallel text and image tool outputs across developer and system notices, turn boundaries, and orphan outputs.

Closes: router-for-me#7177
…deo-1.5-lite

fix(xai): support Grok Imagine Video 1.5 Lite
@Raghav-56
Raghav-56 marked this pull request as ready for review November 1, 2026 17:22
@Raghav-56
Raghav-56 merged commit a23874d into custom Nov 1, 2026
5 of 6 checks passed
@Raghav-56
Raghav-56 deleted the updates/upstream-v8.0.51 branch November 3, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.