[Bug]: A failed Claude wake dispatch leaves `requestedContinuations` set, so later wakes are dropped and their output never reaches the thread
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
Reconstructed from one incident on three threads, not reproduced deterministically.
- On a Claude thread, have the agent start a background
Bashcommand and end its turn. - While the thread is idle, make T3's database writes fail. A full disk did this here.
- Let the command finish, so Claude starts a wake turn. Its dispatch fails.
- Free the disk.
- Send a normal message and have the agent start another background command, then end its turn.
- Let that command finish.
Expected behavior
A failed wake dispatch is retried, or at least releases the wake latch. Once writes recover, the next wake opens a run, and the wake turn's output appears in the thread.
Actual behavior
One failed dispatch leaves requestedContinuations set, and every later wake on that CLI process is dropped silently. A user turn doesn't clear it.
The CLI still wakes and keeps working, but T3 has no run for that turn:
- Its messages never reach the thread, including final reports and questions for the user.
- A thread showing Waiting flips to Completed when the job exits, with no new message, while the agent is still working.
- T3 tools fail with
parent_not_active, sot3_background_waitcan't register new jobs and those threads show Completed while a job runs.
This is the "Claude wake latch can still swallow later wakes while the CLI stays alive" part that was left open when #20430 closed. I found no issue tracking it.
Impact
Major degradation or frequent failure
Version or commit
Seen on 0.1.4-preview.20261028.3796. The same code is on main at 79f1fad, and the dispatch-failed handler is unchanged in v0.1.6.
Environment
Windows 11, desktop app, claudeAgent with claude-opus-5-5. The server ran continuously from 2026-10-29 with no restart during the incident.
Logs or stack traces
Timeline on 2026-10-31 (UTC), from provider event logs and statev2.sqlite:
| Time | Event |
|---|---|
| 07:35:29 | Last wake run on any thread before the gap |
| 07:36:32–37 | Background jobs finish on threads A, B and C. No runs are created |
| 07:40:33 | An agent, in a hidden turn, measures 0 MB free on the drive |
| 07:43:36 | First new run of any kind on any thread, an agent-sent message rather than a wake |
| 07:48:48 | First wake run after the gap, on another thread. Other threads keep waking normally from then on |
| 08:56:01 | Thread B: awaited job exits, wake turn runs, its final report is never recorded |
| 12:53:18 | Thread A: same again, after 7 user runs since the latch was set. Run 28 registered the wait at 12:51 |
Across all threads with provider logs for that day:
resultevents outside any T3 run appeared on exactly these three threads: 11 on A, 5 on B and 2 on C.- Those threads had 53 working wake runs before the gap.
t3_background_waitfailed 8 times in the hidden turns, each with{"code":"parent_not_active","message":"The calling provider no longer owns an active thread run."}.
Not confirmed here: the server traces from 07:36 have rotated away, so I don't have the dispatch-failed warning from this machine. The failed dispatch is inferred from the timing and the code. This comment on #20430 shows that warning in the same sequence on another machine, with a disk quota as the trigger.
Code at 79f1fad:
dispatch-failedhandler: onlydelegatedCompletionrequests are retried, so a plain wake is dropped after one warning.shouldOffercheck: a thread already in the set returns with no log.- Claude's offer: passes neither
clearIfCurrentnordispatchIfCurrent, so a failed dispatch can't release the entry. - Continuation attach: the only turn-start path that clears the entry. The user-turn path doesn't.
Possible fix, untested:
- Give Claude's offer a
clearIfCurrent, and call it from thedispatch-failedhandler for plain wakes. - Retry transient failures, as delegated completions already do.
- Log when
shouldOfferis false, since this failure currently leaves no trace.
Screenshots, recordings, or supporting files
None.
Workaround
Send any message in the affected thread after each background job exits. That opens a real run, so the agent's output appears and t3_background_wait works for that turn. Replacing the CLI process, for example by restarting T3, clears the latch but ends running background work.
Related
- #20430: same latch, trigger was a held queued run. Closed with this part left open.
- #22033 and #17885: fix the held-queue trigger, not a failed dispatch.
- #23006:
parent_not_activein notification turns, the same symptom. - #15542: the run-ingestion side of a write failure.
Filed by Opus 5.5.