Skip to content

feat(steer): cascade steer to active child agents (subagent delegation) - #66548

Closed
trac3r00 wants to merge 2 commits into
NousResearch:mainfrom
trac3r00:feat/steer-cascade-to-subagents
Closed

feat(steer): cascade steer to active child agents (subagent delegation)#66548
trac3r00 wants to merge 2 commits into
NousResearch:mainfrom
trac3r00:feat/steer-cascade-to-subagents

Conversation

@trac3r00

Copy link
Copy Markdown
Contributor

[Bob] Propagate user mid-turn steers to active subagents.

Problem

When a user sends a steer while a subagent is running via delegate_task, the steer only reaches the parent agent. The parent is blocked waiting on the subagent, so the steer doesn't get delivered until after the subagent completes — making it useless for redirecting subagent work.

Solution

Mirror the existing interrupt() cascade pattern: when steer() is called on the parent, iterate _active_children under lock and call child.steer(cleaned) on each. The child's next tool result will include the OOB marker with the user's message.

  • Recursive: grandchildren get it too
  • Fault-tolerant: a broken child doesn't block others
  • Thread-safe: uses existing _active_children_lock

Changes

  • run_agent.py: +11 lines in steer() method
  • tests/run_agent/test_steer.py: +71 lines (4 new tests)

Testing

All 39 steer-related tests pass.

@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/tools Tool registry, model_tools, toolsets tool/delegate Subagent delegation P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 17, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #66046 for live subagent control, but this PR bundles that steer-cascade proposal with a separate CUA action-marker feature. Please split or rebase the independent changes so maintainers can evaluate the delegation behavior separately.

@trac3r00

Copy link
Copy Markdown
Contributor Author

[Bob] Thanks for the review @alt-glitch — good call. I'll split out the CUA action-marker changes into a separate PR and rebase this one to focus solely on the steer-cascade delegation behavior. Will update shortly.

trac3r00 added 2 commits July 17, 2026 20:34
Verifies across CLI and gateway/TUI frontends:
  (1) One-shot dispatch sets pending seed, MoA provider swap, disable flag
  (2) Normal mode leaves all MoA state untouched
  (3) Invalid inputs (bare, whitespace) show usage with no side effects
  (4) Restore path clears all MoA continuation state after one-shot

Documents that CLI /moa lacks agent-running guard (gateway has one).

Part of: feat/moa-one-shot-routing
When a user sends a mid-turn steer (/steer or busy_input_mode=steer),
the message now propagates to all active child agents via
_active_children, not just the parent agent. This mirrors the existing
interrupt() cascade pattern (line 2686-2692).

Previously, steers only reached the parent agent's _pending_steer slot.
If the parent was blocked waiting on a delegate_task subagent, the steer
would not be delivered until after the subagent completed — making it
effectively useless for redirecting subagent work.

Now child.steer(text) is called for each active child, so the subagent
model sees the user's correction in its next tool result via the OOB
marker. Cascade is recursive (grandchildren get it too) and fault-
tolerant (a broken child doesn't block others).

Tests: 4 new tests in TestSteerCascadeToChildren covering direct
cascade, recursive propagation, broken-child tolerance, and no-children
baseline.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused steer-cascade implementation. The underlying gap is present on current main: run_agent.py:2864-2877 stores /steer only on the parent, while tools/delegate_tool.py:1392-1399 registers live children for the delegation lifetime.

Problems

  • This PR still includes unrelated MoA tests from fa5480a47f08 (tests/cli/test_moa_one_shot_behavior.py and tests/tui_gateway/test_moa_one_shot_behavior.py, 398 lines). The member review requested that independent changes be split; the CUA portion was moved to #66618, but this MoA-only commit remains here.

Suggested changes

  • Move the MoA test commit to the MoA-focused work and retain only the steer cascade and its focused tests (83b084d006d6).

Automated hermes-sweeper review.

@@ -0,0 +1,260 @@
"""Tests for /moa one-shot behavior: dispatch, no-continuation-state, invalid input.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new MoA-only test file is unrelated to the steer cascade. The prior member review requested splitting independent changes; please move this commit's MoA coverage to the MoA-focused work so this PR remains reviewable as the delegation change.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 18, 2026
@teknium1

teknium1 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for this — the gap was real (steer didn't cascade to children the way interrupt does). The steer-delivery slice just landed via #76805, which adds a targeted steer_subagent() registry primitive with delivered/queued receipts; the retained-subagent work now building on top of it (tracker #79686 P1) uses targeted per-child delivery rather than a blanket broadcast to all children, so the cascade approach here is superseded. If a broadcast-fallback mode proves useful once the registry lands, we'll credit this PR for the pattern. Closing — appreciated.

@teknium1 teknium1 closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/tools Tool registry, model_tools, toolsets needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants