Repository navigation
fix(server): reopen delegated tasks for child follow-ups - #14030
Yash-Singh1 wants to merge 2 commits into
Conversation
…n follow-ups A delegated task's row went terminal when its child's first run finished and never came back. Follow-up runs on the same child left the row stale (the lineage badge undercounted running children), and their results were never finalized because any earlier subagent_result transfer blocked it. - A child run that is queued, starting, or running (not a monitor run) reopens the parent's terminal task row, node, and turn item. This uses the existing ordered run.updated consumer under the parent lock. - Finalize is keyed on the child run: it skips only when that run's result was already transferred. If the task was reopened by work that ended without a new result, it closes again without a transfer or wake. - When publishing a follow-up result, a delivery that already settled for the earlier result is cleared so the new result is delivered. A pending or claimed delivery is kept, so both results share one wake. - Startup recovery also picks up terminal tasks whose child has live work, and open tasks whose child finished, instead of keying on "no transfer exists". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This server-side change updates delegated-task state transitions, result delivery, event ordering, and startup recovery across several production orchestration paths. Although the intent is focused and the behavior is extensively tested, the state-machine and delivery changes have enough runtime blast radius to warrant human review. You can add or adjust custom eligibility rules. Learn more. |
…yash/reopen-delegated-subagent-status # Conflicts: # apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts
|
Note This comment is posted by Julius' dot Closing under prior approval. The maintainer ruling on #13490 identifies follow-up wakes as a change to the published-result contract. This PR enables those wakes and replaces the published task summary, but no direction-and-scope approval is linked. Please agree on whether follow-ups should wake the parent and whether the original summary should stay stable, then link that approval for reconsideration. |
What Changed
Delegated task status now returns to
runningwhen its child starts follow-up work. When that run finishes, T3 updates the task with the latest result and delivers it to the parent. A follow-up cancelled before it starts leaves the previous result intact.Why
A delegated task stayed
completedafter its child began working on new input. This change keeps the parent task status in sync with the child and allows each finished follow-up result to reach the parent once.Checklist
Closes #13490