anomalyco / anomalyco/opencode
tui: prompt and steer selected subagents
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Problem
The V2 TUI can select a child Session, inspect its live activity, cycle between children, and interrupt one child without affecting its siblings. The selected child inspector is read-only, however: the composer remains owned by the parent Session.
This makes the most useful recovery loop impossible when one of several parallel subagents starts going in the wrong direction:
- Inspect the problematic child.
- Interrupt only that child if necessary.
- Send it corrective instructions.
- Let that child resume with its existing context while every sibling continues.
Today the user can perform steps 1 and 2, but not step 3 from the child inspector.
Current V2 surface
The compact TUI already has the right selection boundary:
session.child.firstopens the subagent picker.- Selecting a child opens its read-only inspector.
composer.subagent.interruptinterrupts that selected child Session.Tabcycles through child Sessions.Escreturns to the parent composer.
Selection currently changes only the observed child transcript. It does not retarget prompt submission.
Proposed interaction
When a child is selected, show a composer whose target is explicitly that child Session:
◔ Inspect session execution Explore ctrl+d interrupt 1 of 5
Search "SessionExecution"
Read packages/core/src/session/execution.ts
I’m tracing the ownership path...
┃ Message Explore...
Soft steer
Submitting while the child is running should admit a prompt to the selected child with delivery: "steer".
select child
→ type correction
→ submit
→ correction is promoted at the child’s next safe step boundary
The active provider request or tool is not cancelled. Sibling Sessions are unaffected.
Hard redirect
The existing targeted interrupt remains available:
select child
→ interrupt selected child
→ type correction
→ submit
→ child wakes with the correction and retained history
The interrupt must affect only the selected child. Prompt submission after interruption must target that same child Session, not the parent.
Existing V2 capabilities
This should not require a new child-specific protocol:
- Child agents are real Sessions with stable Session IDs.
POST /api/session/:sessionID/promptalready supports durable admission,delivery: "steer" | "queue", and wake scheduling.POST /api/session/:sessionID/interruptalready targets one Session.- A steer can be admitted while the child is running and promoted at its next safe model-step boundary.
The primary missing piece is TUI target routing and presentation: the selected child must become the composer target while the inspector is open.
Prior art
Claude Code’s in-process teammate view is the closest interaction: selecting a teammate replaces the visible transcript, Esc interrupts only that teammate’s current work, and the normal composer submits into that teammate’s pending-message queue. The teammate resumes with retained history while siblings continue.
Grok Build allows inspecting and individually cancelling a subagent, but its child view is intentionally read-only.
Current Codex V2 allows inspecting and interrupting a parent-owned child thread but disables direct child input; follow-ups are mediated through the parent. Older direct-input-capable Codex threads instead route the composer to the active child thread and use steer-or-start semantics.
Gang grill
Decisions to pressure-test before implementation:
- Should Enter in a running child always mean
steer, or should the normal parent default of queueing active-turn submissions remain consistent? - Is the inspector composer visibly distinct enough to prevent accidentally prompting the child instead of the parent?
- After a targeted interrupt, should the inspector remain open and focused on an empty child composer?
- Should there be an atomic “interrupt and send” operation, or is interrupt-then-submit sufficient? Ordering matters because interruption clears an advisory pending wake unless continuation is requested.
- Can completed and failed children be continued from the same inspector, or only running/interrupted children?
- Should child composer drafts be preserved independently when cycling with
Tabor returning to the parent? - How are child permission and form requests represented while the user is directly viewing that child?
- Does direct human prompting change parent ownership or completion-notification semantics?
- Should the parent agent receive an explicit durable fact that the human redirected its child, or is that derivable from child history?
- Is this interaction intentionally human-only, or should the parent also gain a first-class tool for steer/follow-up against an existing child Session?
Acceptance criteria
- A selected child inspector exposes a composer clearly labeled with the child target.
- Submitting from that composer sends the prompt to the selected child Session ID.
- A running child can receive a soft steer without interrupting its current physical attempt.
- An interrupted, idle, or completed child can be continued with retained history, subject to the decisions above.
- Interrupting or prompting one child does not interrupt, prompt, or otherwise mutate sibling Sessions.
- Returning to the parent restores the parent composer and its draft.
- Cycling between children cannot send a draft to the wrong Session.
- API failures are shown in the child inspector rather than silently dropping the correction.
- Tests cover target routing, soft steer, interrupt-then-prompt, child switching, and sibling isolation.
Related
- #41667 requests direct prompting of child sessions in web/desktop.
- #38966 requests per-subagent steer/cancel/abort across parent tools and TUI.
- #36423 tracks V2 subagent resume and steering compared with V1.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing session.child.first, composer.subagent.interrupt, and child-selection flows, then follow the session prompt and interrupt API routes. Done means the selected child owns the clearly labeled composer, steering and continuation target that child only, parent drafts are restored, failures are visible, and tests cover switching and sibling isolation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100