Skip to content

[Bug] OAuth access token expiration not propagated to active subagent requests #82217

Description

@simonziegler

Bug Description
I had long running Claude Code CLI sessions running and they all broke overnight. Claude reported this as the issue:

The Claude Code session's own OAuth access token — the credential this CLI uses to talk to the Anthropic API. Nothing to do with the repo: not the Auth0 config in CLAUDE.md, not any key or secret in the tree, not the testsite.

Three distinct failure modes showed up across the subagents:

  1. 401 OAuth access token has expired. Re-authenticate to continue. (with "Please run /login") — this killed five agents simultaneously: popover, dialog, navigation, the Angular column, and side-sheet. The simultaneity is the tell — a single shared credential hit its expiry instant, and every in-flight subagent request failed on the same boundary.
  2. Connection closed mid-response — a different thing entirely, and probably not auth. That hit menu, blazor2, and earlier attempts at dialog and Angular. It reads as a dropped streaming connection rather than a rejected credential.
  3. Agent stalled: no progress for 600s (stream watchdog did not recover) — the first side-sheet attempt. A hung stream that the watchdog couldn't recover.

On why the token expired, I should be honest about the limit of what I know. OAuth access tokens are short-lived by design and the CLI normally refreshes them silently in the background. What I observed is consistent with the refresh not happening — or not propagating to already-running subagents — while several long-lived subagents held open requests across the expiry boundary. But that's inference from the timing and the error text, not something I verified. I have no visibility into the token's lifetime, the refresh mechanism, or whether the main session refreshed successfully while the children did not.

What I can say with confidence: the main session kept working throughout (I carried on committing and running tests), so whatever happened affected the subagents' requests specifically rather than the session credential being permanently dead. That's also why doing the remaining pages directly rather than via subagents has been the more reliable route.

Environment Info

  • Platform: darwin
  • Terminal: WarpTerminal
  • Version: 2.1.220
  • Feedback ID: cc0c7f96-dee4-4f88-a3c7-b86b530b68ce

Errors

[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions