Skip to content
Discussion options

You must be logged in to vote
Admin verified this answer by diegosouzapw Jul 3, 2026

Hey @powellnorma! Short answer: it is 0 by default because sticky sessions trade a bit of load-balancing for cache/continuity, and the team left it opt-in rather than forcing that trade-off on everyone.

How it works: src/sse/services/auth.ts -- the affinity key comes from a header (x-codex-session-id / x-session-id) or fields in the body (conversation_id, session_id, prompt_cache_key) via extractSessionAffinityKey (auth.ts:280-305). The TTL is resolved per request (auth.ts:1489-1498) and the actual account pick happens in selectSessionAffinityConnection (auth.ts:728-777), backed by a SQLite key_value table (src/lib/db/sessionAccountAffinity.ts).

On quota: you are right, it does NOT get st…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer verified by Admin Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants