Conversation
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This production fix changes startup recovery ordering and delegated-task orchestration across multiple shared runtime components. It also gates child-result publication and parent wake processing on restart-continuation state, creating a broader runtime impact than a small self-contained bug fix. You can add or adjust custom eligibility rules. Learn more. |
juliusmarminge
force-pushed
the
t3code/codex-turn-mapping
branch
from
September 24, 2026 04:06
1bd44f2 to
3b9c885
Compare
saphid
force-pushed
the
fix/v2-subagent-recovery-reports
branch
from
September 24, 2026 12:18
a01bf92 to
1dbbc7e
Compare
juliusmarminge
force-pushed
the
t3code/codex-turn-mapping
branch
3 times, most recently
from
September 25, 2026 05:55
fe4f6ad to
87c67bd
Compare
saphid
force-pushed
the
fix/v2-subagent-recovery-reports
branch
from
September 25, 2026 07:33
1dbbc7e to
e500a63
Compare
4 tasks
When the server restarts, startup recovery cancels the runs of delegated children that were still working, and any parent completion wake that was running. Those cancellations use runtime-reconcile commands, which the live terminal-run reactor ignores, and the orchestrator recovered child results and completion wakes while it was constructed, before startup recovery ran. So a parent only learned that its child had stopped at the next server start, which could be hours later. Move both recovery passes to run once startup recovery has finished, and publish results through the existing completion delivery. A child with a restart continuation still pending is left to that continuation: if the continuation starts a run, the continued run reports as usual; if it is skipped or fails for good, the cancelled result is published then. Recovering after startup recovery also means a child with a pending continuation is never reported cancelled first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
saphid
force-pushed
the
fix/v2-subagent-recovery-reports
branch
from
September 27, 2026 23:28
b00b3de to
526194f
Compare
4 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
When the server restarts, a parent now hears about delegated tasks the restart stopped as soon as the server is back up, not at the next restart.
On startup, runtime recovery cancels the runs of delegated children that were still working, and any parent completion wake that was running. Those cancellations use
runtime-reconcilecommands, which the live terminal-run reactor deliberately ignores. The orchestrator did recover unreported child results and interrupted completion wakes, but it did so while being constructed, before runtime recovery ran. Anything recovery cancelled was left until the following server start.This change moves both recovery passes, child results and completion wakes, into one
recoverDelegatedTaskReportsstep. It runs once, in the startuprecoverphase, right after runtime recovery and before the effect worker starts. Results go through the existing completion delivery.Restart continuation ("continue threads after update") is respected:
continueRestartedRunnow returns whether it dispatched a run.Why
In our database, 11 delegated children were cancelled across two parents at 23:42 UTC. Their parents only received the results at 03:47, when the server next started. That's four hours in which each parent assumed its children were still working.
This is one of a few focused fixes to make sure a parent learns when a child stops. #13938 fixed results that were never delivered, and #13343 covers children blocked on a question or approval.
Tests
DelegatedCompletionDelivery.test.ts, "recovers a child that runtime recovery cancelled, deferring pending continuations": nothing is reported before the pass runs; a child with a pending continuation is skipped; otherwise its result is published once, and a second pass publishes nothing. If the deferral is removed, the test fails.DelegatedCompletionDelivery.test.ts, "re-offers a parent wake that startup recovery cancelled with a sibling": a running wake and a running sibling are both cancelled by recovery. The pass publishes the sibling's result and reserves one follow-up delivery carrying both tasks. If the wake pass is dropped, the test fails.RestartContinuation.test.ts, "reconciles a delegated child when its restart continuation will not run": nothing happens when the continuation starts or will retry; the result is published when it is skipped or fails for good.serverRuntimeStartup,ProviderRuntimeRecoveryService(and its regression file),RestartContinuation,EffectWorker,DelegatedCompletionDelivery,AgentAwarenessRelay,ThreadManagementService,OrchestratorMcpToolkit.integration,SteeringCompletion.integration,ThreadDeletion, andruntimeLayer. The latest recovery-error fix passesvp test run apps/server/src/orchestration-v2/ProviderRuntimeRecoveryService.test.ts apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts(19 tests) andpnpm run typecheckinapps/server.Limits:
Checklist
This change was made by Claude Opus 5.5 with Claude Code and reviewed by GPT-6 Astra with Codex.
🤖 Generated with Claude Code