pub(crate) fn shell_status(
state: &AppState,
req: CommandShellStatusData,
) -> Result<ShellStatusResult, String>Expand description
shellstatus → query a shell’s current running state. Used by
useShellNodeStream to resolve the TRUE status of a shell whose
shell_node_create event is being replayed on pane mount/reconnect
(persist:64 ring), instead of assuming “running” — the frontend can’t
otherwise tell a live spawn apart from a replay of an already-long-
exited shell, which was flashing stale rows in the Activity Dock.
See docs/retro/retro-activity-dock-stale-shell-flash-on-load-2026-08-22.md.
Reports known: false (rather than collapsing into running: false,
like the MCP-facing HTTP route does) when no registry entry exists yet
— the shell may simply not have finished spawning/registering (see
get_status_if_known’s doc comment for the exact race this closes:
reagent P1 on PR #2770, a genuinely live shell misreported as already
exited). The frontend treats known: false as “don’t correct.”