feat(delegation): live orchestration of running subagents via delegate_task action param - #85232
Merged
Merged
Conversation
…e_task action param delegate_task gains a control plane: action='list' / 'steer' / 'stop' let the parent agent see, redirect, and early-stop its own running subagents mid-flight — the model-facing counterpart of the TUI's delegation.pause / subagent.interrupt / subagent.steer RPCs. - action='list': live children of this conversation's spawn tree (ids, goal, status, running_seconds, accepting_steer, live transcript path). Ownership is enforced via a _delegate_parent_ref weakref chain stamped at child build time, so a conversation can only control its own descendants, never a sibling tree. - action='steer': queues text into a running child via the existing steer_subagent() registry path (delivered at the child's next tool boundary; missed steers surface as missed_steer in the completion). - action='stop': interrupt_subagent() — child stops at its next iteration boundary, partial result still re-enters as a completion. - Spawn dispatch response now includes subagent_ids + control hint. - Control actions run synchronously (never backgrounded) and bypass the spawn pause gate and depth limit; they also never consume the per-turn subagent spawn cap, and remain usable once the cap is hit (that is when stop matters most). - Small-model robustness (found live with gpt-5.4-mini on Nous Portal): tasks=[] alongside goal no longer trips the "Batch mode requires at least 2 tasks" gate — treated as single-goal. - CLI display: control calls render as "steer sa-…" / "list" instead of an empty goal. Live-tested E2E on Nous Portal (fable-5 + gpt-5.4-mini): full spawn→list→steer→stop cycle, plus a steer-efficacy run where the child acked the steer mid-essay and switched topics before finishing.
Contributor
૮ >ﻌ< ა ci reviewran on 5c705ae — feat(delegation): live orchestration of running subagents vi
|
This was referenced Aug 13, 2026
teknium1
added a commit
that referenced
this pull request
Aug 13, 2026
… live orchestration Companion docs for #85232 — adds the model-facing control section (list/steer/stop, ownership scoping, spawn-cap exemption) above the existing TUI/gateway subagent.steer RPC docs.
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.
Summary
delegate_taskcan now orchestrate its own running subagents live:action='list'shows this conversation's children,action='steer'redirects one mid-run without stopping it, andaction='stop'ends one early — the model-facing counterpart of the TUI's kill/steer RPCs, in the same tool with zero new tools added.Changes
tools/delegate_tool.py:action/subagent_id/messageparams +_handle_control_action()(synchronous, never backgrounded); ownership enforced by a_delegate_parent_refweakref chain so a conversation can only control its own spawn tree; spawn dispatch response now returnssubagent_ids+ control hint;tasks=[]alongsidegoalno longer trips the "Batch mode requires at least 2 tasks" gate (live small-model failure)run_agent.py:_dispatch_delegate_taskforwards the control params (single choke point for all invocation paths)agent/tool_guardrails.py: control actions never consume the per-turn subagent spawn cap and stay usable once the cap is hit — that's whenstopmatters mostagent/tool_executor.py,agent/display.py: control calls render assteer sa-…/listinstead of an empty goaltests/tools/test_delegate_control_actions.py: 20 tests — ownership chain, per-action success/refusal shapes, guardrail exemption, entrypoint routing, empty-tasks coercionValidation
STEER-ACKmid-essay and switched topics (12 desert-plant → 4 penguin paragraphs), completed normallytasks:[placeholder]batches / "no action parameter"; after: clean spawn→list→steer→stop run quoting every status fieldSteering rides the existing
steer_subagent()registry path (delivered at the child's next tool boundary; missed steers surface asmissed_steerin the completion entry). Stop ridesinterrupt_subagent()— the child halts at its next iteration boundary and its partial result still re-enters as a normal completion message. Live transcripts undercache/delegation/live/remain the observation channel; this PR adds the actuation half.Infographic