Skip to content

[F11] Raise default max_turns.execute_analyze; emit warning when bundle implies high BUILD count #256

@sriumcp

Description

@sriumcp

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)

  1. After DESIGN emits a bundle, count len(bundle.code_changes) (or measure the projected patch size if available).
  2. If above a threshold (e.g., ≥5 files), emit a warning suggesting a max_turns.execute_analyze raise.
  3. 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

  • When the bundle implies high BUILD count, nous emits a warning suggesting a max_turns.execute_analyze raise (or auto-raises with a log).
  • Documented in nous schema reference and design-phase docs.
  • (Stretch / separate issue) graceful continuation across max_turns aborts.
  • Friction report F11 row in the tracking issue checks off.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfriction-reportFrom external campaign-author friction reports

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions