Expand description
ShellNodeRunner — spawns a shell command and streams output to the
frontend as shell_chunk MPS events scoped to the agent’s block.
Launched by handle_shell_create (server/mod.rs) via tokio::spawn.
The runner is fire-and-forget; the HTTP handler returns the shell_id
to the MCP caller immediately while output streams asynchronously.
Phase 2 of SPEC_PERSISTENT_SHELL_NODE_2026_06_11.md. Uses
tokio::process::Command with captured pipes (no PTY in this phase;
PTY support is a Phase 3 follow-up that requires portable-pty wiring
similar to the existing ShellController).
Structs§
- Shell
Entry 🔒 - Shell
Node Create Event shell_node_create: a Shell command started, so the agent pane adds its row before the first chunk. Scopedblock:<agent block>.- Shell
Node Runner - Shell
Session Registry - Shell
Status Info - Live status of a running (or recently exited) shell. Updated by
ShellNodeRunneras output arrives and on exit. - Shell
Summary - Snapshot of one currently-running shell for the Swarm pane’s per-agent
long-running-process rows. See
ShellSessionRegistry::list_active. Carriesblock_id(unfiltered list — same shape assubagent.ListActive/ActiveSubagent.parent_block_id) so the Swarm pane’sbuildTree()groups by block client-side in one pass, instead of one RPC call per tracked agent block.
Enums§
- Shell
Chunk Event shell_chunk: one line a Shell command wrote, or its exit. Scopedshell:<shell_id>.
Constants§
- MAX_
EXITED_ 🔒STATUS - Per-shell stop handles + status.
ShellStopfires the oneshot;ShellInputsends to the stdin relay;ShellStatusreads the live status arc. Lives inAppState.shell_sessions. Max number of EXITED shell statuses retained for post-exit ShellStatus queries. Running shells are always kept regardless of this cap; only exited entries beyond it are evicted oldest-first. Bounds memory for long-lived sidecars that spawn many short shells.
Functions§
- kill_
tree 🔒 - Kill the entire process tree rooted at
pid.Child::kill/kill_on_droponly reap the wrapper shell (cmd /C/sh -c); atask devspawnstask.exe→cargo/nodegrandchildren that survive otherwise. - publish_
chunk 🔒 - publish_
exit 🔒 - shell_
scopes 🔒