Skip to content

v0.2.9

Choose a tag to compare

@cliftonc cliftonc released this 21 Jun 04:10
a2934ec

Tunable maxSteps cap (#6)

Adds a step cap on agent runs — a "step" is one Pi turn (one model call plus the tool executions it triggers).

  • Programmatic: run({ maxSteps }); RunResult.maxStepsReached reports whether the cap stopped the run.
  • CLI: --max-steps <n>.
  • When the agent completes maxSteps turns and still wants to continue, the run stops cleanly (agent_end, exit 0) and emits a gated max_steps_reached event. Suppressed when no cap is hit, so default-run JSONL stays byte-identical.

Pi exposes no max-turns / shouldStopAfterTurn seam through its SDK, so the cap is enforced from the event stream (count turn_end, abort when exceeded).