You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(run-limits): say max_turns restarts per iteration and expected_turns counts tool calls
max_turns caps model API calls per iteration, and each retry and dialog exchange starts a fresh count. expected_turns is a different unit and scope: tool calls plus the final reply, summed over the task. The Codex and Antigravity pages still described max_turns as a visible-turn cap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/TASK_DEFINITION_GUIDE.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,8 +255,8 @@ run_limits:
255
255
256
256
| Field | Default | Constraint | Description |
257
257
|-------|---------|------------|-------------|
258
-
| `max_turns` | *unset* | `> 0` | Hard cap on main-thread model API calls per iteration, Claude Code's turn, counted the same on every harness. The tools the last allowed call asks for still run; the turn ends when the next call begins. Unset uses the SDK default. See [HARNESS_PARITY.md](agents/HARNESS_PARITY.md). |
259
-
| `expected_turns` | *unset* | `>= 1` | **Soft** target for cumulative visible turns. Exceeding it warns and badges the report; it never aborts. See [`expected_turns`](#expected_turns-soft-efficiency-budget). |
258
+
| `max_turns` | *unset* | `> 0` | Hard cap on main-thread model API calls per iteration, Claude Code's turn, counted the same on every harness. The tools the last allowed call asks for still run; the turn ends when the next call begins. Each retry and each dialog exchange starts a fresh count. Unset uses the SDK default. See [HARNESS_PARITY.md](agents/HARNESS_PARITY.md). |
259
+
| `expected_turns` | *unset* | `>= 1` | **Soft** target for visible turns (tool calls plus the final reply) summed over the whole task, a different unit from `max_turns`. Exceeding it warns and badges the report; it never aborts. See [`expected_turns`](#expected_turns-soft-efficiency-budget). |
260
260
| `task_timeout` | *unset* | `>= 30` | Max seconds for the full run envelope, including agent work, grading, and post-run work. |
261
261
| `turn_timeout` | *unset* | `>= 10` | Max seconds for the agent's single `communicate()` iteration. |
@@ -327,8 +327,8 @@ that did: a budgeted task that failed counts as over budget, while tasks with no
327
327
`expected_turns`budget are excluded entirely (success or fail).
328
328
329
329
The count compared against the budget is **visible turns** — one per tool call
330
-
plus one for the agent's final reply — *not* the SDK's `total_turns` (which
331
-
counts assistant messages and can bundle several tool calls into one).
330
+
plus one for the agent's final reply. It is *not* `total_turns`, which counts
331
+
model API calls (the `max_turns` unit), and one call can batch several tool calls.
332
332
333
333
Set it to the number of turns a competent agent should need for the task. Pick
334
334
budgets consistently across a suite — the headline % is only comparable when
@@ -1721,7 +1721,7 @@ The simulator runs as a tools-disabled Claude Code agent on its own resolved `Ap
1721
1721
**Semantics:**
1722
1722
1723
1723
- The task's `initial_prompt` is the user's *opening* message; the simulator picks up from turn 2.
1724
-
- `max_turns`is the intra-dialog cap (the worst-case agent call budget per trial). Use `n_trials` for variance sampling.
1724
+
- `max_turns`caps exchanges. Each exchange also gets a fresh `run_limits.max_turns` of model API calls, so the worstcase per trial is the product of the two. Use `n_trials` for variance sampling.
1725
1725
- The `reference` solution, if present, is hidden from the simulator (same security posture as for the coding agent).
1726
1726
- When `n_trials > 1`, each trial becomes its own `ResolvedTask` with its own zero-padded replicate directory (`runs/<ts>/<variant_id>/<task_id>/<NN>/`) and its own `task.json` — the same fan-out mechanism as experiment `repeats`, which `n_trials` takes precedence over when simulation is enabled. Trial-level metadata appears under `simulation.replicate_index` / `simulation.n_trials` on the `EvaluationResult`.
| **Tool Enforcement** | Not enforced by Coder Eval wrapper | `enabled_tools` honored; `disabled_tools` NOT enforced by the SDK |
220
-
| **`max_turns`** | Native SDK turn cap (assistant messages) | Visible-turn cap (tool calls), enforced on the notification pump |
220
+
| **`max_turns`** | Model API calls: the CLI's `--max-turns`, plus a harness backstop | Model API calls, counted per `thread/tokenUsage/updated` and enforced on the notification pump |
221
221
| **Early stop** | Supported (cooperative `should_stop`, polled between messages) | Supported — polled after each streamed notification; the in-flight turn is interrupted best-effort |
222
222
223
223
Run-limit semantics per harness: [Run-Limit Parity](HARNESS_PARITY.md).
0 commit comments