pi-extensions GitHub

pi-until — keep going until the predicate passes

/until [--max N] <command> [-- task]
/until stop
/until            # status

State the exit condition as a command, and the agent cannot stop until it exits 0:

/until npm test -- fix the flaky date test
/until --max 5 gh pr checks 42

Behaviour

The first -- separates the command from the task, so a command that itself needs -- (e.g. npm test -- --grep x) belongs in a script or sh -c '…'.

The command is yours, typed at the prompt. The model never supplies it.

How

agent_before_settle is pi's final actionable boundary: a handler can append a custom_message draft (the model reads it as a user message) and return continue: true for one more request. The loop re-arms itself at every settle, so no timers or watchers are involved.