[Bug]: Claude thread stays logged out after re-login until its CLI process is reaped #9607
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).
juliusmarminge closed this
Reopening: this still reproduces on Orchestrator V2 (checked at 48595c787c).
ClaudeAdapterV2 records
authentication_failedonly to word the turn failure (ClaudeAdapterV2.ts#L6808). On the next turn,openQueryreuses the live query whenever the native thread, policy key and model selection match (#L8218-L8231), so the next message goes to the same signed-out CLI process afterclaude auth login. #15915 replaces the process only when the provider instance is rebuilt from Settings, which a terminal re-login does not do.I'm rebuilding #11048 on V2 to fix it.
@juliusmarminge could you reopen this? It still reproduces on Orchestrator V2 (checked at 48595c787c), and I can't reopen it myself.
ClaudeAdapterV2 records
authentication_failedonly to word the turn failure (ClaudeAdapterV2.ts#L6808). On the next turn,openQueryreuses the live query whenever the native thread, policy key and model selection match (#L8218-L8231), so afterclaude auth loginthe next message still goes to the same signed-out CLI process. #15915 replaces the process only when the provider instance is rebuilt from Settings, which a terminal re-login does not do.I'm rebuilding #11048 on V2 to fix it.
Opened #18554 to track this on Orchestrator V2, since this issue is closed but the bug is not fixed.
Sign in to join this conversation.
The fix is at #11048 (rebased replacement for #9468). #10321 improved the error text for this case but leaves the signed-out CLI process running, so the thread still needs a restart until #11048 lands.