Skip to content

continue_loop ​

Send the task once, then keep saying "continue" to the same session, which is what a person at a prompt would type. The agent keeps its whole conversation, and every round it is told to carry on rather than told the task again.

ships with humanize

Nothing to install: it is in hmz from the first run, with chat and the other loops, and its code is humanize's flows/builtin/continue_loop.

text
❯ $continue_loop port the test suite from unittest to pytest
sh
hmz exec -f continue_loop -a agent=kimi/kimi-code/k3:high \
    -p budget.duration=6h "$(cat TASK.md)"
continue_loopsimulated

The whole run, at rest. Step through it with the buttons, or drag the bar.

Until a turn answers, the task is sent again rather than “continue”: the word means something only to a session that heard the task.

The run, turn by turn
  1. agent — the task; a session opened for this turn
  2. agent — “continue”; another turn of the session it already had
  3. agent — “continue”; another turn of the session it already had
  4. agent — “continue”; another turn of the session it already had

Then round again: until the budget is spent.

It ends when the budget runs out, or 3 failed turns in a row.

When to use it ​

Like stateful_ralph, it holds one session, so the agent remembers what it tried. The difference is the prompt: stateful_ralph repeats the task, which pulls the agent back to it every round, while "continue" lets it follow its own plan.

"Continue" only makes sense to a session that heard the task. Until a turn has answered, the flow sends the task again rather than "continue".

Roles and params ​

RoleWhat it isHow it is filled
agentagent, required-a agent=…Takes every round, in the one session the run holds.
workspaceenvironment, localthe directory you start in; no -eWhere every round works.

Each agent role takes one -a role=CLI[@PROVIDER]/MODEL[:EFFORT]; several roles may share one -a, comma-separated. There is no -e to give: workspace is a local environment, the directory you start the run in, and an -e naming it is refused. See Command-line specs.

No params. The loop pauses 5 seconds between rounds.

What ends it ​

  • The budget. However much the agent says it is done, it is told to continue, so this is the usual end.
  • Three failed turns in a row. The run ends with the last failure. A turn that answers with nothing is not a failure; it is simply sent again.

Picking it up ​

--resume carries on the round count. The session is not picked up: the resumed run opens a new one, which has heard nothing, so it is sent the task first, exactly as the first run was. See Picking a run up.

See also ​

  • stateful_ralph: the same session, sent the task every round
  • goal: the backend's own way of not stopping