feat(tui): async delegation view — docked agents panel + live steering - #8
Closed
JoaoMarcos44 wants to merge 2 commits into
Closed
JoaoMarcos44 wants to merge 2 commits into
JoaoMarcos44 wants to merge 2 commits into
Conversation
Phase 1 (read-only docked panel): - delegation.async_list RPC projects the async registry to the TUI - $asyncDelegations store + applyAsyncList; 5s gateway tick populates it - agentsPanel.tsx merges live in-turn subagents with background async rows - extract shared STATUS_GLYPH so panel and /agents overlay never diverge - mount above the composer next to LiveTodoPanel; ^a opens the full tree Phase 2 (live steering, @id): - send_to_subagent reuses the child's existing AIAgent.steer() drain, so the steer lands as a fresh out-of-band user turn on the last tool message at the iteration boundary — role alternation and prompt cache stay intact. No new core-loop code. - subagent.send RPC; composer routes "@<id> text" only when the token resolves to a live subagent, so ordinary prompts fall through untouched. Tests: 53 new (backend 15 incl. 50-thread concurrency + role-legality; frontend 38 across merge logic, steer resolution, panel view, store). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Superseded by the upstream PR NousResearch#70899 (opened against NousResearch/hermes-agent so maintainers can review/edit/merge). Consolidating there. |
JoaoMarcos44
pushed a commit
that referenced
this pull request
Aug 18, 2026
docs(relay): explain canonical operation migration
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
Adds an inline, docked agents panel above the composer plus a live steering channel so a running subagent can be redirected by id (
@b7c2 switch approach) without killing it. Watch background delegations next to the conversation; steer one mid-flight.Closes #9.
Motivation
Background delegation and the subagent tree were disconnected: the parked turn was a one-line hint, and the rich tree was a full-screen
/agentsmodal that hid the conversation. There was no way to watch background agents inline, and the only lever on a wrong-headed background fixer wasx(kill). This adds visibility and a steering lever.~80% of the work is reprojection of data that already exists. The one genuinely new capability — inbound steering — reuses the child's existing
AIAgent.steer()drain and iteration-boundary interrupt check, so no new core-loop code is introduced.What changed
Phase 1 — docked read-only panel (low risk)
delegation.async_listRPC: pure read projection of the async-delegation registry (interrupt_fnalready stripped server-side).$asyncDelegationsstore +applyAsyncList; the existing 5s gateway tick populates it alongsidedelegation.status.agentsPanel.tsx: merges live in-turn subagents (turnStore.subagents, freshest tool + elapsed) with background/async rows into one list. Renders nothing when there are no agents.STATUS_GLYPHinto a shared module so the panel and the/agentsoverlay never diverge visually.LiveTodoPanel; header click collapses;^aopens the full tree.Phase 2 — live steering (
@id)send_to_subagentmirrorsinterrupt_subagent: looks the child up in the live registry and callsAIAgent.steer(text). The child drains it at its next iteration boundary and appends it as a delimited out-of-band user turn on the last tool message — never spliced mid-tool — so role alternation and the prompt cache stay intact.subagent.sendRPC.@<id> textto steering only when the token resolves to a live subagent (resolveSteerTargetId), so an ordinary prompt likeemail @john laterfalls through to a normal turn untouched. Feedback toast:delivered → @b7c2/@b7c2 already finished.Design decisions (deliberate scope calls)
send_to_subagent— the live registry carries no session key andinterrupt_subagentis already unguarded (holding the id is authority). Same trust model; a guard would require a new registry field. Noted as follow-up./agentsoverlay; the docked panel delivers the core value — visibility — without that risk.Testing
53 new tests, all green.
tests/test_async_delegation_view.pysend_to_subagent· 50-thread concurrency · role-legality · status transitionsagentRows.test.tssubagentSteer.test.ts@idparsing · id/prefix resolution · ambiguity refusal · normal-text passthroughagentsPanel.test.tsxresult ready ⏎·^a treeclickdelegationStoreAsync.test.tsapplyAsyncListpopulate · null tolerance · replace-not-append · end-to-endRegression: frontend
1385 passed; backend view suite15/15. The pre-existing failures (terminal*/editor/memoryTS suites and 19test_delegate.pycases) were confirmed identical with this branch reverted — a Python 3.14_initializerstdlib incompatibility and unrelated suites, with zero references to the new code in any traceback. Build ✓ · lint ✓ · typecheck (touched files) clean.Files (18 changed · +1101 / −25)
Backend:
tools/delegate_tool.py,tui_gateway/server.pyFrontend:
components/agentsPanel.tsx·lib/agentRows.ts·lib/subagentGlyph.ts·lib/subagentSteer.ts·app/delegationStore.ts·app/turnStore.ts·app/useSubmission.ts·app/createGatewayEventHandler.ts·components/agentsOverlay.tsx·components/appLayout.tsx·gatewayTypes.tsTests: the 5 suites above.
🖼️ Architecture at a glance