Loops
A loop is one piece of work that an agent does again and again. After each time, the agent checks whether to go on. A good example is "take the most urgent card in To do and do it, as long as there are cards in To do". Each time through is called a round.
A loop sits between the two other ways an agent works by itself. A job wakes up on a schedule, such as every weekday at 09:00, and goes through its steps once. A goal keeps the workspace's agent at work until the agent reports that the goal is reached. A loop starts when you press Start and runs one round after another with no schedule. It ends by itself when the answer to its question is no.
The Loops tab
Open an agent and press Loops, beside Skills at the top of its page. On a phone, the same tab is in the agent's ⋯ menu. The tab lists the agent's loops. Each row shows these items:
- the loop's name
- how it stands: Stopped, Running, Waiting for the agent, Waiting for you, Finished or Failed
- which round it is on
- how long it worked
- the agent's summary of the last round
Making a loop
The Loops tab opens on a box where you can describe a loop at once. Below the box are the agent's loops and the templates. You can start in three ways, all on that one screen.
From a template. A template is a ready-made loop that you read and change before you save it. Catervas comes with twelve:
| Template | What it does |
|---|---|
| Clear the board | Does the cards in one column of the board, the most urgent first, until the column is empty. |
| Fix the bugs | Takes each card labelled as a bug, finds the cause, fixes it and opens a pull request. |
| Triage new cards | Gives each new card labels and a due day, asks about anything unclear, and puts the column in order. |
| Investigate bug reports | Finds the cause of each bug report without changing code. Writes the cause on the card, and gives the card to whoever must fix it. |
| Tidy the board | Finds cards that are stuck in Doing, have no description or are past their due day. Fixes them, or asks whoever can fix them. |
| Write release notes | Writes a short note for customers about each finished card, on a page of release notes. |
| Split cards by platform | Makes one card for each platform, such as web and phone, where a new card's work differs between them. |
| Make the tests pass | Fixes one failing test each round until every test passes. |
| Work through GitHub issues | Fixes the open issues with one label, one pull request each. |
| Review open pull requests | Reviews each open pull request that it did not review yet, and merges nothing. |
| Map the project | Reads the project one folder at a time. Writes on the knowledge page Where things are what each folder holds, so that later conversations know where to look. |
| Tidy the knowledge base | Reads the knowledge pages one at a time, merges lines that repeat, settles lines that disagree, and splits pages that grew too long. |
Some templates ask a question or two first, such as which column of the board to work through. The template then puts your answer in each place where it belongs. Each template says what it needs to be of use, such as a GitHub account for the agent. After the questions, you see the whole loop. You can change anything before you press Save the loop.
By drawing. Press Write it yourself, under the box. The loop shows as its two steps side by side: Do the work, then Go on?. An arrow goes back to the work when the answer is yes. An arrow goes to Finished when the answer is no. Press a box to write its words:
- Do the work says what the agent does in one round, such as "Take the most urgent card in To do, move it to Doing, do it, and move it to Done."
- Go on? is the yes-or-no question that the agent answers after each round, such as "Are there still cards in To do?" Yes starts the next round. No finishes the loop.
In words. Write what you want in the box at the top of the tab, such as "check the board and do the cards by urgency, as long as there are cards in To do". Then press Enter or Ask … to write it. The agent writes the name, the work and the question in a new conversation called "Writing a loop". Then the loop appears on the tab.
Read the loop, and press Change to correct anything before you start it. You can also ask the agent for a loop in any chat. An agent that ran before the update of Catervas learns to write loops after a restart.
A saved loop is stopped. Nothing runs until you press Start.
Your own templates
You can keep a loop that works well as a template of its workspace. To do this, follow these steps:
- Open the loop with Change.
- Press Save as template.
- Give the template a name and a line that says what it is for.
- Pick a symbol from the row of symbols under them.
Every agent of the same workspace then finds the template on the Loops tab, above the twelve that come with Catervas. Agents in no workspace share their templates with each other. Nothing crosses from one workspace to another.
A template keeps the loop's work, its question, its limits and how hard it thinks. It does not keep whether the loop ran or stopped, its rounds or its conversation. Edit details on a template's row changes its name, description or symbol. To change what the template fills in, change a loop and save it as a new template. Delete removes the template, and loops that you made from it stay as they are.
While a loop runs
Every round of one loop happens in one conversation of its own, named "Loop ·" and the loop's name. As a result, you can read what the agent did in each round. Press Conversation on the loop's row to open it.
Stop after this round ends the loop when the current round is finished, so no work is left half done. After you press it, Stop now ends the loop at once and cuts the round short.
If the agent cannot do a round, the loop does not try again by itself. It waits for you in Waiting on you, with what went wrong. Then you choose Try again or Stop.
An agent runs one loop at a time, and does one thing of this kind at a time. While a loop runs, a job of the same agent that wakes up waits until the loop ends, and then runs. A loop that waits for your answer still holds its agent. So answer the loop or stop it when you want the agent's jobs to go ahead.
A loop starts at once, even while the agent answers you in another conversation. The loop works in a new conversation of its own, beside the other open conversations, and lets them finish. Both work in the same project folder. Remember this when you ask the agent to change the same files at the same time. A job that wakes up still waits until the agent is free.
When a loop stops to ask you
So that a loop never runs for ever, it stops after 20 rounds or 2 hours of work, whichever comes first. Then it asks you in Waiting on you whether to go on. Go on lets it run for as many rounds and hours again. Stop ends it.
Time that the loop waits for your answer does not count as work. When the time ends in the middle of a round, the loop pauses that round's work. The loop continues the round if you say go on.
You can change both numbers for every loop in Settings, under Loops. For one loop, change them under When it stops to ask you when you change the loop. In the cloud, only the second way is available now. See Loops in the cloud. A loop set to As in Settings follows Settings from its next start.
How hard it thinks
A loop's rounds think as hard as the agent is set to, unless you choose another level under How hard it thinks. A job is different, because its runs are at low effort unless you choose otherwise. The reason is that a loop usually does real work round after round, such as cards on the board. A higher level takes longer and costs more with the model's maker.
Loops in the cloud
An agent in the cloud Catervas has the same Loops tab, with the same templates, and its loops run the same way. Catervas wakes a sleeping agent for a loop's first round, as it does for a job. One thing is different: the cloud has no Settings page yet. As a result, every loop there stops to ask you after 20 rounds or 2 hours of work. The exception is a loop that you give limits of its own under When it stops to ask you.