feat(framework): a dashboard Stop button to interrupt the run (#218)#219
Merged
Conversation
The dashboard was a one-way display; you could only interrupt from the terminal. Add a Stop button that aborts the run from the browser: a POST /stop route calls an onStop handler wired to the run's AbortController, which runFramework checks between phases and the driver honours mid-turn (kills the current agent turn). A stop ends cleanly as 'stopped', not 'failed': the end event gains a stopped flag, the CLI prints '■ Stopped' and exits 0, the dashboard shows a stopped status, and the persisted run records status 'stopped' so --resume reflects it. startDashboard gains an onStop option; the page hides the button when stopping is not wired (a read-only --resume view). Part of #110. Closes #218.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the dashboard interactive: a Stop button interrupts the running build from the browser, not just from the terminal. Closes #218 (part of #110; first interactive slice of #165's web client, unblocked by the own-shell-vs-opencode decision since this is a control on our own dashboard).
How it works
startDashboardgains anonStopoption; a newPOST /stoproute invokes it (405 for a non-POST so a stray GET can't interrupt; 404 when stopping isn't wired).AbortController, passes its signal torunFramework, and wiresonStoptocontroller.abort().runFrameworkchecks the signal between phases and the driver honours it mid-turn (SIGTERM to the current agent turn), so a stop lands promptly.endevent gains astoppedflag, the CLI prints■ Stoppedand exits 0, the dashboard shows a stopped status, and the persisted run recordsstatus: "stopped"so--resumeshows it stopped. The page hides the button on a read-only--resumeview.Verified
POST /stopcallsonStop(202); GET -> 405; no handler -> 404; page ships the button +STOPPABLEflag.end{stopped:true}and a persistedstatus: "stopped".