Problem
The default max_turns.execute_analyze is 120. For a non-trivial campaign that builds many net-new components, this is insufficient and the SDK turn aborts mid-work with subtype=error_max_turns.
In paper-memorytime-mirage iter-1, the executor turn ran 24 minutes / 121 turns building 6 net-new schedulers (VTC, decode-token, RR, KV-quota, head-of-line, KV-time-greedy + a meter, bucket, and runner) and a smoke trace. nous detected the abort and retried — but ~24 minutes of compute and a non-trivial token spend were lost on the failed turn before the retry began. Some on-disk work survived; the agent context did not.
Desired behavior
Two complementary improvements:
(1) Soft warning at design time when bundle implies high BUILD count. When the DESIGN agent emits a bundle that implies many net-new files / large patches (e.g., bundle.code_changes lists ≥5 files, or the patch is projected to be ≥1000 lines), nous emits a warning recommending a max_turns.execute_analyze raise:
Bundle implies ~6 net-new files in EXECUTE_ANALYZE. Default max_turns.execute_analyze=120 is likely insufficient. Consider setting max_turns.execute_analyze: 200 in your campaign.yaml.
This warning fires regardless of --auto-approve.
(2) Graceful continuation across error_max_turns retries. Today when the SDK turn hits max_turns, the next turn restarts fresh. Partial work in the worktree is preserved but the agent's context isn't. A graceful-continuation mode would:
- At max_turns abort, capture the agent's current scratchpad / TODO list / partial diff into a structured
resume_handoff.md in the work_dir.
- On retry, the SDK turn loads
resume_handoff.md as part of its initial context and continues from there.
(2) is more substantial; (1) is a tractable first step.
Suggested implementation sketch for (1)
- After DESIGN emits a bundle, count
len(bundle.code_changes) (or measure the projected patch size if available).
- If above a threshold (e.g., ≥5 files), emit a warning suggesting a
max_turns.execute_analyze raise.
- Optionally: auto-raise
max_turns.execute_analyze to a heuristic value (e.g., 120 + 30 * len(code_changes)) and log the auto-raise.
Acceptance criteria
Severity
MEDIUM — costs ~1.5× of a single clean run when triggered.
Source
friction-report.md F11, paper-memorytime-mirage campaign (2026-05).
Part of friction-report tracking issue #245.
Problem
The default
max_turns.execute_analyzeis 120. For a non-trivial campaign that builds many net-new components, this is insufficient and the SDK turn aborts mid-work withsubtype=error_max_turns.In paper-memorytime-mirage iter-1, the executor turn ran 24 minutes / 121 turns building 6 net-new schedulers (VTC, decode-token, RR, KV-quota, head-of-line, KV-time-greedy + a meter, bucket, and runner) and a smoke trace. nous detected the abort and retried — but ~24 minutes of compute and a non-trivial token spend were lost on the failed turn before the retry began. Some on-disk work survived; the agent context did not.
Desired behavior
Two complementary improvements:
(1) Soft warning at design time when bundle implies high BUILD count. When the DESIGN agent emits a bundle that implies many net-new files / large patches (e.g., bundle.code_changes lists ≥5 files, or the patch is projected to be ≥1000 lines), nous emits a warning recommending a
max_turns.execute_analyzeraise:This warning fires regardless of
--auto-approve.(2) Graceful continuation across
error_max_turnsretries. Today when the SDK turn hits max_turns, the next turn restarts fresh. Partial work in the worktree is preserved but the agent's context isn't. A graceful-continuation mode would:resume_handoff.mdin the work_dir.resume_handoff.mdas part of its initial context and continues from there.(2) is more substantial; (1) is a tractable first step.
Suggested implementation sketch for (1)
len(bundle.code_changes)(or measure the projected patch size if available).max_turns.execute_analyzeraise.max_turns.execute_analyzeto a heuristic value (e.g.,120 + 30 * len(code_changes)) and log the auto-raise.Acceptance criteria
max_turns.execute_analyzeraise (or auto-raises with a log).Severity
MEDIUM — costs ~1.5× of a single clean run when triggered.
Source
friction-report.mdF11, paper-memorytime-mirage campaign (2026-05).Part of friction-report tracking issue #245.