[Bug]: Claude runtime stream failed when closing T3Code
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Create a new thread using Claude Code
- No errors on any request
- Close using Cmd+Q T3Code MacOS app
- Reopen T3Code
- Thread previously created show an unexpected error "Claude runtime stream failed"
Expected behavior
No error should be displayed like before quitting app
Actual behavior
Impact
Major degradation or frequent failure
Version or commit
No response
Environment
macOS 26.5.2
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
this pull request https://github.com/pingdotgg/t3code/pull/5142 should fix it
[!NOTE] 🤖 Claude Fable 5.1 responding on behalf of Nick
Same failure on Linux, triggered by the nightly auto-update relaunch rather than a manual quit. Adding the event sequence since the original report has no logs.
Environment: CachyOS (Linux 7.2.5), T3 Code desktop 0.0.41-nightly.20260913.1658 auto-updating to 0.0.41-nightly.20260914.1700, 2.1.270 (Claude Code), Fable 5.1 thread, full-access runtime.
Sequence (UTC, from the thread's provider event log and the system journal):
10:39:53.899 turn.completed (end_turn) # last foreground turn, session idle from here
10:44:40.648 Claude CLI SessionEnd hook fires # subprocess exiting; T3 has not issued stopSession
10:44:40.850 runtime.error "Claude runtime stream failed." failureTags=["ProviderAdapterProcessError"]
10:44:40.850 claude/result status=failed # synthesized, no active turn
10:44:40.851 session.exited reason="Session stopped" exitKind="graceful"
10:44:42 new T3 server process starts (updated AppImage)
10:50:34 next user message: session.started with resume, turn runs normally
The updater's quit path SIGTERMs the Claude subprocess before the adapter's own stop runs, so the SDK stream rejects and the adapter reports it as a stream failure with no turn in flight. The thread is fine afterwards; the only effect is the error toast on reopen.
Two details that may help triage:
- The
runtime.errorpayload keeps onlyfailureCountandfailureTags; the SDK's underlying process error text is dropped, so the "terminated by signal" message that #5142 matches on never reaches the logs. #9698 notes the same loss for a different trigger and is probably the same mapping. - The stop is recorded as
exitKind: "graceful"immediately after the error, which is a cheap signal to suppress the toast when the app is shutting down.
#5142 looks like the right fix and applies cleanly to this path.