pi-extensions GitHub

pi-until — keep going until the predicate passes

Give the agent a finish line it can check: a shell command that exits 0. If the check fails when the agent tries to stop, its output sends the agent back to work. The loop still ends at its check limit, on error, or when you cancel it.

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

For example, keep working on a test failure, or wait for a PR's checks:

/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.