Skip to content

feat: host-selected agent loop budget (--max-model-turns) recorded in the Run manifest - #70

Merged
SonAIengine merged 2 commits into
mainfrom
feat/run-model-turn-budget
Sep 30, 2026
Merged

SonAIengine merged 2 commits into
mainfrom
feat/run-model-turn-budget

Conversation

@SonAIengine

Copy link
Copy Markdown
Contributor

Why

Workspace discovery runs had a hardcoded budget of 8 turns / 16 calls / 8 steps / 8 tool calls. On expharness, 3 of 96 agentic candidate runs (09-29~30) ended as PAUSED reason=quiescent at this bound; one of them had passed its self-check on turn 8. Resume cannot extend the budget, because it is recorded in the manifest and verify_manifest_state checks it.

What

  • run --max-model-turns <TURNS> (1..=4096). Calls, planned steps and tool calls scale 2:1:1, the same ratio as workspace_discovery. The context bound is unchanged.
  • The budget is recorded in the manifest at creation, so resume keeps it. Runs without the flag keep the built-in budget.
  • Single-shot runs reject the flag with exit 64 before any state is created.
  • run --help advertises it as XGENY_RUN_BUDGET=manifest-model-turns-v1.

Branched from ae7ffe8 (the currently deployed binary) so it can ship without #69.

Tests

cargo test -p xgeny-cli and cargo clippy -p xgeny-cli --all-targets -- -D warnings pass. New tests cover manifest ratio, bounds and round trip; budget selection; the help marker; clap bounds; and the manifest record through a real run.

🤖 Generated with Claude Code

SonAIengine and others added 2 commits September 30, 2026 14:55
…-max-model-turns)

Workspace discovery runs had a fixed 8 model turns / 16 calls / 8 planned steps / 8 tool calls.
On expharness (09-29~30) 3 of 96 agentic candidate runs ended as PAUSED reason=quiescent at
that bound; one had just passed its own check on turn 8. Resume could not help because the
budget is recorded in the manifest and verified against the run state.

- run --max-model-turns <TURNS> (1..=4096): model calls, planned steps and tool calls scale
  2:1:1 like workspace_discovery; the context bound is unchanged
- the budget is written into the manifest at run creation, so resume and verify_manifest_state
  keep it; runs without the option keep the built-in budget
- refused (exit 64, before state) for single-shot runs, which have no agent loop to extend
- advertised in run --help as XGENY_RUN_BUDGET=manifest-model-turns-v1 for host detection

Tests: manifest ratio/bounds/round trip, budget selection, help marker, clap bounds, manifest
record through a real run. cargo test -p xgeny-cli and clippy -D warnings pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SonAIengine
SonAIengine merged commit 389d772 into main Sep 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant