Long-horizon execution — loops, planning, splits, hooks — step 9 of 10
Write should_continue(state) — the completion-guard decision
function. Returns True if the harness loop should re-enter,
False if it should stop.
The state dict has four fields:
goal_met(bool): did the deterministic goal check pass?steps_taken(int): how many turns has the agent used?max_steps(int): the iteration budget.errors_in_last_turn(int): how many critical errors fired in the most recent turn (e.g., hook blocks, exception count).
Return True iff:
- goal is NOT yet met, AND
- steps_taken < max_steps (budget not exhausted), AND
- errors_in_last_turn == 0 (last turn didn't produce critical errors)
Four scenarios run. Expected output:
early loop: True
goal met: False
budget exhausted: False
critical errors: False
⌘↵ runs the editor.read, then continue.
Write should_continue(state) — the completion-guard decision
function. Returns True if the harness loop should re-enter,
False if it should stop.
The state dict has four fields:
goal_met(bool): did the deterministic goal check pass?steps_taken(int): how many turns has the agent used?max_steps(int): the iteration budget.errors_in_last_turn(int): how many critical errors fired in the most recent turn (e.g., hook blocks, exception count).
Return True iff:
- goal is NOT yet met, AND
- steps_taken < max_steps (budget not exhausted), AND
- errors_in_last_turn == 0 (last turn didn't produce critical errors)
Four scenarios run. Expected output:
early loop: True
goal met: False
budget exhausted: False
critical errors: False
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.