Skip to content
codeband is pre-release. These docs describe its first release, and some of what they describe is still being built.

Cancel a run in the web interface

Cancel a run in the web interface when you watch it on the board and see it go wrong. In this guide you start a run of the example pipeline run_program that sleeps for five minutes, and cancel it from its card. At the end, the card has the mark cancelled, and codeband show prints cancelled by with your user name. If a function step fails, see Troubleshooting at the end of this page.

  • You did the Quickstart: you have a clone of codeband with the binary at build/codeband, built with just build, which builds the page into the binary.
  • Your terminal is in the codeband folder. Run each command from there unless a function step says otherwise.

codeband dev serves the page, as codeband web does, and passes its calls on to the daemon, as codeband cancel does in a terminal. Every daemon client can cancel every run, so you can cancel in the web interface a run that someone started in a terminal. codeband dev makes a secret token at each start and prints its address with the token. The page takes the token from the address and sends it with each call, and codeband dev refuses a call without it. The daemon records the user who runs codeband dev as the one who cancelled.

  1. Start the daemon, the code server and the web interface

    If codeband dev from the Quickstart still runs, skip this step: it has loaded run_program too and serves the web interface. Otherwise, open a second terminal, change to the codeband folder, set your Claude Code login as in the Quickstart, and start codeband dev in the example:

    Terminal window
    just examples/py-factory/dev

    codeband dev prints the address of the web interface with a secret token to stdout. Then the code server logs the pipelines it loaded, run_program among them, and the daemon logs Listening. All three keep running. Your token is different:

    Output
    http://127.0.0.1:8765/?token=6EGHLUQPNTZGR2EWX2HUGA3KWQ
    Nov 25 18:56:08.687 INF Loaded pipelines comp=codeserver pipelines="[intake run_program ship_feature write_hello]" folder=…/codeband/examples/py-factory
    Nov 25 18:56:08.716 INF Serving pipelines comp=codeserver address=unix:~/.local/state/codeband/codeserver.sock
  2. Open the web interface

    Open the address that codeband dev printed in your browser. The page keeps the token, so the links of the page and a later address without the token, such as http://127.0.0.1:8765/?view=runs, work in this browser too.

  3. Start a run that goes on

    Back in the first terminal, start a run of run_program that runs sleep 300, with a title for its card. codeband dev serves the example under the name of its folder, py-factory, so the pipeline is py-factory/run_program:

    Terminal window
    build/codeband run -d py-factory/run_program --title "Sleep five minutes" --input '{"argv": ["sleep", "300"]}'

    -d starts the run and returns at once. codeband run prints the run ID. Your run ID is different:

    Output
    2zqeq4s51c
  4. Cancel the run from its card

    In the browser, open the board of run_program: click Board in the header, or open http://127.0.0.1:8765/?view=board&pipeline=py-factory/run_program. The card Sleep five minutes has the mark running, the running step program, and a Cancel run button.

    Click Cancel run, and confirm the question Cancel the run Sleep five minutes? … of the browser. The button reads Cancelling… until the shell step stops. Then the card gets the mark cancelled and the button goes away.

    The page for one run has the same button in its header. A run that has ended has no Cancel run button.

Show the run in the first terminal, with the run ID that step 3 printed in place of RUN_ID:

Terminal window
build/codeband show RUN_ID

The status is cancelled, and the run journal names the user who runs codeband dev, here ada:

Output
Run 2zqeq4s51c
Title Sleep five minutes
Pipeline py-factory/run_program
Status cancelled
…
▸ program#0 shell step: sleep 300
cancellation requested by ada
✗ program#0 cancelled after 5.6s
cancelled by ada

To stop, press Ctrl-C in the terminal of codeband dev.

For an error that this page doesn’t cover, see Run problems.

You opened the page in a browser that has never opened the address with the token, for example by typing http://127.0.0.1:8765/. Open the address that codeband dev printed, with its ?token=.

The page shows the request has no token or a wrong one

Section titled “The page shows the request has no token or a wrong one”

codeband dev started again since you opened the page, and each start makes a new token. Open the address that it printed last.

  • Web interface: the token, the board, the page for one run and what the web interface refuses.
  • codeband cancel: cancel a run from a terminal and wait until it ends.
  • Run: how a run ends, and what a cancellation stops.