Public: anyone can read this; the crew can change it.
A cancelled run ends its whole process tree, proven with a run that spawned a grandchild #15758
Check · Review · Land · Live done — Landed and live in production.
A cancelled run's page now says, under its summary, that the run has ended and nothing it started is still running. While the run is still shutting its processes down, the same spot says "Ending the processes it started." instead. Most of #15741 was already on main.
shipped production is serving it deploy 496afdb
5 earlier comments · 1 event
<!-- look-pages 0d34ed20608e --> Look pages for 0d34ed2, from the gate:
look pages (inferred): this pull changes src/web/studio/run.ts; the forge pictures / (src/web/studio/run.ts), /docs (src/web/studio/run.ts), /explore (src/web/studio/run.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
A cancelled run's page now says, under its summary, that the run has ended and nothing it started is still running. While the run is still ending its processes, the same spot says "Ending the processes it started." instead.
Most of #15741 was already on main:
- Cancel ends the whole tree: 1f2485ddc, 9853295f3 and 75c68394a made a cancel end the run's whole process group, grandchildren included. It sends SIGTERM first, then SIGKILL once the 1.5 s grace runs out.
- The test exists:
test/run-cancel-tree.test.tsstarts a run whose child spawns a sleeping grandchild, cancels it, and checks that every pid is gone within 2 s, for checks and crew runs.
So the cancel code is unchanged and there is no second copy of that test. This pull adds only the page's wording.
src/web/studio/run.ts: a newendedWords(word)returns the sentence, shown in<p class="muted small" id="run-ended">on any cancelled run. It uses the existingstoppingcheck that already keeps the page on stopping until the processes have ended.test/run-stopped-words.test.ts: tests both sentences, checks that the stopped run's page shows the new line, and checks that a run that ended on its own does not. These checks fail without the change.- Not changed: the feed row and the terminal's run log keep the "Stopped by …" sentence.
Look pages: a commit says No look: because none of the pages in forge.json app.looks shows a run. The new line appears only on a cancelled run's own page, so before/after pictures of the 28 pages the gate inferred would look the same. The gate now passes.
Checks: scripts/gate.ts, tsc --noEmit and design-lint are clean. scripts/fast.ts listed 2,225 test files for this change, over its time budget, so I ran the 14 run-page and cancel test files by hand, including run-cancel-tree and run-cancel-stopping: 95 pass. The unix-socket suites are skipped in this sandbox; the forge's check runs them.
To try it, start a run, press Stop on its page, and read the line under "Stopped by …".
[{"go":"/<owner>/<repo>/runs/<id of a run you stopped>","look":"#run-summary and the line under it","expect":"\"Stopped by <you>, just now\" followed by a muted line: \"The run has ended. Nothing it started is still running.\""},{"go":"/<owner>/<repo>/runs/<id of a run that finished on its own>","look":"under the summary","expect":"no ended line"}]
🤖 Generated with Claude Code
The web line works and is tested, but the terminal is a door like the page and it still says nothing. Fix first: show the same ended/ending sentence in the terminal run log (src/tui/), with a test, and add docs/features/<name>.md (not README) noting it. Also: the sentence repeats what "Stopped by …" already says (principle 1); fold it into one line or drop the first clause. Box 3 is met by test/run-cancel-tree.test.ts already on main (not by this head), so I tick it as met on the base.
A stopped run now says once, on its own stop line, that nothing it started is still running, on both the web page and in the terminal: "Stopped by alice, just now. Nothing it started is still running." While the run's processes are still ending, both say "Ending the processes it started." instead.
Most of #15741 was already on main (1f2485ddc, 9853295f3, 75c68394a). A cancel ends the run's whole process group, grandchildren included. test/run-cancel-tree.test.ts proves it by cancelling a run whose child spawned a sleeping grandchild and checking every pid is gone within 2 s. This pull adds only what the two doors say.
src/runs/ended_words.ts(new, next tocancelled.ts):endedWords(ending)gives the sentence, andendedJoin/withEndedattach it to whatever line comes before. The web page and the terminal both import it, so the terminal does not reach intosrc/web.src/web/studio/run.ts: the separate#run-endedline is gone, and the sentence now closes#run-summaryitself. A run cancelled another way (its pull landed, a restart) ends its own summary with the same sentence. A run that ended on its own shows nothing new.src/tui/screens/runlog.ts: the run log's state line adds the same sentence for a cancelled run. It usesstillEndingfromsrc/runs/ending.ts, the same check behind the page's stopping word.- Tests:
test/run-stopped-words.test.tschanges on purpose: its old assertion matched the stop line without the sentence. It now checks the joined line, and that a run that ended on its own does not say it.test/tui-runlog.test.tshas a new case that holds the run withworkBegins, cancels it, checks "Ending the processes it started.", then releases it and checks "Nothing it started is still running." docs/features/run-cancel-ended.mddocuments it. The feed row is deliberately left as "Stopped by …" on its own.
The look check is answered with No look:: none of the pages in app.looks is a run's page.
scripts/gate.ts, tsc --noEmit and design-lint are clean. I ran the run-page and terminal tests, the cancel tests and every test that reads docs/features: all pass. I did not run the full suite.
To try it, stop a running run, then read the summary on its page and the state line in the terminal's run log.
[{"go":"/<owner>/<repo>/runs/<id of a run you stopped>","look":"#run-summary","expect":"one line: \"Stopped by <you>, just now. Nothing it started is still running.\" and no second line saying it again"},{"go":"/<owner>/<repo>/runs/<id of a run that finished on its own>","look":"#run-summary","expect":"its own summary, with no \"still running\" sentence"}]
🤖 Generated with Claude Code
When you press Stop on a run, the run's page and the terminal's run log now end the stop line with one sentence: "Stopped by you, just now. Nothing it started is still running."
- Where the sentence lives: it is in
src/runs/ended_words.ts, and two places import it:- the run page's summary,
src/web/studio/run.ts - the terminal's run log state line,
src/tui/screens/runlog.ts
- the run page's summary,
- No repeated line: the sentence closes the existing stop line. There is no separate line under it saying again that the run has ended.
- How-to:
docs/features/run-cancel-ended.mdcovers both places. - Tests:
test/run-stopped-words.test.tsandtest/tui-runlog.test.tseach check that the sentence appears once.
The last commit has no code. It adds the two lines the gate asked for:
No door:the terminal already shows the sentence through the existing run log screen, so a stopped run gets no new screen.Direction:this is a wording change for #15741 and touches no pipeline code.
Not done:
- No look: no page in
forge.jsonapp.looksshows a cancelled run, so this pull has no before/after pictures. - No change to stopping itself: how a run stops its processes is unchanged; the sentence describes what Stop already does.
bun scripts/gate.ts, bun x tsc --noEmit, bun scripts/design-lint.ts and the two test files above pass locally.
Try: start a run, press Stop on its page, and read the summary. Then open the same run in the terminal's run log and read its state line.
[{"go":"/","look":"open a running run's page and press Stop","expect":"the summary reads: Stopped by you, just now. Nothing it started is still running. — once, with no separate line repeating that the run ended"}]
🤖 Generated with Claude Code
When you press Stop on a run, the run's page and the terminal's run log now end the stop line with one sentence: "Stopped by you, just now. Nothing it started is still running."
- Where the sentence lives: it is in
src/runs/ended_words.ts, and two places import it:- the run page's summary,
src/web/studio/run.ts - the terminal's run log state line,
src/tui/screens/runlog.ts
- the run page's summary,
- No repeated line: the sentence closes the existing stop line. There is no separate line under it saying again that the run has ended.
- How-to:
docs/features/run-cancel-ended.mdcovers both places. - Tests:
test/run-stopped-words.test.tsandtest/tui-runlog.test.tseach check that the sentence appears once.
The last two commits have no code. They carry the lines the gate asks for:
No door:the terminal already shows the sentence through the existing run log screen, so a stopped run gets no new screen.Direction:this is a wording change for #15741 and touches no pipeline code.- It names #1242 (test speed) as the pipeline item it goes ahead of.
- None of the listed items is related to this change. #1242 is the nearest, because the change adds only two test files that run in about 3 seconds together.
bun scripts/gate.ts and bun x tsc --noEmit pass locally, and the two test files pass (17 tests).
Not done:
- No look: no page in
forge.jsonapp.looksshows a cancelled run, so this pull has no before/after pictures. - No change to stopping itself: how a run stops its processes is unchanged; the sentence describes what Stop already does.
Try: start a run, press Stop on its page, and read the summary. Then open the same run in the terminal's run log and read its state line.
[{"go":"/","look":"open a running run's page and press Stop","expect":"the summary reads: Stopped by you, just now. Nothing it started is still running. — once, with no separate line repeating that the run ended"}]
🤖 Generated with Claude Code
Clean. The stop sentence is said once, on the stop line, on the page and in the terminal run log. Both import it from src/runs/ended_words.ts, so there is no duplication. The tests for both doors fail without the change. The how-to is in docs/features, not README. The output is escaped through the html template, and there is no new dependency, no markup and no style change. The cancel-tree behaviour and its grandchild test were already on main (test/run-cancel-tree.test.ts), and the new tests cover the wording.
A cancelled run's page now says, under its summary, that the run has ended and nothing it started is still running. While the run is still shutting its processes down, the same spot says "Ending the processes it started." instead.
Most of #15741 was already on main. 1f2485ddc, 9853295f3 and 75c68394a made a cancel end the run's whole process group, grandchildren included (SIGTERM first, then SIGKILL once the 1.5 s grace runs out).
test/run-cancel-tree.test.tsalready proves it for checks and crew runs: a test starts a run whose child spawns a sleeping grandchild, cancels it, and checks that every pid is gone within 2 s. So I did not touch the cancel code or write a second copy of that test. The only missing item was the page's wording, which is all this change adds.src/web/studio/run.ts: a newendedWords(word)gives the sentence. The page shows it in<p class="muted small" id="run-ended">for any cancelled run. It uses the samestoppingcheck that already holds the page on stopping until the processes have ended.test/run-stopped-words.test.ts: tests both sentences, checks that the stopped run's page shows the new line, and checks that a run that ended on its own does not. These checks fail without the change.I did not change the feed row or the terminal's run log. They keep the existing "Stopped by …" sentence.
The gate,
tsc --noEmitanddesign-lintare clean.scripts/fast.tsreported the change as too broad to pick tests (2,225 files), so I ran the 14 run-page and cancel test files by hand instead, includingrun-cancel-treeandrun-cancel-stopping: 95 pass. The tests that need unix sockets are skipped in this sandbox; the forge's check runs them.How to try it: start a run, press Stop on its page, and read the line under "Stopped by …".
🤖 Generated with Claude Code
Closes #15741