Repository navigation
feat(tui): steer running subagents from their view - #14702
intentionally-left-nil merged 14 commits into
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (14 files)
Previous Review Summaries (2 snapshots, latest commit 71c42fb)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 71c42fb)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (10 files)
Fix these issues in Kilo Cloud Previous review (commit 46eff1d)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (8 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
|
This looks good
Suggested improvements:
|
|
Btw, a little gif or screenshots help us usually to reduce review effort for such changes. |
marius-kilocode
left a comment
There was a problem hiding this comment.
We should fix shell and slash command issues before merge
The subagent-view prompt takes the subagent's color, replaces the primary agent/model row with "Steering <agent> · <model>", and uses a "Steer the <agent> subagent..." placeholder, so it no longer looks like the parent's prompt. Also reconcile the steering prompt with Kilo-Org#14701's subagent-view keys: Esc belongs to the footer's subagent interrupt, an open autocomplete list outranks it, and a typed steer keeps ctrl+c (clear) and ctrl+d (delete) instead of arming the double-press exit.
…to allow-subagent-steering-in-tui
| const subagent = useSubagent(() => props.sessionID) | ||
| const steer = createMemo(() => !!subagent()) | ||
| createEffect(() => { | ||
| if (steer() && store.mode === "shell") setStore("mode", "normal") |
There was a problem hiding this comment.
Setting state like this from an effect is a code smell. What is this trying to solve for, and why is this done on every render, as an effect?
There was a problem hiding this comment.
Fair point. It existed for one case: prompt history is shared across sessions, so recalling a !cmd entry with ↑ in a subagent view would put the prompt into shell mode, which subagent views don't support. (In Solid it only reran when steer() or store.mode changed, not on every render, but reacting to state with an effect is the wrong shape.) I'll replace this with with a guard instead at the two history-recall setters, so a recalled shell entry comes back as plain text. The ! key is already off in subagent views, and submit never runs shell from one.
…rl-c-exit' into allow-subagent-steering-in-tui
The subagent-view prompt reset shell mode from a createEffect. The only way into shell mode there is recalling a shared history entry (the `!` key is already off, and each session mounts a fresh prompt), so guard the two history-recall setters directly and drop the effect.
…rl-c-exit' into allow-subagent-steering-in-tui # Conflicts: # packages/tui/test/kilocode/subagent-view.test.tsx
|
P2: Variant/agent controls still work outside slash input. The prompt still advertises ctrl+t variants at -> can you check if ctrl t is really disabled? P2: Removing queued steering leaves a misleading parent notification. The backend posts the INFO notice before the queued steering actually runs, at Is that true? And is this fixed in one of the other PR's? |
…g-in-tui Move this PR's subagent-view key changes into useSubagentKeys() with the rest of the subagent keys: the arrow navigation layer and the exit double-press both yield while a steer is typed.
What
When viewing a running subagent in the TUI, the prompt is now available so the user can steer that subagent directly. The steer goes through the normal session prompt queue, and the parent agent is notified with an
INFOmessage on the shared agent board, sent from the subagent to its parent with the steering text.In a subagent view the prompt makes it clear you are steering the subagent, not talking to the parent: it takes the subagent's color (matching the subagent footer), replaces the primary agent/model row with
Steering <agent> · <model>, and uses aSteer the <agent> subagent...placeholder.Why
Subagent views were read-only, so the only way to redirect a subagent was through the parent agent. Steering the child directly is faster, but the parent must learn about it; otherwise it keeps reasoning from a plan its child no longer follows.
Design notes and constraints
parentID, so "human text on a child session" would post a false notice on every subagent launch andtask_idresume. The TUI marks the typed text part withmetadata.kind = "subagent_steer", and only marked parts produce a notice. Other clients (VS Code, SDK callers) don't notify until they opt in with the same mark./costand/memory) are off in subagent views:!and/are typed as text, the/command list doesn't open, and slash text is sent as a plain steer. This keeps the PR to one tested input path.noReplyearly returns in prompt admission. Its body is excerpted against the board's 4 KiB limit after JSON escaping, and failures are logged without failing the prompt.esc interrupthint stay off there, so there is one hint and one action.Known limitations
Before:
After: