mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 08:05:12 +00:00
Self-hosted routers such as vllm-router keep a session on one decode replica by the X-Session-ID header, but the Chat Completions outbound path forwards only accept-language and user-agent from the client. The new account extra key `openai_chat_session_id` makes that path send the client's session as X-Session-ID, isolated per API key with isolateOpenAIUpstreamSessionID. The session comes from the same sources as x-opencode-session: client session headers first, then the prompt_cache_key or metadata.user_id remembered before protocol conversion, so /v1/responses and /v1/messages requests converted to Chat Completions keep their sessions. Account header overrides still apply last, and accounts without the key send the same headers as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>