Public: anyone can read this; the crew can change it.
A run cancelled from the page shows 'stopped' with the time and who stopped it, on the run's own page #13493
Check · Review · Land · Live done — Landed and live in production.
When a person stops a run, it now reads "Stopped by alice, 2 minutes ago" on the run's page and on its feed row, and the same sentence shows in the terminal's run log. The sentence comes from one function, stoppedWords in src/runs/cancelled.ts.
shipped production is serving it deploy 8e1361f
1 earlier comment · 1 event
When a person stops a run, it now reads "Stopped by alice, 2 minutes ago" on the run's page and on its feed row, and the same sentence shows in the terminal's run log. The sentence comes from one function, stoppedWords in src/runs/cancelled.ts. It reads the cancelled by <name> summary that cancelRepoRun already writes; the time is when the run stopped.
- Run page (
src/web/studio/run.ts): the summary line shows the sentence. The badge keeps the quietcancelledcolour, never red. - Feed (
src/feed/items.ts): a stopped run's row reads "an agent run on #N: Stopped by alice, just now", not "an agent run finished: cancelled by alice". - Quiet runs (
src/feed/quiet.ts): this one changes existing behaviour. Without it there would be no feed row to show: a short agent run that left nothing behind is folded into a count rather than posted, and that is what a stopped run usually is. A run a person stopped now keeps its post. - Terminal (
src/tui/screens/runlog.ts): the state line uses the sentence, as the page does. - A run that ended on its own just before the stop keeps its real end. The stop only changes a run that is still queued or running, so that run's summary never names a person.
- Docs: one line added to
docs/features/run-state.md.
test/run-stopped-words.test.ts covers the sentence, the run page with its quiet badge colour, the feed row, and the run that ended first. It fails without the change. That file, the nearby feed, quiet-run, cancel and terminal run-log tests, bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts all pass.
I left the page's meta description as it was ("Cancelled: cancelled by alice"): link previews cache it, so a relative time like "just now" would go stale there. I couldn't record the plan on the issue: the keep_plan tool wasn't available in this run.
To try it on the preview, open a running agent run at /<owner>/<app>/runs/<id> and press Stop. The page and the feed on / then read "Stopped by <you>, just now".
🤖 Generated with Claude Code
Works as described and the page, feed and quiet-colour behaviour are tested. Two things to fix in one round:
- (first) The terminal change has no test. src/tui/screens/runlog.ts now shows the stop sentence, but nothing fails if that line is reverted. Add a runlog screen test with a cancelled-by run and assert the state line reads Stopped by <name>.
- On the run page, the relative time is baked into a plain <p>, so it goes stale and a reader cannot get the exact time. Wrap the time in <time datetime=finishedAt title=exact-time> (the feed keeps the plain sentence) so a screen reader and a hover get the real moment. Keep the sentence text identical.
Also: the unrelated comment rewraps in src/feed/items.ts and the out-of-order import there add noise; keep the diff to the change. Direction note: this is a feature while the pipeline-first list is open; acceptable as a small single-purpose pull, but nothing further feature-side should go ahead of the pipeline items.
A run someone stops from its page now reads "Stopped by <name>, <time>" on the run page, its feed row and the terminal's run log. Its badge keeps the quiet cancelled colour, never red. The sentence comes from stoppedWords in src/runs/cancelled.ts, which reads the cancelled by <name> summary that cancelRepoRun already writes. A run that ended on its own just before the stop keeps its real ending.
This round addresses the review:
- Terminal test:
test/tui-runlog.test.tsstops a running agent run throughcancelRepoRun, opens its run log and checks that the state line readsStopped by alice, just now. I reverted therunlog.tsline to confirm the test then fails. - Run page time:
stoppedLineinsrc/web/studio/run.tsputs the relative time in<time datetime="<ISO finishedAt>" title="YYYY-MM-DD HH:MM UTC">. The visible words are unchanged.test/run-stopped-words.test.tschecks that the summary, with tags removed, is exactlyStopped by alice, just now, and that the<time>carries a valid datetime and its matching UTC title. The feed row keeps the plain sentence. - Noise in
src/feed/items.ts: thestoppedWordsimport now sits in order after../flow/clog_note.ts, and the two unrelated comment rewraps are undone.bun scripts/gate.ts --fixwould rewrap those two comments again, because it rewraps every long comment in any file a pull touches. The gate only notes them ("the nightly rewrap wraps them on main"), so I left them out as the review asked.
The run page now builds its sentence from stoppedBy rather than calling stoppedWords, since it needs markup in the middle. The test that compares the page's text to the sentence keeps the two wordings from drifting apart. Following the direction note, nothing further feature-side is planned here.
Checks run here: bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts are clean. scripts/fast.ts named 2129 test files (about 180 minutes), so I picked the covering files myself and all of them pass:
run-stopped-words,tui-runlog,crew-cancel-by,crew,desk-runs,run-cancel-tree,run-page-folds,studio-runs,studio-shippingtest/feed*.test.ts(42 files)
To try it: open a running agent run at /<owner>/<app>/runs/<id> and press Stop. The page reads "Stopped by <you>, just now", and hovering the time shows the exact UTC moment. / and the terminal's run log say the same sentence.
🤖 Generated with Claude Code
Earlier asks are met. (1) The terminal test now stops a run through cancelRepoRun and checks the run log state line. (2) The run page puts the time in a <time datetime title> with the exact UTC moment, and the visible words match the feed and terminal sentence. (3) The import order and the unrelated comment rewraps in items.ts are fixed. The change is plain words, no new colour, no new accent and no new dependency. The how-to is one line in docs/features/run-state.md, not the README. The terminal shows the same sentence as the page. I read the diff and the tests; I did not re-fetch the preview this round.
Two things I would do next:
- Non-blocking: stoppedLine in src/web/studio/run.ts and stoppedWords in src/runs/cancelled.ts each build the sentence. The test compares the two, but a shared helper that takes a time renderer would remove the second wording.
- Non-blocking: the meta description still reads "Cancelled: cancelled by alice". Give it the timeless form "Stopped by alice" (stoppedWords with a null time).
When a person stops a run, it now reads "Stopped by alice, 2 minutes ago" on the run's page and on its feed row, and the same sentence shows in the terminal's run log. The sentence comes from one function,
stoppedWordsinsrc/runs/cancelled.ts. It reads thecancelled by <name>summary thatcancelRepoRunalready writes; the time is when the run stopped.src/web/studio/run.ts): the summary line shows the sentence. The badge keeps the quietcancelledcolour, never red.src/feed/items.ts): a stopped run's row reads "an agent run on #N: Stopped by alice, just now", not "an agent run finished: cancelled by alice".src/feed/quiet.ts): this one changes existing behaviour. Without it there would be no feed row to show: a short agent run that left nothing behind is folded into a count rather than posted, and that is what a stopped run usually is. A run a person stopped now keeps its post.src/tui/screens/runlog.ts): the state line uses the sentence, as the page does.docs/features/run-state.md.test/run-stopped-words.test.tscovers the sentence, the run page with its quiet badge colour, the feed row, and the run that ended first. It fails without the change. That file, the nearby feed, quiet-run, cancel and terminal run-log tests,bun x tsc --noEmit,bun scripts/gate.tsandbun scripts/design-lint.tsall pass.I left the page's meta description as it was ("Cancelled: cancelled by alice"): link previews cache it, so a relative time like "just now" would go stale there. I couldn't record the plan on the issue: the
keep_plantool wasn't available in this run.To try it on the preview, open a running agent run at
/<owner>/<app>/runs/<id>and press Stop. The page and the feed on/then read "Stopped by <you>, just now".🤖 Generated with Claude Code
Closes #13457