Skip to content

fix(server): reopen delegated tasks for child follow-ups - #14030

Closed
Yash-Singh1 wants to merge 2 commits into
t3code/codex-turn-mappingfrom
yash/reopen-delegated-subagent-status
Closed

Yash-Singh1 wants to merge 2 commits into
t3code/codex-turn-mappingfrom
yash/reopen-delegated-subagent-status

Conversation

@Yash-Singh1

@Yash-Singh1 Yash-Singh1 commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

What Changed

Delegated task status now returns to running when 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 completed after 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

  • This PR is small and focused
  • I explained what changed and why

Closes #13490

…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>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 8ecdf69 · Source CI: success

Scenario and decoded snapshot size

10 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.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants