requires_iteration_review).
req.step_output. The reviewer calls confirm(), reject(), or edit() before resuming.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
requires_output_review | bool | Callable[[StepOutput], bool] | False | Pause after execution for review. Pass a callable for conditional review |
output_review_message | str | None | Message shown to the reviewer |
on_reject | OnReject | OnReject.skip | Action on rejection: skip, cancel, retry, else_branch |
hitl_max_retries | int | 0 | Maximum retry attempts when on_reject=OnReject.retry. 0 = unlimited |
hitl_timeout | int | None | Seconds before auto-resolving. See Timeout |
on_timeout | OnTimeout | None | Action when timeout expires. See Timeout |
Reviewer Actions
| Method | Effect |
|---|---|
req.confirm() | Accept output as-is. Continues to next step |
req.reject() | Reject output. Behavior depends on on_reject |
req.reject(feedback="...") | Reject with feedback. Feedback is sent to the agent on retry |
req.edit("new output") | Accept with modifications. Edited output replaces original |
Reject with Retry
Seton_reject=OnReject.retry to re-execute the step when a reviewer rejects. Pair with reject(feedback=...) to send the reviewer’s feedback to the agent on the next attempt.
"Feedback from reviewer: ..." on the next execution. Without feedback, the step simply re-runs with the same input.
Retry Behavior
| Scenario | Result |
|---|---|
Reject with on_reject=OnReject.retry | Step re-executes. Previous output is removed from collected outputs |
| Reject with feedback | Feedback is passed to the agent. retry_count increments |
hitl_max_retries reached | Step is skipped (treated as final rejection) |
hitl_max_retries=0 | Unlimited retries (default) |
Edit Output
Accept with modifications. The edited content replaces the original step output before it flows to the next step. Use this when the fix is minor and a full retry would be wasteful.edit() sets confirmed=True and stores the edited content. On resume, the edited output replaces the original in collected outputs.
Conditional Review
Pass a callable torequires_output_review to evaluate at runtime whether review is needed. The predicate receives the StepOutput and returns True to pause or False to auto-approve.
| Condition | Example |
|---|---|
| Output length | len(str(output.content)) > 200 |
| Contains sensitive keywords | "password" in str(output.content).lower() |
| Confidence score | output.metrics.get("confidence", 1.0) < 0.8 |
| Random sampling | random.random() < 0.1 for 10% review rate |
Full Review Loop
The complete pattern with all three reviewer actions:StepRequirement Properties
When a step pauses for output review, theStepRequirement includes:
| Property | Type | Description |
|---|---|---|
step_name | str | Name of the paused step |
step_output | StepOutput | The step’s output for review |
output_review_message | str | Message from the step configuration |
retry_count | int | Number of retry attempts so far |
rejection_feedback | str | Feedback from the last rejection |
timeout_at | datetime | When the timeout expires (if set) |