Skip to content

claude login doesn't apply to exiting thread and requires restart  #1654

Open

Description

@ymichael

Repro:

  • hit a Claude rate limit in a thread
  • Claude login in the terminal (different sub, not rate litmiter)
  • observe usage page is updated
  • retries on the thread still hits the rate limit
  • restarting the bb server fixes things

Activity

  1. added theissue type on Aug 17, 2026
  2. added
    providers
    provider-claude-code
    on Aug 18, 2026
  3. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1654.html

    • Verdict: PARTIALLY REPRODUCED · root-cause confidence: medium
    • Root cause (short): bb keeps one long-lived claude CLI process per thread (never recycled after a rate-limit/auth failure), and that process memoizes the OAuth token it loaded at startup, only invalidating it when the mtime of ~/.claude/.credentials.json changes or via a 30 s (stale-on-failure) Keychain cache on macOS; a login the probe cannot see stays pinned until a new process (server restart / thread stop) is spawned.
    • Proposed fix: In plugins/provider-claude-code/src/bridge/bridge.ts, when a turn's SDK result is_error with category rate-limit/unauthorized/billing (error-info.ts), flag the ThreadSession recycle-on-next-input and have getWritableThreadSession treat it like streamEnded: settle, emitSessionReplacement, and start(providerThreadId) a fresh SDK session (existing replaceEndedThreadSession path). The new claude process reads credentials at startup so a login done in between applies on retry; conversation survives via SDK resume; no wire change (no protocol bump). Interim workaround: bb thread stop <id> on the i…
    • Caveats: Revision fixes the verifier's major finding: the repro script now spawns the same binary bb does (PATH claude 2.1.234; REPRO_CLAUDE_BIN=sdk-bundled for the SDK's own 2.1.197) and prints the version; run-default-2.1.234.log and run-preserve-mtime-2.1.234.log were regenerated with the real 2.1.234 (11 calls per 429 turn, verdicts unchanged: plain flow NOT reproduced, preserve-mtime BUG REPRODUCED on…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  4. added
    partial-repro
    on Aug 18, 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

    partial-reproprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions