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

opened this

Merged 19d 7h ago, 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.

Notes

opened this

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 quiet cancelled colour, 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

Closes #13457

commented

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 quiet cancelled colour, 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

commented

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.ts stops a running agent run through cancelRepoRun, opens its run log and checks that the state line reads Stopped by alice, just now. I reverted the runlog.ts line to confirm the test then fails.
  • Run page time: stoppedLine in src/web/studio/run.ts puts 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.ts checks that the summary, with tags removed, is exactly Stopped 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: the stoppedWords import now sits in order after ../flow/clog_note.ts, and the two unrelated comment rewraps are undone. bun scripts/gate.ts --fix would 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-shipping
  • test/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

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs