Skip to content

feat(steer): peer + broadcast session steering (session.steer_peer / steer_broadcast) - #90288

Closed
HermesZum wants to merge 1 commit into
NousResearch:mainfrom
HermesZum:feat/prime-agent-peer-steer
Closed

feat(steer): peer + broadcast session steering (session.steer_peer / steer_broadcast)#90288
HermesZum wants to merge 1 commit into
NousResearch:mainfrom
HermesZum:feat/prime-agent-peer-steer

Conversation

@HermesZum

Copy link
Copy Markdown

Summary

Adds peer-to-peer and broadcast steering between live sessions, on top of Hermes' existing steer_subagent child path and the generic AIAgent.steer (which appends to the last tool result and preserves the message-role invariant). New steer_session (peer) + steer_broadcast (peers + delegated children) in tools/delegate_tool.py, exposed as gateway methods session.steer_peer / session.steer_broadcast. Ports prime-agent's agent_message.send / peer-broadcast messaging by extending existing steering + delegation primitives — no architecture fork, no prompt-cache or message-role invariant break.

Closes #90287.

Changes

  • tools/delegate_tool.py: steer_session (peer, resolver-injected, plugin-safe) + steer_broadcast (fans out to all live peer sessions + active delegated children). Child path reuses the existing steer_subagent unchanged — no new steering race, no new shared state.
  • tui_gateway/methods_session.py: session.steer_peer + session.steer_broadcast gateway methods; authority mirrors subagent steering via the invoking session's exact steer triple.
  • tests/tools/test_subagent_steer_f3.py (new, 8 tests): peer steer, unknown/no-resolver/empty safety, broadcast to peers+children, sender exclusion, no-op.

Design notes

  • Reuses AIAgent.steer for the actual injection — appends to the target's last tool result, so no new user turn is created and the role-alternation invariant holds.
  • Child steering delegates to the existing steer_subagent (same lock + accepting_steer gate), so there is no new race and no behavior change for child steering.
  • Peer resolution is resolver-injected and plugin-safe (no hard-coded core special-casing beyond the thin gateway method).
  • Opt-in / off by default: existing sessions and steering callers are unchanged; only the new gateway methods enable peer/broadcast.

Relationship to existing work (Step-0 duplicate search, see #90287)

Test plan

  • New tests/tools/test_subagent_steer_f3.py: 8 tests (peer steer, unknown/no-resolver/empty safety, broadcast to peers+children, sender exclusion, no-op).
  • Regression: delegation session-lifecycle suite (12) green; delegate_tool.py + methods_session.py py_compile clean.

Invariants preserved

  • Reuses AIAgent.steer → no new user turn, no role-alternation violation.
  • Child path reuses steer_subagent lock + gate → no new race.

Notes / asks

Add peer-to-peer and broadcast steering on top of the existing steer
machinery (prime-agent port). Reuses AIAgent.steer (appends to the
target's last tool result) so the message-role invariant holds — no new
user turn, no role alternation violation.

- tools/delegate_tool.py: steer_session(session_id, text, resolve_agent=...)
  (peer; resolver injected so the module stays free of gateway internals,
  keeping it plugin-safe) and steer_broadcast(text, resolve_agent=...,
  exclude_session_id=...) which fans out to all live peer sessions + active
  delegated children. Child path reuses steer_subagent (unchanged).
- tui_gateway/methods_session.py: session.steer_peer + session.steer_broadcast
  gateway methods; authority mirrors subagent steering via the invoking
  session's exact steer triple.

- tests/tools/test_subagent_steer_f3.py: 8 hermetic tests (peer steer,
  unknown/no-resolver/empty safety, broadcast to peers+children, sender
  exclusion, noop) — all pass.

Regression: 615 delegate/gateway steer tests pass.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) tool/delegate Subagent delegation sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state needs-decision Awaiting maintainer decision before any implementation labels Aug 19, 2026
@HermesZum

Copy link
Copy Markdown
Author

Superseded by #90340 — the complete F3 (user entry point: name=, list_subagents(), steer_subagent_by_name(), delegate_task steer/by-name + steer_peer/broadcast actions, and session.steer_peer/session.steer_broadcast RPCs) on a single branch off current upstream/main. Closing this partial in favor of #90340.

@HermesZum

Copy link
Copy Markdown
Author

Superseded by #90340 (complete F3).

@HermesZum HermesZum closed this Aug 19, 2026
@HermesZum

Copy link
Copy Markdown
Author

Superseded by #90340 — the complete F3 implementation (user entry point: name=, list_subagents(), steer_subagent_by_name(), agent-facing control plane + gateway RPCs) now lives on a single branch off current upstream/main. Closing this partial plumbing PR in favor of #90340.

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

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have 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.

feat(steer): peer + broadcast session steering (session.steer_peer / steer_broadcast)

2 participants