An exited workspace shell agent has no Restart, and its menu still offers Stop #129
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lz/agent-nexus#129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The workspace shell's ⋯ menu gates its one lifecycle action on the session row existing, not on the agent being up. Nothing deletes that row when claude exits, so a shell whose agent is gone still shows "Stop shell agent" and offers no way to restart it.
A regular session does not have this problem:
sessionAgentItemsoffersRestart agentunconditionally and hidesStop agentwhen the probe says the agent is down.Where it is
nexus/src/lib/menu/target-menu.ts—shellItems:ctx.shellOpencomes frommenuContextFor(nexus/src/lib/menu/menu-actions.ts):…and
workspaceShellOpenis row-existence, nothing more:Why the row survives
SessionEndis a hook that records attention state; it does not delete anything. The row is deleted only bycloseWorkspaceSession. And the tmux window outlives claude regardless — the launch isclaude …; exec bash, so the window stays as a shell. So "the row exists" and "the agent is running" are independent facts, and the menu reads the wrong one.What the operator sees
Not a dead end, but a bad path:
/exit, logout, or a crash).So recovery takes two actions, one of which is a destructive-sounding confirm that misdescribes what is about to happen.
Surfaced by
PR #126 added an
endedmark whose tooltip reads "agent exited — restart it from the ⋯ menu". That is accurate for a session and wrong for the shell, which is what made the gap visible. The wording is not the bug; it is the first thing to point at it.Suggested fix
The input is already computed one line above and then deliberately thrown away.
menuContextForresolvessessionIdfor the shell scope:but then does:
That comment is the reason this was never wired, and it is no longer true — the shell's row should read it. Passing
workspaces.agentRunning(sessionId)for the shell scope too, then givingshellItemsthe same shape assessionAgentItems(Restart always; Stop only when the agent is up), fixes both halves. The comment needs deleting with it, or the next person will re-derive the same conclusion from it.Worth checking while in there: whether
open-shellon a row that already exists but whose agent is dead does the right thing, or whether the row has to be deleted first —openWorkspaceSessionis documented as idempotent, so a Restart may be able to route through it without the Stop.