[Bug]: Delegated Codex child completes, but its subagent node stays Running and the parent is never woken #17512
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#
A Claude parent starts a Codex child with delegate_task (async). The child finishes normally: its run and its provider turn are completed and its final answer is visible in the child thread. But the app-owned subagent node for that task stays running forever. The parent's Lineage card shows the child as Running with the timer still counting, the parent is never woken with the result, and the card can't be stopped. The only way out is to tell the parent by hand that the child is done so it reads the child thread.
This has happened 3–4 times for me. It's different from #15888: there the child run itself never reaches completed. Here the child run and turn do reach completed; only the subagent node and the completion delivery are lost.
Environment#
- T3 Code (Nightly)
0.0.46-nightly.20261009.2861, macOS 27.0, local server - Parent: Claude (
claude-opus-5-5) - Child:
delegate_taskasync →codex/gpt-6.1-sol,reasoningEffort: ultra,serviceTier: priority, full-access
Steps to reproduce#
No reliable single-run repro. In a long Claude thread that delegates many Codex reviews:
- The parent calls
delegate_task(async) with a Codex target and ends its turn to wait. - The Codex child works for ~5 min and finishes with a final assistant message.
- About 1 in 30 times, the child stays Running in the parent and the parent is never woken.
Expected behavior#
When the child run completes, the subagent node becomes completed, task_status returns the result, and the parent gets a completion wake, as for the other children.
Actual behavior#
Live case from today (still stuck while writing this). Times in UTC:
| What | Value |
|---|---|
| Child thread | thread:delegated-task:command%3Amcp%3A0a10d597-…%3Adelegate-task%3Asources-stage3a-code-r1 |
Child run ordinal:1 | completed, requested 13:49:00.312, completed 13:54:01.723 |
| Child provider turn | completed, 13:49:01.109 → 13:54:01.000 |
orchestration_v2_projection_subagents row for this node | origin=app_owned, status=running, completed_at=NULL, updated_at=13:49:00.307 (never updated after creation) |
| Parent | 81332a00-…, owning run ordinal:30 (13:40:41 → 13:53:08) |
| Parent UI at 14:18 | card "Running 28m 58s"; parent's last message: "waiting for the two Codex reviews — notifications will arrive on their own" |
The server trace for the child shows the final EventSink.write / EventSink.writeIfRunCurrent at 13:54:01 and 13:54:14, all Success, with no error after that. The only failures for this child are two ProjectionStoreThreadNotFoundError at creation (13:49:00), but the same error also appears for children that completed normally (…sources-stage2-3a-code-r2), so it's probably unrelated.
In the same thread, every other delegated child's node got completed_at within milliseconds of a new parent run starting (the completion wake). For example, …sources-stage2-3a-code-r2 completed at 14:18:08.631, and parent run ordinal:38 was requested at 14:18:08.701. For stage3a-code-r1 there is no such pair.
Across my whole statev2.sqlite: 67 app-owned Codex children. 64 have node completed + run completed, 1 is interrupted/interrupted, and 2 have node running while the child run is completed:
- the case above;
…delegate-task%3Akdl-docs-stage2-review-r1(parentmcp:d69ea091-…, owner runordinal:46): child run completed12:29:31.409, node stillrunning.
One thing I noticed: when stage3a-code-r1 was launched, the parent had overlapping runs. The owning run 30 was still open, run 31 was being cancelled (finished 13:49:04.990), and run 32 was running. The second case didn't have that overlap, so I'm not sure it matters.
Nothing in the UI recovers this. Stop doesn't clear the card, and the parent keeps waiting until I message it.
Workaround#
Send the parent a message saying the child finished, so it reads the child thread with t3_thread_read.
juliusmarminge added labelsbug
juliusmarminge added labelsvia-triage
Another case on the same nightly (
0.0.46-nightly.20261009.2861), this time with a Claude child. It includes the data asked for aboveSetup#
- A Claude parent runs
delegate_task(async) to a Claude child - The child starts native background work and ends its turn
- A background-task notification queues a wake run 25 ms before run 1 is recorded complete
- The wake run finishes in about 0.15 s with no reply
- The parent then calls
task_cancel
Expected#
The Lineage row shows the child as finished, and Stop is not offered
Actual#
- The header reads "Lineage · 4 running" and counts this child
- Its timer counts from the task's original start (1.3h and rising)
- Stop subagent does nothing
Timeline (UTC)#
Time Event 16:05:05.954 Run 2 (wake) requested 16:05:05.979 Run 1 completed 16:05:09.090 Run 2 completed 16:05:20 First task_cancelreturnscancel_requestedwith no run active. It recordsrun_interrupt_requeston the already completed run 216:22 task_statusreturns the values below16:22 Second task_cancelreturnscompleted.t3_thread_interruptreturnsno_active_runThe child thread itself reports
completedwith no active runtask_statusat 16:22#status: completed workState: result_available hasPendingChildRuns: false resultContextTransferId: nullHow it fits the lead above#
- At run 1's end, run 2 was already queued, so finalize skipped
- At run 2's end, finalize skipped again. The task was still waiting on background work, inferred from step 3
- The first
task_cancelreturnedcancel_requestedwith no active run, which only happens inwaiting_for_children - The cancel cleared that work but produced no new terminal
run.updated, so finalize never re-ran - The app-owned row stayed
running. The Lineage edge falls back to that row when the child has no live run, so the count, the timer and the Stop button all follow it
Also observed#
- Settling the child thread does not clear the row. It still showed Running 1h 31m about 12 minutes after settling, while the server still reported the thread as
completedand settled
Not tried#
- Whether a server restart's recovery pass settles it
- A Claude parent runs
Another Claude-child case on
0.0.46-nightly.20261012.3010(commitd83929a, macOS), with no nested subagents, no wake runs and notask_cancel.Time (UTC) Event 12:15:25 delegate_task(async) creates the child; the parent's task node isrunning12:19:14 A Bash call hits Claude's 120 s tool timeout and is moved to the background; the child's provider thread gets pendingBackgroundTasks: [{kind: "command", taskId: "b5cfwvnoz"}]12:20:18 Child run 1 completedwith its final answer; the provider thread goesidlewith the command task still inpendingBackgroundTasks12:23:35 The child's claudeprocess is terminated externally (SIGTERM from my own cleanup script; the task notification reportskilled); a provider-thread update clearspendingBackgroundTasksto[]; no newrun.updatedThe parent's task node still has only its creation-time
subagent.updated(running, 12:15:25), and no completion wake was delivered. The child thread has noorchestration_v2_projection_subagentsrows.Across my database (1,274 app-owned children), 8 children, all Claude, ended a run with a non-empty
pendingBackgroundTasks. The other 7 each had a later run and arecompleted. This child is the only one whose list emptied without another run, and the only one stillrunning.This fits the
waiting_for_childrenlead: the pending command made finalize skip at run end, and clearing it later without a new run did not trigger finalize again.Not checked: whether a restart settles it (the startup
subagent-resultsrecovery query, run read-only against the live database, selects this child and no other);task_status(not called: it writes an acknowledgment for the task); server warnings (the traces had already rotated).Another occurrence on Windows 11, this time with a Codex parent and a Claude Opus 5.5 app-owned delegated child.
The user asked me to check for an existing PR/report after waiting roughly 40 minutes for work that completed in about six minutes. This looks like the completed-child / waiting_for_children symptom in this issue. I have not established the underlying cause.
Observed timeline on 2026-10-15, UTC:
- Child requested: 13:52:13.532Z.
- Child started: 13:52:15.447Z.
- Child completed: 13:58:35.679Z. Its final response includes the completed design, checks, browser evidence, and a runnable link.
- Parent remained idle until the user manually asked about progress around 14:32Z. No completion notification reached this parent conversation in between.
Repeated task_status reads after completion return:
{ "status": "running", "workState": "waiting_for_children", "hasPendingChildRuns": false, "latestTerminalStatus": "completed", "latestTerminalSummary": null, "summary": null, "resultContextTransferId": null }At the same time, t3_thread_read on the child returns:
{ "status": "completed", "activeRunId": null, "pendingRequestCount": 0, "runCount": 1 }Reading the entire child activity timeline found no items with running, waiting, or pending status. The child did start a long-running local static preview server, and reported it was still serving after its final response. I have not inspected provider-thread pendingBackgroundTasks or the durable subagent rows, so an outstanding provider-native command is a possible lead, not a verified diagnosis.
Parent provider/model: codex / gpt-6.1-sol. Child: claudeAgent / claude-opus-5-5, async delegate_task, full-access. No follow-up was sent into the child and no task_cancel was used in this occurrence.
The executable reports FileVersion 0.0.46-nightly.20261007.2787, but I have not verified that it identifies the currently loaded server bundle, so treat the exact runtime build as unverified.
I found open PR #15201, but the earlier triage here explains that it may not add the missing live re-check of finalizeAppOwnedSubagent. PR #19750 concerns restart-cut background work; I have not established a restart in this occurrence. No fix or successful automatic recovery is claimed. Reading the child thread manually recovered the result.
Reported by GPT-6.1-Sol through the Codex harness in T3 Code, on the user's behalf.
Deterministic repro of the
task_cancelpath on0.0.46-nightly.20261013.3053(macOS 27.0, Claude Code 2.1.301, local server). Claude parent, Claude child, no nested subagents. Same mechanism as the two Claude-child comments above: the child's background roster is emptied without a newrun.updated, sofinalizeAppOwnedSubagentnever runs again.Steps#
- From a Claude parent thread,
delegate_task(async) to aclaudeAgentchild (I usedclaude-haiku-5-5) with: "Call Bash once withrun_in_background: trueand the commandsleep 900. Don't wait for it. Replystartedand end your turn." - When child run 1 completes,
task_statusreturnsrunning/waiting_for_children. That part is correct, since thesleepis alive. - Call
task_cancelon the task.
Observed (UTC, 2026-10-17)#
Time Event 00:44:16.206 task_startedforbz3555jpu(local_bash);background_tasks_changedlists it00:44:17.029 Child run 1 completed00:44:23.886 task_cancelreturnscancel_requested00:44:23.921 T3 sends query.closeto the child's Claude session. Notask_notificationforbz3555jpuarrives after this, and thesleepprocess is gone00:44:25.922 Child provider thread updates to idlewithpendingBackgroundTasks: []. No run 2, norun.updatedAfterward:
- The parent's
orchestration_v2_projection_subagentsrow staysrunning,completed_atNULL,resultNULL,completionDelivery.state: "disposed". task_statuscomputescompleted/result_available(summarystarted), but the durable row does not change, including after that read.- The parent composer shows "Waiting on subagent ..." with Stop, and the thread stays in the Waiting state.
Control: same setup, no
task_cancel#Same steps 1 and 2, but I killed the
sleepshell externally while the child's session was still open. Claude Code senttask_notification(failed, exit 144), T3 queued wake run 2 (00:31:49.759 to 00:31:56.976), and the task settled tocompletedwithin seconds. The live path works because the notification produces a run, and that run'srun.updatedtriggers finalize. Whentask_cancelcloses the session first, the notification never arrives, the roster is cleared by the session teardown, and nothing triggers finalize.Side effect seen in the control: the task summary became the wake turn's reply instead of run 1's answer, which matches the summary behavior described in #16739.
First occurrence#
Hit this in a real run before the probe. An Opus 5.5 child ran two
until grep -q real <file>; do sleep 2; donewait loops (the file held zshtimeoutput, which never containsreal). Both hit the 600 s Bash timeout and were moved to the background. The child then finished its report (run 1completedat 00:04:19Z). The parent calledtask_cancelat 00:08:34Z, Claude Code killed both tasks at 00:08:36Z (their output files end in[killed]), the provider thread went topendingBackgroundTasks: []at 00:08:36.268Z, and the task row has stayedrunningsince.Still on main#
On
bf990c6,finalizeAppOwnedSubagentis only called fromhandleTerminalRunon terminalrun.updatedevents (Orchestrator.ts#L11172-L11175) and from the restart recovery paths (L11209-L11222, L11330-L11337). Aprovider-thread.updatedthat emptiespendingBackgroundTaskson a child whose runs are all terminal has no trigger. Re-runningfinalizeAppOwnedSubagentfor the child at that point (or whentask_cancel's stop finishes on a child with no active run) would cover this case, the external-kill case above, and the wake-run case above.Restart recovery: not tested yet. Run read-only against the live database, the "latest unheld run is terminal and no
subagent_resulttransfer" branch of the startupsubagent-resultsquery selects exactly the two stuck children and no others. ThedelegatedTaskIdbranch selects neither, since neither original run hasdelegatedTaskIdset. I'll add the result after restarting.- From a Claude parent thread,
Another occurrence on macOS with a Pi parent and a Claude Sonnet 5.5 child, followed by later recovery. The initial API mismatch matches this issue, but I have not established the cause.
Environment#
- T3 Code Nightly app bundle version:
0.1.1-nightly.20261017.3272, read from the running app'sInfo.plist. I did not independently verify the loaded server commit. - macOS
26.6.2, build25G83. - Parent provider/model:
pi/cliproxy-codex/gpt-6.1-sol. - App-owned child provider/model:
claudeAgent/claude-sonnet-5-5, asyncdelegate_task, full-access. - The child performed a design task with source-code inspection and external design-tool calls. Its final answer was present in the child thread.
Observed timeline#
All timestamps below are UTC on 2026-10-17.
Event Time Child requested 20:57:19.983ZChild started 20:57:20.011ZChild run completed 21:02:41.355ZNo completion notification reached the parent conversation before the user asked whether the task was stuck. The parent then inspected the task and child directly.
The initial
task_statusresponse after completion was:{ "status": "running", "workState": "waiting_for_children", "hasPendingChildRuns": false, "latestTerminalStatus": "completed", "latestTerminalSummary": null, "summary": null, "resultContextTransferId": null, "hasPendingQuestion": false }At the same time,
t3_thread_readon the child reported:{ "status": "completed", "activeRunId": null, "pendingRequestCount": 0, "runCount": 1 }Reading the child timeline recovered its complete final assistant answer. We did not need to rerun the work.
Later recovery#
While preparing this comment, a later
task_statusread returnedcompleted/result_available, with the final summary populated andhasPendingChildRuns: false. A child read at about21:18:47Zstill showedrunCount: 1, no active run, and the original completion timestamp above.The parent agent did not call
task_cancel, send a follow-up into the child, or restart T3/the server between these checks. It did read the child's final answer manually and run a separate research child. That separate child delivered its completion notification normally. I do not know which event, if any, caused the original task to recover. This report therefore does not establish that the mismatch persists indefinitely.Related visible symptom and limits#
The user also supplied a screenshot of a composer banner still showing
Running: sed -n ... | rg -n ...with a Stop button. This may relate to #18188, but I have not established that it shares the task-delivery cause. I have not rechecked the banner after the later API recovery.I have not inspected the child's provider-thread
pendingBackgroundTasks, durable subagent rows, or server warnings, so I cannot confirm the background-work/finalization lead discussed above. No deterministic reproduction or fix is claimed.Posted by the Pi coding assistant on the user's behalf, with permission. Private thread/task IDs and local paths are omitted.
- T3 Code Nightly app bundle version:
Another occurrence, with a Claude parent and a Claude Opus 5.5 child, on
0.1.1-nightly.20261017.3238(Linux x64, local server). It cleared when the server restarted on the next nightly.The child ran three native Claude
Agenthelpers in the background, which may match the background-roster comment above. I haven't confirmed that's the cause.Timeline, UTC:
Time Event 10-17 07:14:46 The parent calls delegate_task(async) toclaudeAgent/claude-opus-5-5.07:16–07:23 The child's three Agenthelpers run and complete.07:34:19 The child's fourth and last run completes. The child thread is completed,activeRunIdis null and nothing is pending.07:38:18 task_statusfrom the parent returnsstatus: "running",workState: "waiting_for_children",hasPendingChildRuns: false.07:38:41 The parent calls task_cancel. It returns{"status":"cancel_requested"}and never settles.10-18 09:42:20 The row becomes completed, one second before the server restarts on0.1.1-nightly.20261018.3302.The
orchestration_v2_projection_subagentsrow while it was stuck:status running completed_at NULL provider_thread_id NULL updated_at 2026-10-17T07:38:41.982Z payload.completionDelivery {"state":"disposed","observedByRunId":null} payload.completionWake "always" payload.result nullTwo details that may help:
- It's the only one of the 11 subagent rows on this parent whose
provider_thread_idstayed NULL. task_cancelsetcompletionDeliverytodisposedbut leftstatusatrunning, so the composer kept showing "Waiting on subagent …" until the restart.
- It's the only one of the 11 subagent rows on this parent whose
Additional evidence for the late nested-completion path suggested above, this time with a delegated Codex review whose native reviewers finish normally.
Environment: T3 Code Nightly desktop on macOS arm64, local server
0.0.46-nightly.20261015.3171, commit26fffe5aee22ea9bdd39c5b4c400f643c560b4a0. Chain: Claude Opus 5.5 root → delegated Claude Opus 5.5 supervisor → delegated Codex GPT-6-Astra review → two native Codex reviewers.Stored event order, UTC on 2026-10-17:
Sequence Time Event 226676 13:43:16.552 Delegated Codex review run becomes completed226682 13:43:17.959 Its last native reviewer is still recorded as running226689 13:43:17.998 Native reviewer becomes completed, about 1.4 seconds after the enclosing run226836 13:46:06.625 Claude supervisor's final run becomes completedAt inspection more than two hours later, both native reviewers were completed, but the app-owned review task and supervisor task were still
running, with null result/completion time and nosubagent_resulttransfer. The desktop showed the review's final answer while the root still showed "Waiting on subagent".Reconstructed the projections at these event boundaries and executed the release's unchanged
delegatedTaskProgressand its two helper function bodies, with TypeScript annotations stripped and ISO timestamps adapted to epoch conversion:review_at_run_completion: waiting_for_children review_after_last_native_completion: result_available supervisor_at_final_run_completion: waiting_for_childrenThis supports the missed re-finalization hypothesis: the finalizer skips the task while its native child is active; the live subscription handles only terminal
run.updated, so the latersubagent.updateddoes not trigger another check. No later run update occurred in the review thread. Its stale task then blocked completion one level higher as well.The distinguishing evidence is successful native Codex completion arriving after its enclosing run, rather than a cancelled background shell. The live handler was not instrumented, so its exact execution time is unverified. This is an observed-event replay, not a fresh minimal live reproduction. Recovery was not attempted during this investigation.
Investigated and posted by GPT-6 through the Codex agent, via
t3 triage, with the user's approval.Note
🤖 Claude Opus 5.5 responding on behalf of beastyrabbit
Another occurrence on the v0.1.0 release (Linux x64, local server).
Setup: a Claude Opus 5.5 parent calls
delegate_task(async) to acodex/gpt-6.1-solchild. The child starts two native Codex subagents of its own.What happened:
- The child run reached
completed, and its final answer was visible in the child thread. - The last native subagent posted its final message about 74 seconds after that.
- The parent never got a completion wake. Its item for the task stayed
running, and no new parent run started for more than 40 minutes. - In the same parent thread, an earlier delegated round with no nested subagents woke the parent within a second.
This fits the path described in the triage above. On v0.1.0, finalization sees
waiting_for_childrenwhen the child run ends, and the later completion of the native subagent doesn't trigger another check.As far as I can tell from the code, current
main(2532e64) still has no trigger when a nested subagent finishes late. totalolage/t3code#81 adds exactly that: it re-runs finalization on a settledsubagent.updatedand onprovider-thread.updatedonce background work clears. #20274 retries failed terminal deliveries, but it doesn't cover this case.- The child run reached
Two more occurrences on
0.1.1-nightly.20261020.3411(Linux x64, local server, started 2026-10-20 20:59:18Z). Claude parent (Sonnet 5.5, a scheduled-task run), asyncdelegate_tasktocodex/gpt-6-astra(reasoningEffort: high,role: review, full-access). I readstatev2.sqliteread-only after the fact, and the data matches the late nested-completion lead in the first triage comment.Case Child run completedChild's own native Codex subagent completedParent task node A, clientRequestIdreview-nextx-platform-494-ff4b84ba-gate-r2-codex23:17:42.618Z 23:18:43Z (+61 s) running,completionDelivery=null,updated_at= creation (23:13:49.553Z)B, a review started 20:58:03Z 21:00:47.176Z 21:00:52Z(+5 s) running, same shapeDetails for A:
- The parent run ended 2 s after
delegate_taskreturned (23:13:49.531call,23:13:51.554run completed). The tool result saidstatus: running,hasPendingChildRuns: false. - The parent's
delegatedCompletionis empty and there is nosubagent_resultcontext transfer, onlysubagent_spawn. The parent never got a wake or a second run, and the UI row said "Running" for 45+ min. - The child provider thread is
idlewithpendingBackgroundTasks: [], and its onlysubagentrow (origin=provider_native) iscompleted, so everything is settled now. Finalize ran once at the child's run completion and found a nested item still open. boot-service.loghas noFailed to react to V2 run updatewarning, so this path is silent. Norestart-continuationeffect existed for the child run.- Across this DB since 2026-10-20: about 226 app-owned tasks completed and delivered normally. These two are the only stuck ones whose child run is terminal. The other three
runningrows had non-terminal child runs when I looked.
So this is the same mechanism as the
waiting_for_childrenanalysis above, not a new bug. I'm adding it for the Codex-child plus Claude-parent plus scheduled-task-parent combination on a build from after 2026-10-19, which suggests the late-nested-completion fix (totalolage/t3code#81, which the previous comment says is not onmain) hasn't landed in nightly3411. Restarting the server would run the startuprecoverDelegatedTaskspass, but I haven't tried it because other threads are active.Log and DB excerpt (UTC)
parent provider log (claudeAgent) 23:13:49.531 assistant tool_use mcp__t3-code__delegate_task {mode:async, role:review, clientRequestId:review-nextx-platform-494-ff4b84ba-gate-r2-codex, target:{providerInstanceId:codex, model:gpt-6-astra}} 23:13:49.647 tool_result {status:running, workState:working, hasPendingChildRuns:false, latestTerminalRunId:null} 23:13:51.373 assistant "launched the review ... ending the turn now" (end_turn) 23:13:51.554 parent run completed 23:43:51.566 query.close (idle); no parent events in between boot-service.log 23:13-23:20: no line mentions the child thread or clientRequestId. Unrelated WARNs in the window: 23:16:47.667-.452 x4 Orchestration effect execution failed (provider-turn.start of a different child, CodexAppServerProcessExitedError: Codex App Server process exited with code 0) 23:17:41.901 idle-unload-failed (another codex child, same CodexAppServerProcessExitedError) statev2.sqlite child thread: thread:delegated-task:command%3Amcp%3Abbbc1554-4588-4c6b-9063-df04676a4946%3Adelegate-task%3Areview-nextx-platform-494-ff4b84ba-gate-r2-codex child run ordinal:1: completed, started 23:13:49.815, completed 23:17:42.618 child native subagent row: started 23:16:32, completed 23:18:43 parent subagent row: status=running completionWake=always completionDelivery=null effect outbox for child: provider-turn.start succeeded, checkpoint.capture succeeded 23:17:42.613- The parent run ended 2 s after
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Thanks for the detailed report and the database counts. I read the code on
main(ec80933). I didn't reproduce this, so treat the following as a likely lead rather than a diagnosis.How the row should move to
completedorchestration_v2_projection_subagentsrow is an upsert keyed onsubagent_id(the parent's task node), driven bysubagent.updatedon the parent thread: ProjectionStore.ts#L2030-L2096.finalizeAppOwnedSubagent, which runs from the terminalrun.updatedlistener on the child thread: Orchestrator.ts#L10630-L10697. It writes the terminalsubagent.updated, the result transfer, and the wake together: Orchestrator.ts#L9766-L9871.Where it can return without writing anything
finalizeAppOwnedSubagenthas several earlyreturns before that write: Orchestrator.ts#L9586-L9665. Your row (updated_atequal to creation time, nocompleted_at) fits one of them firing. The most plausible one seems to be L9600-L9601: it only proceeds whendelegatedTaskProgressreportsresult_available. That function reportswaiting_for_childrenif the child thread has any subagent row still active, a child task whose completion delivery ispending/claimed, or a provider thread withpendingBackgroundTasks: subagentProjection.ts#L237-L256. On acompletedrun, leftover run-owned subagents are not cascaded to a terminal status (the cascade covers onlyinterrupted/failed/cancelled): RunExecutionService.ts#L162-L165.If that check is what fired, nothing re-runs finalize later while the server stays up. The listener reacts only to terminal
run.updatedevents, so a nested item that settles a few seconds after the run (your trace shows a write at13:54:14, after the run completed at13:54:01) does not trigger it again. The catch-up passrecoverDelegatedTasksruns only at startup: Orchestrator.ts#L10704-L10731, ProjectionStore.ts#L3569-L3593. Any error inside finalize is also only logged as a warning ("Failed to react to terminal V2 run"), with no retry.The overlapping parent runs probably don't explain the stuck row. Finalize looks up the parent run by
task.runIdand writes the terminal status whatever that run's state is. The parent run's state only affects whether a wake is offered: Orchestrator.ts#L9403-L9436.Why Stop doesn't clear it: stopping the parent run marks the task's
completionDeliveryasdisposedbut copies itsstatusunchanged: Orchestrator.ts#L2115-L2139. The child has no live run left to interrupt, so no new terminalrun.updatedarrives to re-run finalize.Related: #15888 (there the Grok child run itself stays non-terminal), #16355 and #17154 (nested subagents left
running, task stuck inwaiting_for_children), which may share this root cause if the Codex child had a nested item open. Open PR #15201 changestask_statusreads, startup recovery, and pending-background-work derivation. From its diff it doesn't seem to add a live re-check offinalizeAppOwnedSubagent, so it may not cover this case on its own.Useful next data, if you still have the stuck case:
task_statusreturns for that task, in particularworkState.orchestration_v2_projection_subagentsrows stillrunning, andpendingBackgroundTaskson its provider thread. What wrote the13:54:14event?Failed to react to terminal V2 runwarning around13:54:01.