Stop, remove, and move loops
Takeaways:
definitionSourcesays where a loop is controlled:apploops change in Tessl,repoloops change intessl.json.- Pausing works on both kinds and stops scheduled and event-started runs. Removing works differently for each kind.
- Pausing or removing a loop never cancels a run already in progress. Cancel that run separately with
tessl launch cancel. - Code Review is a repository setting, not a loop. Pausing every loop leaves it running.
A factory keeps spending credits until each part of it is stopped: the loops, the runs they already started, and Code Review. This page covers each one, and how to read back that it took effect. For the terms loop, action, trigger, and run, see the Automations overview.
Find where a loop is controlled
List the project's loops with their definition source:
Each loop's attributes.definitionSource tells you which control to use:
app: the loop was set up in Tessl, by the web app, thefactory-setupskill, or the CLI. Ticket to PR and Learn from past work are set up this way. Pause, resume, and delete it in Tessl. Ticket to PR's loops have no Edit button: to change them, move them into tessl.json with your coding agent. Code Review is a repository setting, not a loop, so you turn it off instead.repo: the loop is declared intessl.json. Pause and resume it in Tessl. Change or remove it by editing the file and merging to the default branch.
definitionSource is present when repo-defined loops are enabled for your organization. When it is absent, every loop is managed in Tessl. In the web app, a repo-defined loop's page offers Edit in tessl.json instead of Edit.
--all reads every page. The list leaves out loops that were already deleted.
Pause and resume a loop
Pausing is the reversible way to stop a loop, and it works the same for both kinds. A paused loop starts no runs from its schedules or its event triggers. Resuming restores it as it was. A push to tessl.json keeps a paused repo-defined loop paused.
In the web app, open the loop's page, open the Loop actions menu, and choose Pause or Resume.
Read it back:
Status: reads paused or active.
A paused loop still accepts a run you start on purpose: Trigger now in the web app and tessl schedule trigger <loop id> both start one. tessl action trigger <name> is refused while the action's loop is paused.
Remove an app-defined loop
Delete it in Tessl:
In the web app, the Loop actions menu calls this Archive. The loop stops starting runs, and its past runs and findings stay available. To set it up again later, run the same setup again.
Read it back: the loop is no longer in tessl schedule list --project-id <project id> --all --json.
Remove a repo-defined loop
Tessl refuses to edit or delete a repo-defined loop, so change the file instead:
- To stop a schedule, remove its entry from the
schedulesblock. - To stop an event trigger, remove its entry from the
triggersblock. - To remove the whole loop, remove the action and every trigger and schedule that names it.
Commit the change and merge it to the default branch. Nothing changes until the change is on the default branch. A file Tessl can't parse changes nothing, but a block that fails validation holds back only what it covers, and the rest of the file still syncs. Run tessl doctor --automations before you push. The Schedules page explains what an invalid block holds back.
Read it back after the merge: a removed loop is no longer listed by tessl schedule list --project-id <project id> --all --json, and a loop that lost one trigger shows only the rest in tessl schedule view <loop id>.
To stop a repo-defined loop today and decide on the file later, pause it.
Move an app-defined loop into tessl.json
Move a loop into tessl.json when you want to change what Tessl doesn't let you edit in place: its instructions, its model, its environment, or who can start it.
Ticket to PR's four loops (Implement ticket, Shepherd PR, Follow ticket changes, and Merge conflict sweep) have no Edit button in the web app. To move them, ask your coding agent with the tessl-labs/factory-setup plugin installed to move them into tessl.json. It moves all of the project's loops set up in Tessl together, in one pull request. This agent route is US only for now: the plugin isn't published on the EU region yet.
For a loop with an Edit button on its page:
- Open the loop's page in the web app and choose Edit.
- Choose Open pull request. Tessl opens a pull request that adds the loop to
tessl.json. - Leave the action key the pull request adds unchanged until it merges. A renamed key creates a second loop while the old one keeps running.
- Merge the pull request. Tessl replaces the loop with the one the file declares and keeps its runs and findings. It doesn't keep a pause: a paused loop normally comes back
active, so pause it again after the merge if it should stay stopped.
Read it back after the merge: the loop's definitionSource is repo, and tessl schedule view <loop id> shows its Status:. From then on, change it through a pull request on tessl.json.
While the pull request is open, the loop is still app-defined, and its page shows View pull request.
Cancel a run already in progress
Pausing, deleting, or editing a loop stops future runs only. A run that already started keeps going until it finishes. To stop it, cancel the run itself.
-
Find the runs that are still going. An in-progress run has status
pending:The list shows 20 runs at a time. When more match, it ends with a hint to repeat the command with
--after <cursor>; repeat it until no hint appears. The list includes runs from loops you already deleted. To see one loop's newest runs instead, usetessl schedule runs <loop id>, which shows 20 unless you pass--limit. -
Check each run before you cancel it.
tessl launch view <run id>shows itsRepo:andSkill:. Cancel only the runs that belong to the factory you're stopping:The command prints
Cancellation requested for launch run: <run id>. Canceling is asynchronous: the run stops its work and then records itself ascancelled. -
Read it back until the status changes:
Status:readscancelled. Canceling a run that already finished does nothing, and its status stays as it was. -
Run the list from step 1 again, with the same options and every page, and confirm none of the factory's runs are still
pending.
Any member of the run's workspace can cancel it.
Turn off Code Review
Code Review is a setting on each repository, so pausing a project's loops leaves it reviewing pull requests. Turning it off needs an organization admin:
Read it back:
Enabled reads no under Review. To turn it back on, run the update with --review-enabled. For the other review settings, see Set up Tessl Code Review.
Stop a whole factory
After a workshop or a trial, stop each part and read it back:
- List the loops with
tessl schedule list --project-id <project id> --all --json. - Pause every loop whose
statusisactive. Confirm each one readspaused. - List every pending run with
tessl launch list --status pending --workspace <workspace>, following each--afterhint to the last page. This includes runs from loops deleted earlier. Check each run'sRepo:andSkill:withtessl launch view, cancel the ones that belong to the factory, and confirm each readscancelled. Then list the pending runs again to confirm none of the factory's remain. - Turn off Code Review on each repository the factory reviews, and confirm
Enabledreadsno.
Paused loops keep their configuration, so resuming them later restores the loops as they were. Code Review stays off until you turn it back on with --review-enabled. When you're sure you won't need a loop again, delete it if it's app-defined, or remove it from tessl.json if it's repo-defined.
Next steps
- Automations overview: factories, loops, actions, triggers, and runs.
- Learn from past work: the loops that record findings and turn them into tickets.
- Schedules: the
schedulesblock, sync behavior, and safety model. - CLI commands: every
tessl scheduleandtessl launchcommand.