fix(orchestrator): Wake idle parents for each delegated sibling - #9103
fix(orchestrator): Wake idle parents for each delegated sibling#9103mwolson wants to merge 331 commits into
Conversation
…y for resume, wake, and idle release (pingdotgg#3860) Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…ion and subagent resume (pingdotgg#3908)
Co-authored-by: codex <codex@users.noreply.github.com>
Refs CI: https://github.com/pingdotgg/t3code/actions/runs/29750215334/job/88378428015 Co-authored-by: codex <codex@users.noreply.github.com>
Refs CI: https://github.com/pingdotgg/t3code/actions/runs/29750215334/job/88378428137 Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: pingdotgg#2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: pingdotgg#2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: pingdotgg#2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: pingdotgg#2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: pingdotgg#2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: pingdotgg#2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Clears the timed-out turn with an identity guard so a late completion cannot clobber a newer active turn. Addresses pingdotgg#2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Passes the current target thread MCP configuration through ACP load, resume, and fork requests instead of reusing the credentials captured when the provider process opened. Addresses pingdotgg#2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Integrate the current Grok settlement, monitor/subagent lifecycle, interrupt containment, steer visibility, and image support stack into the orchestration-v2 branch. Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Settle root turns from provider signals and preserve post-settle continuations. Track asynchronous subagent and monitor work, allow image prompts, and keep steered messages visible. Separate soft steering from hard Stop while containing and reaping native process trees.
Co-authored-by: codex <codex@users.noreply.github.com>
Reuses the focused compatibility approach from closed PR pingdotgg#3923 and covers the remaining hardware-keyboard reverse iteration. Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
- Pretty-print known T3 MCP tool names in work rows - Show the T3 Code logo for recognized MCP tool entries - Add logic and UI tests for the new tool presentation
- Extract shared T3 MCP tool label resolution - Show T3 Code branding for matched tool activity rows - Add tests for shared resolution and mobile feed output
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Adapt grouped tool summaries and the floating working timer to V2 run, attempt, and queue state. Bring over the composer, keyboard, and disclosure transitions while retaining the V2 activity inspector and queue controls. Keep OV2 web composer and grouping behavior intact; share only the existing command label parser with mobile.
Restores main features dropped by the policy replay: pingdotgg#8569 theme wiring, pingdotgg#8850 composer banner follow-ups, pingdotgg#8855/pingdotgg#8904 composer fixes, pingdotgg#8831 settings search rework, pingdotgg#8803 workspace-mutation refresh (v2-adapted), pingdotgg#8840 circle-alert, pingdotgg#8584 codex artifact templates, pingdotgg#8688/pingdotgg#8807/pingdotgg#8936 video + image previews (web and mobile, v2-adapted), pingdotgg#8862 Expo glass, and the round's docs. Timeline thinking rows (pingdotgg#8984) stay on the v2 work-live system. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The v2 equivalents of main's pingdotgg#8984 and pingdotgg#8922: a "Working for ..." header anchors the active run, the trailing live tool row survives between actions in past tense instead of vanishing, and a shimmering Thinking row marks reasoning gaps. During workspace preparation the header shows "Setting up worktree..." (driven by the local dispatch flag or the v2 run's preparing status, so remote viewers see it too), the composer footer span is gone, and draft promotion waits until the run starts or startup fails instead of navigating mid-preparation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pingdotgg#5311 capped a parent run at two completion wakes, so a later sibling that finished after both wakes settled never prompted the parent. Offer each follow-up as soon as the parent is free. queue_after_active still queues behind a live run. A cancelled wake stays pending for retry instead of immediately reserving another delivery.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This production change alters when delegated task completions trigger additional parent model runs, removing the prior two-wake limit and adding cancellation recovery. Because it changes significant existing-path processing and user-visible orchestration behavior, human review is warranted despite focused test coverage. You can add or adjust custom eligibility rules. Learn more. |
Cancel still leaves claimed tasks pending so Stop does not immediately start another wake. Recovery and wake-policy then reserve a pending-only cohort and offer it, so a last-child cancel does not strand the result.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6e33546. Configure here.
wake-policy rejects an unchanged completionWake, so the previous always dispatch never reached offerDelegatedCompletionDeliveries. Switch always to settled_only after cancel, and format the test file.
b82facd to
2ac9bfe
Compare

What Changed
When several app-owned delegated children finish one after another, an idle parent now gets a wake for each result. A live parent run still queues those wakes, or folds a later sibling into a wake that is already queued, the same way a follow-up message would.
A cancelled wake still leaves its tasks pending, so Stop does not immediately start another wake. Recovery and wake-policy then reserve that pending-only cohort and offer it, so a last-child cancel does not leave the parent silent.
Why
#5311 delegated-completion-delivery capped a parent run at two wakes so a slow third child could finish with no prompt at all. Waiting is not a live turn. An idle parent should keep going, like a queued message that just became ready.
UI Changes
No layout or control changes. The parent timeline can show more than two server wake prompts for one originating run, one per finished sibling after the parent is free. No screenshots; the extra rows are the existing delegated-task wake copy.
Manual check: Pi · orchestration, scenario 2 in the provider live-test guide. On a v2.1 Nightly AppImage, three Pi children produced three wakes. The MID wake started while SLOW was still running, and each wake quoted its child token.
Checklist
Note
Remove two-delivery cap in
DelegatedCompletioncohort and auto-reserve pending deliveriesmakeOrchestratorthat capped settled deliveries at 2, so late-finishing siblings each get their own delegated-completion delivery instead of staying pendingreservePendingDelegatedCompletionDelivery, which collects terminal subagents withcompletionDelivery.state === 'pending', claims them, and arms the parent run with a new delivery generation — called before the offer cycle so newly reserved deliveries are visible in the same passsettledDeliveryCount < 2todeliveryRun.status !== 'cancelled', preventing re-offering of cancelled delivery runsofferDelegatedCompletionDeliveries(thread.id)callMacroscope summarized 4978994.
Note
Medium Risk
Changes core v2 delegated-completion scheduling and parent wake ordering; behavior is heavily tested but affects multi-child delegation and cancel/recovery paths.
Overview
Removes the per–parent-run limit of two delegated-completion wakes so each terminal sibling can eventually get its own follow-up once the parent is idle, instead of staying stuck in
pendingafter the second delivery.Orchestrator drops the
settledDeliveryCount >= 2early exit when planning new deliveries and changes follow-up reservation to require a non-cancelleddelivery run (not a delivery count). It addsreservePendingDelegatedCompletionDelivery, which batches terminal tasks still inpendinginto a new cohort delivery and marks themclaimed, andofferDelegatedCompletionDeliveriesnow reserves pending cohorts before offering. Recovery after terminal delivery runs routes through that unified offer path.Tests extend the MCP late-parent scenario for a third sibling wake (
settledDeliveryCount3, three continuation offers) and add a unit test that a cancelled wake leaves the task pending, then wake-policy / replan restoresclaimeddelivery on the parent.Reviewed by Cursor Bugbot for commit 4978994. Bugbot is set up for automated code reviews on this repo. Configure here.