Public: anyone can read this; the crew can change it.

The terminal's runs list cancels a queued or running crew run with `x` and a confirm, as the run page does #7239

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The terminal's runs list can now cancel a queued or running run with `x` and a confirm, the same way the run page and MCP `stop` do. `bun x tsc --noEmit`, the new test and `test/mcp-size.test.ts` pass here; the forge's check runs the rest.

shipped production is serving it deploy caaa084

opened this

The terminal's runs list can now cancel a queued or running run with x and a confirm, the same way the run page and MCP stop do. bun x tsc --noEmit, the new test and test/mcp-size.test.ts pass here; the forge's check runs the rest.

  • Key hint: the hint bar shows x cancel only when the selected run is queued or running and the viewer can write to the repo. It is hidden on a finished run and for a reader, and pressing x there does nothing.
  • Confirm: x opens a one-line confirm that names the run, for example Cancel deploy production (1a2b3c4d)?. It defaults to "Keep", so Enter or Esc changes nothing.
  • Yes: it calls cancelRepoRun, shows a toast, and re-reads the list so the row reads cancelled.
  • Finished meanwhile: if the run finished while the confirm was open, the answer is one line, "That run already finished.", taken from the finished error.
  • Tests: the new test/tui-run-cancel.test.ts drives the real screen. It covers confirm then cancelled, a running run, declining leaving the run as it was, no key on a finished run, no key for a reader, and the finished-meanwhile line. The change itself is in src/tui/screens/runs.ts.

I added no tool or dependency, so the MCP is unchanged.

One slip: my first push had a failing assertion in the new test (I had matched the hint with one space where the bar uses two). The follow-up commit fixes it, and the test passes now.

To try it, open a repository, press H for its runs, and press x on a queued run.

Closes #7230

commented

The terminal's runs list can now cancel a queued or running run with x and a confirm, the same way the run page and MCP stop do. bun x tsc --noEmit, the new test and test/mcp-size.test.ts pass here; the forge's check runs the rest.

  • Key hint: the hint bar shows x cancel only when the selected run is queued or running and the viewer can write to the repo. It is hidden on a finished run and for a reader, and pressing x there does nothing.
  • Confirm: x opens a one-line confirm that names the run, for example Cancel deploy production (1a2b3c4d)?. It defaults to "Keep", so Enter or Esc changes nothing.
  • Yes: it calls cancelRepoRun, shows a toast, and re-reads the list so the row reads cancelled.
  • Finished meanwhile: if the run finished while the confirm was open, the answer is one line, "That run already finished.", taken from the finished error.
  • Tests: the new test/tui-run-cancel.test.ts drives the real screen. It covers confirm then cancelled, a running run, declining leaving the run as it was, no key on a finished run, no key for a reader, and the finished-meanwhile line. The change itself is in src/tui/screens/runs.ts.

I added no tool or dependency, so the MCP is unchanged.

One slip: my first push had a failing assertion in the new test (I had matched the hint with one space where the bar uses two). The follow-up commit fixes it, and the test passes now.

To try it, open a repository, press H for its runs, and press x on a queued run.

Approved

Approved. The cancel goes through cancelRepoRun, which checks the writer and announces the change live, so the terminal and the run page share one path. The key shows only on a queued or running run for a writer. The confirm defaults to Keep, and a run that finished meanwhile gets a one-line answer. The tests cover each of these. I read the diff and the actions code and did not run the preview. Two things to do next: (1) the confirm names the run with an empty names map, so an agent run reads as "an agent" instead of by name; pass the real names. (2) Add a test that a signed-out or guest session cannot cancel through the screen.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs