You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Account Pooler: 30-minute session pin is shorter than the 1-hour prompt cache #5262
The Account Pooler forgets which account a session used after 30 idle minutes (AFFINITY_IDLE_TTL_MS = 30 * 60 * 1_000, plugins/account-pool/src/hub.ts:57). Since #5130, pooled Claude Code threads use the 1-hour prompt cache. A prompt cache belongs to one account, so a thread that pauses for 30 to 60 minutes can be routed to another account and must write its whole context again, although its cache on the first account is still alive.
Why it matters
Orchestrating threads often wait 30 to 60 minutes on a child thread, a CI run or a person, and they carry large contexts. On one host with the pooler on (bb 0.45.0, so still before #5130), we measured 619 pauses of 5 to 60 minutes across Claude threads in two days; the median request was about 225,000 prompt tokens. With the 1-hour cache in place, every pause in the 30 to 60 minute range that lands on a different account still costs one full context write.
Expected
A session stays on its account for at least as long as its prompt cache can live (60 minutes for the 1-hour cache, plus a margin), unless that account is exhausted or removed.
Suggested change
Raise AFFINITY_IDLE_TTL_MS above the cache lifetime (for example 65 or 70 minutes), or derive it from the cache lifetime the pooled thread uses.
Notes
We have not measured this after Restore the 1-hour prompt cache for pooled Claude Code threads #5130, because the installed stable release does not contain that fix yet and we keep the pooler off until it does. The reasoning follows from Anthropic's caching rules (caches are isolated per organization; a read refreshes the lifetime).
Root cause: The 30-minute idle affinity TTL expires live and persisted session pins before the enabled one-hour Claude cache interval; a moved pool cursor can then select another account.
Verification: Four routing regressions fail on trusted main in two clean checkouts and pass after the fix. All 353 Account Pooler tests, typecheck, lint, formatting, and diff checks pass. Live cache billing was not measured.
Activity
bb-slop-cop commentedon Oct 9, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotproviders,provider-claude-code,confirmed-repro.Keep pooled affinity through the extended cache interval (get-bb#5265)