Repository navigation
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
Summary
#20014 is back through a path its fix didn't cover. #20025 stopped delegated-task finalization from writing a stale parent run, but only for local tasks. dispatchRemoteDelegatedTaskComplete still writes the full parent-run snapshot it read earlier. A task delegated to a linked environment that finishes during the parent's checkpoint capture can therefore return the parent to waiting for good. Its own completion notice and every later message then queue behind that run.
Steps to reproduce
This depends on timing. I hit it once in normal use and haven't reproduced it deterministically.
- On a local Claude thread, use
delegate_taskwithtarget.environmentIdset to a linked environment. A child that finishes quickly helps. - End the parent turn so that checkpoint capture starts.
- Have the remote child's completion arrive during capture. The race window is between
dispatchRemoteDelegatedTaskCompletereading the parent run and its events being written, with the capture commit landing in between.
The regression test from #20025 forces this ordering for local tasks, and the same technique should work with delegated_task.remote.complete.
Expected behavior
The parent run stays completed with its completedAt and checkpointId, and the completion notice starts as a new run.
Actual behavior
The parent run stays waiting with completedAt: null and checkpointId: null, although its provider turn is completed and its capture succeeded. Nothing moves it out of that state, so all queued runs stay blocked. In my case that lasted from 01:36 UTC until I stopped waiting about 40 minutes later, and the run is still stuck.
Timeline for the affected run, all times UTC on 2026-11-03:
| Time | Event | Source |
|---|---|---|
| 01:36:05.430 | Provider turn completes | provider_turns |
| 01:36:05.748 | checkpoint.capture effect created |
outbox |
| 01:36:05.802 | Checkpoint captured_at |
checkpoints |
| 01:36:06.917 | Remote child's task completes | subagents |
| 01:36:07.400 | checkpoint.capture effect succeeded |
outbox |
| 01:36:09.533 | Completion notice queued as the next run, delegatedCompletion.generation: 1, parent = stuck run |
messages |
State afterwards:
- The stuck run has
status: waiting,completedAt: null,checkpointId: null. The two runs before it on the same thread arecompletedwith both fields set. - The cohort's
nextGenerationis 2, so the remote completion did take aplanDelegatedCompletionDeliverybranch that returns{...input.parentRun, delegatedCompletion}. - There are no open nodes, runtime requests or provider turns for the run, and
pendingBackgroundTasksis empty.
What this doesn't prove: this install's event log has been compacted and the server trace for 01:36 has rotated out, so I can't show the run.updated order directly. The stale write is inferred from the state and timing above, plus the code below.
Recovery attempts on the stuck run all failed:
- Stop, pressed 8 times:
thread.stopsucceeds, but the run stayswaiting. run.interrupt:Run … is not interruptible.This is thewaitingcase in [BUG] V2 waiting run keeps showing Agent is working and offers Stop for finished work when checkpoint capture stalls #15124.- Promote queued message to steer:
Target run … is waiting and cannot be steered. t3_thread_sendwithsteerorrestart:has no running turn that can be steered/restarted.
Cause
Line numbers are from main at e1e520c93c99, and the same logic is in the v0.1.6 server bundle.
Orchestrator.ts:12613: the local path writes with{ updateDelegatedCompletionOnly: true }, which is the fix(server): delegated completions preserve finished parent runs #20025 fix.Orchestrator.ts:8292-8301: the remote path emitsrun.updatedwithpayload: plan.parentRun, a full row built from the projection it read at the start of the dispatch.Orchestrator.ts:13348-13350: thedelegated_task.remote.completecase doesn't setupdateDelegatedCompletionOnlyRunId, which thedelegated_task.completion-delivery.*cases do.ProjectionStore.ts:723:preserveRunRecordedFieldsdoesn't protectstatus,completedAtorcheckpointId.
A likely fix is to return the parent run id from dispatchRemoteDelegatedTaskComplete and set updateDelegatedCompletionOnlyRunId from it, as the completion-delivery commands do.
Impact
Major degradation. The thread can't take any input, and I found no way to clear it from the UI or MCP tools. A comment on #20014 reports that a server restart recovers this state; I haven't tried that here yet.
Version or commit
v0.1.6
Environment
Windows 11 desktop app. Parent on the Claude provider (claude-opus-5-5). Remote child on a linked Linux environment running v0.1.6, using the Kimi CLI ACP provider, reached through T3 Connect.
Related
- Delegated-task completion overwrites a just-completed parent run back to waiting, deadlocking the thread behind its own completion notice #20014 / fix(server): delegated completions preserve finished parent runs #20025: the same deadlock on the local path, and its fix.
- [BUG] V2 waiting run keeps showing Agent is working and offers Stop for finished work when checkpoint capture stalls #15124: Stop can't end a
waitingrun. This issue is about how the run gets stuck, not about recovering it.
Activity
a2lxyz commentedon Nov 13, 2026
Hit this on 0.1.9 (Linux server, Claude provider), matching the description exactly: a task delegated with
delegate_taskto a linked environment finished about 1 s after the parent's turn ended.What the projection showed (statev2, read-only):
status: "waiting",completedAt: null,checkpointId: null. Its attempt iscompleted, there are no pending runtime requests, anddelegatedCompletion: { disposition: "open", delivery: { generation: 1, messageId: …, taskIds: [<remote task>] } }.queuedbehind the parent, with every later message queued after it.startNextQueuedRunreturns early becauseisActiveRun$1countswaitingas active, so nothing ever starts.Every way out is refused:
run.interruptfails withRun … is not interruptible.The thread'sactiveProviderThreadId/ the run'sproviderThreadIdis anative-thread:pending%3Arun%3A…%3Aordinal%3A1placeholder that isn't inprojection.providerThreads, so theproviderThread === void 0guard throws. That seems to make interrupt fail for this thread in general, not only for the wedged run (cf. [Bug]: Stop can't end background work after a run fails before its provider starts ("Run … is not interruptible") #15472).promote_to_steerandreorderrefuse automatic completion deliveries ("cannot be promoted to Steer", "cannot be reordered").Workaround that worked without losing messages:
queueHeld: true; runs cut on other threads resume.The cost is that the restart cuts every other in-flight turn on that server. A narrower recovery (e.g. treating a
waitingrun whose attempt is completed and whose only open delivery is queued behind it as completed) would avoid that. We're running a detector for this condition until a release with the fix lands; happy to test a nightly.andrewgeorgemitchell commentedon Nov 19, 2026
Hit this on 0.1.10 (macOS desktop app, stable channel), on the same path. A Claude parent (
claude-opus-5-5) useddelegate_taskwith a target on a linked Linux environment (Codex child) and ended its turn. The remote result landed inside the parent's checkpoint capture. The thread has been wedged for over 85 minutes, with 29 runs queued behind it.This may help with the repro that stopped #29882 ("could not show the problem on the base commit"): the capture here was slow. It took 12.5 s, against about 1 s for the same thread's two previous captures, and the remote result was applied 0.34 s before the capture committed. In the original report the capture took 1.65 s. With a fresh data directory and a small worktree, the capture probably finishes before a real remote round trip can land inside it. A large worktree, or anything else that slows
checkpoint.capture, should make the race much easier to hit.Timeline, UTC on 2026-11-19, read-only from statev2:
delegate_taskreturns, remote childrunningcheckpoint.captureeffect createdcaptured_at, statusready; root nodecompletedcompletedcheckpoint.captureeffectsucceededrun_interrupt_requestitem recorded, run unchangeddelegated-tasks.stopeffects: onesucceededafter 4 attempts, onefailedafter 5 (OrchestrationEffectExecutionErrorwith an empty message)State afterwards:
status: "waiting",completedAt: nullandcheckpointId: null, although its checkpoint row exists and every node of the run iscompleted.delegatedCompletionis{ disposition: "stopped", nextGeneration: 2, delivery: null }. This is after the Stop.completed, withcompletion_delivery_state: disposed.waitingrun on the server. The thread has 29 queued runs, none of them held. There are no pending requests and no background tasks.This has the same limits as the original report. The v2 event log is compacted (
orchestration_v2_eventsis empty), and the server trace rotated out within about 20 minutes, so I can't show therun.updatedorder directly. Against the v0.1.10 tag, thedelegated_task.remote.completecase (Orchestrator.ts:15309) still sets noupdateDelegatedCompletionOnlyRunId, so #29882 still applies.Filed by Claude Code (
claude-opus-5-5), following.github/triage/PLAYBOOK.md.jndegens commentedon Nov 19, 2026
Hit this on 0.1.9 (Linux server, Claude provider), same path: the parent used
delegate_taskwith a target on a linked macOS environment. The remote child failed on a usage limit, a retry child completed about 1.5 h later, and the parent run has beenwaitingsince 2026-11-17 14:23 UTC (about 54 h). Two completion notices plus two later messages were queued behind it.Things that did not unwedge it, in case it helps whoever picks up #29882:
t3_thread_interruptwith therunId→Run … is not interruptible.(dispatchRunInterruptfinds no running provider turn for awaitingrun).t3_thread_interruptwithstop: true→no_active_run, but the queue does become held (queueHeld: true), so the run stayswaitingand the queue is now paused too.queued-run.startis refused for the completion notice because its message carriesdelegatedCompletion, andstartNextQueuedRunbails while any run iswaiting(isActiveRun$1).What worked: a graceful server restart (SIGTERM).
ProviderRuntimeRecoveryService.reconcileProjectioncancelled thewaitingrun ("server shut down before the provider work completed"). The remaining queued runs were stillqueueHeld: truefrom the earlier Stop, so they need Resume in the UI afterwards. Without the Stop attempt first, a restart alone is probably enough.TheOriginalOcyrus commentedon Nov 22, 2026
Also hit on 0.1.11 (macOS,
t3 serveas a launchd daemon, Claude parent onclaude-opus-5-5). One variation: nodelegate_taskcall in that turn started the remote child. The parent sentt3_thread_sendto an existing delegated thread on a linked environment, and T3 tracked it as aremote-followuptask under the parent's run.Timeline, UTC on 2026-11-22, from the thread's items and the provider event log:
result,end_turn)query.close)After that the run stayed
waitingwithcompletedAt: null. It had no open nodes and no runtime requests,pendingBackgroundTaskswas empty, anddelegatedCompletion.nextGenerationwas 2. 50 runs queued behind it for 2 h 37 min.Two things not yet in this thread:
delegated_task.remote.stopfor about 7 of the parent's other delegated tasks on the linked environment, so live children there were cut off.waitingrun, as described above. The queue stayed idle, since Stop andt3_thread_interruptwithstop: truehad held it. A singlet3_thread_sendwithmode: "auto"started a run, and the queued runs drained after it with no Resume.Still unfixed in 0.1.11; #29882 would fix it.