Skip to content

Account Pooler: 30-minute session pin is shorter than the 1-hour prompt cache #5262

Closed

Description

@amrtawfik160

Summary

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

Activity

  1. added theissue type on Oct 9, 2026
  2. added
    providers
    provider-claude-code
    confirmed-repro
    on Oct 9, 2026
  3. bb-slop-cop commented on Oct 9, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    AGENT GENERATED

  4. self-assigned this
    on Oct 14, 2026
  5. removed their assignment
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions