You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Stalled-turn sweep interrupts Claude turns after macOS sleep (counts sleep time as silence) #40762
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
A Claude turn is running (waiting on the API stream after a tool result).
The MacBook goes to Clamshell Sleep on battery. caffeinate and the app's own NoIdleSleep assertion do not prevent it.
During a short DarkWake (5–10 s) the server sweep runs ClaudeAdapterV2.failStalledTurn -> ClaudeAdapterV2.interruptTurn and sends query.interrupt.
Expected behavior
Stall detection uses monotonic time that excludes system sleep (or resets the stall timer on wake), and gives the stream a grace period after wake before declaring it stalled.
If a turn is ended this way, label it as a stall/sleep timeout, not as a user interrupt, and offer to resume.
Actual behavior
The SDK records "[Request interrupted by user]", the run ends as failed ("Claude sent nothing for 10 minutes"), and the next user message gets "No response requested.".
Impact
Major degradation or frequent failure
Version or commit
T3 Code desktop 0.1.11
Environment
macOS, Claude Agent provider
Logs or stack traces
Evidence (one night, UTC):
Last provider event 22:34:45, laptop asleep, DarkWake at 22:55:45, failStalledTurn + interruptTurn at 22:55:45.871, outgoing query.interrupt at 22:55:46.234.
The same pattern hit two more threads at 00:15:01 and 00:44:34, each exactly at a DarkWake.
The machine was never fully awake between 22:24 and 08:38, so the 10-minute silence was almost entirely sleep time.
Workaround
Long waits run on an always-on machine instead of the laptop.
Activity