Repository navigation
Conversation
Mirror the existing image/video opt-in: read x-connection-id in the chat single-model path and pass it to getProviderCredentials as the preferred connection. The pinned account is tried first; on quota/error/lock the request falls back to the provider's other accounts as usual. Absent, unknown, or inactive ids are ignored. Applies to single-model, combo, fusion, and capacity-adapter paths alike.
Each connection row now shows a copyable connection-id chip, and the provider Connections header carries a one-line tip about the x-connection-id request header, so account pinning is discoverable without reading source. Docs: smart-routing.md gains a Claude Code example (ANTHROPIC_CUSTOM_HEADERS in ~/.claude/settings.json env) and claude-code.md documents optional account pinning.
Keep both sides: our copy-to-clipboard connection-id hooks and upstream's proxy dropdown refs/state.
…ocks detectRequiredCapabilities and the modality strip concern only scanned top-level content blocks, but claude→openai translates tool_result images into image_url parts. A tool-returned screenshot therefore bypassed the vision capacity adapter and hit text-only upstreams (e.g. Zhipu coding endpoint 400 code 1210: content.type must be text). - combo.js: recurse scanBlock into tool_result content[] - modality.js: stripNestedToolResultMedia for vision/pdf/audio caps
luqman-v1
approved these changes
Oct 23, 2026
luqman-v1
left a comment
There was a problem hiding this comment.
LGTM: adds optional x-connection-id request header to pin account selection with automatic fallback to pool on failure. Clean documentation and unit tests.
Author
Thanks for the review! I've merged latest master (v0.5.111) into the branch and the full unit suite matches vanilla master (no new failures). Happy to squash/rebase if you prefer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
x-connection-idaccount pinning to the chat endpoints, mirroring the opt-in already supported by the image/video endpoints.Motivation
For providers with multiple connected accounts (Antigravity, Codex, ...), account selection is global (fill-first / round-robin). There is no way to prefer a specific account per request — e.g. multi-agent setups where each agent should burn its own account first and only fall back to the shared pool when it is exhausted (quota, rate limit, error).
What changed
src/sse/handlers/chat.js— readx-connection-idinhandleSingleModelChatand pass it aspreferredConnectionIdtogetProviderCredentials. The pinning + fallback logic already exists inauth.js; this just wires the header through, so single-model, combo, fusion and capacity-adapter paths honor it (6 lines).features/smart-routing.md, incl. a Claude Code example (ANTHROPIC_CUSTOM_HEADERSin~/.claude/settings.jsonenv block); "Pin a specific account (optional)" inintegration/claude-code.md.Behavior
Testing
pinned to <id> (<email>), request runs on that account, 200 OK.ANTHROPIC_CUSTOM_HEADERS: "x-connection-id: <id>"— full agentic session (33 tools, multi-turn) pinned to the expected account,claude→antigravitytranslation intact.<screenshot of the provider page with the id chip + tip>