[Bug]: Claude thread stays logged out after re-login until its CLI process is reaped
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Use a thread on the Claude provider until the Claude OAuth session expires. The turn ends with
Failed to authenticate: OAuth session expired and could not be refreshed. - In a terminal, run
claudeand/login(orclaude auth login) and complete the login. - Return to the same T3 thread and send another message.
Expected behavior
The thread picks up the refreshed credentials and the turn runs.
Actual behavior
Every message in that thread replies Not logged in · Please run /login, even though the login already succeeded. A new thread works immediately. The broken thread only recovers after the idle-session reaper kills its CLI process (up to 30 minutes plus the 5 minute sweep) or after the user stops the thread.
Cause: T3 keeps one long-lived Claude CLI process per thread, and the CLI loads OAuth credentials once at startup. Once the credentials it holds expire, the process reports authentication_failed on every turn. T3 does not treat that as a reason to end the session, so the same process keeps being reused.
Impact
Major degradation or frequent failure
Version or commit
main @ 4e89d74
Environment
macOS 26.6.0 (Darwin 25.6.0) arm64, Claude provider on claude.ai OAuth
Logs or stack traces
{"type":"assistant","error":"authentication_failed", ...} # content: "Not logged in · Please run /login"
{"type":"result","subtype":"success","is_error":true, ...}
Screenshots, recordings, or supporting files
Workaround
Stop the thread, or start a new thread, after logging in again.
Related: #7878 (how the failure is rendered), #6022 (one cause of the expiry).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/server and trace how the long-lived Claude CLI process handles the authentication_failed result and how the idle-session reaper manages it. Verify the behavior using the reproduction steps: after re-login, the existing thread should stop reusing the process with expired credentials and a subsequent turn should run without waiting for the reaper.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100