Skip to content

[bug] The running-agents chip is a one-click "stop all agents" button and also the hover target for inspecting them — no confirm, no undo #5990

Open

Description

@2solarmax

Where did this happen?

Desktop app (macOS)

Version

1.17.0

What happened?

The running-agents chip on a workspace row (agent avatar + count) is two things at once:

  • a HoverCardTrigger — hovering it for 150ms opens the card that lists each running agent, which is how you check what a workspace is doing; and
  • a <button> whose entire onClick is handleStopAll() — kills every agent in that workspace, immediately, with no confirmation and no undo.

So "let me see what's running here" and "kill everything running here" are the same 18px target, separated only by whether your finger comes down.

The only visible difference between the safe state and the destructive one is a cross-fade of the count into a 10px ×, which appears only while hovering:

// DashboardSidebarAgentsChip.tsx:99-107
<span className="grid shrink-0 items-center …">
  <span className="transition-opacity group-hover/chip:opacity-0">{agents.length}</span>
  <LuX className="size-2.5 opacity-0 transition-opacity group-hover/chip:opacity-100" … />
</span>

At text-[9px] in an h-[18px] chip, that is not a legible destructive affordance. The aria-label is honest — "${agents.length} running agents — stop all" — but nothing on screen is.

The hover card has the same problem at the other end: Stop all agents is the row immediately below the last agent, separated by a Separator className="my-1" (4px). Overshooting the agent list by one row kills everything.

What "stop" actually costs

useDashboardSidebarAgentKill.killAgents() calls terminal.killSession per agent. Server side (packages/host-service/src/trpc/router/terminal/terminal.ts:243-283) that is disposeSessionAndWait(...) + markTerminalExited(...) — the terminal session is disposed, not backgrounded. The agent process is gone, its scrollback is gone, and there is no "resume that session" anywhere in the app. Whatever a Claude Code session was 40 minutes into is not coming back.

The success path is a toast.success("Stopped 3 agents"). No confirm before, no undo after.

This one plus #5989 are why I've moved my daily terminal off Superset for the moment — two adjacent hover targets on the same sidebar row, both irreversible, both firing on a single unconfirmed click. Writing them up rather than just leaving, because the rest of the app is genuinely good.

Steps to reproduce

  1. Have a workspace with 2+ agents running.
  2. Move the pointer toward the agents chip on that workspace's sidebar row — the natural thing to do, since hovering it is how you see what is running.
  3. Click.
  4. Every agent in the workspace is killed. One toast. No way back.

Variant: hover the chip, let the card open, move down the agent list past the last row, click. Same outcome.

Logs, screenshots, or recordings

Agents hover card

The chip is the ✳ × at the left, mid-cross-fade — that × is the entire warning that clicking it kills all three sessions. Workspace names are redacted.

Suggested fixes

  1. Make the chip non-destructive. Click should open the card (or focus the agent); stopping should live only inside the card, per-agent plus an explicit all. A hover-to-inspect target and a kill-everything target should not be the same element. This is the important one.
  2. If click-to-stop stays, confirm it — at minimum when agents.length > 1. An undo toast is the nicer pattern and is already used in this codebase, but a disposed PTY can't be undone, so a confirm is the honest control here.
  3. Separate Stop all agents in the card from the agent list by more than 4px, style it as destructive (red), and confirm it.
  4. Make the × state legible if it stays: it currently renders at size-2.5 inside a 9px chip, hover-only, in muted foreground.

Related: the − "Remove from sidebar" button on the same row is separately destructive — filed as #5989.

Happy to send a PR for (1) + (3) if that's useful.

Activity

  1. 2solarmax commented on Jul 27, 2026

    @2solarmax
    Author

    Additional evidence: the app already has the exact guard this chip skips.

    Closing a single terminal pane, or closing a tab, goes through confirmCloseTerminals(...), which:

    • probes terminal.hasRunningProcess for each terminal about to close (probeTerminalRunning),
    • skips terminals with hasTerminalBackgroundIntent(...) (deliberately backgrounded ones),
    • and if anything is still running, shows a destructive alert(...) with a Cancel and a "Don't ask again" checkbox, persisted as terminal-close-confirm-v1.

    The comment on the helper says it is "used by both single-pane close and tab close so the guard can't be bypassed by the tab-close gesture."

    So closing one pane running an agent asks for confirmation. Clicking the agents chip kills all of them — killAgents → terminal.killSession per id — and never touches confirmCloseTerminals or hasRunningProcess at all. The larger-blast-radius gesture is the unguarded one, and it's also the smaller click target.

    That seems more likely to be an oversight than a decision, and it makes the fix cheap: route handleStopAll (and the Stop all agents row) through the same confirmCloseTerminals path that pane and tab close already use. The dialog, the running-process probe, and the "Don't ask again" escape hatch all exist already.

    Verified against the shipped 1.17.0 app.asar.

  2. Cal-Morris commented on Jul 28, 2026

    @Cal-Morris

    Agreed on this, the previous behaviour was cleaner in my opinion. At present, when I click on the codex icon to select the row, I am now clicking the x buttton which is killing all running processes.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions