Skip to content

Delete the turn-budget mechanism and deprecate task() (CL-7004) - #625

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-7004-delete-the-turn-budget-mechanism-entirely-and-mark-task
Aug 24, 2026
Merged

Delete the turn-budget mechanism and deprecate task() (CL-7004)#625
TheGreatAxios merged 1 commit into
mainfrom
cl-7004-delete-the-turn-budget-mechanism-entirely-and-mark-task

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

No max turns anywhere. Net 147 insertions / 1436 deletions (−1289) across 71 files.

Peer coding agents have no turn cap — one resolves max-steps to Infinity unless an operator opts in, the other has no turn-count constant in its loop. Both end a run on the model's own finish signal, an operator interrupt, or a hard error. Ours ended runs on a turn count that truncated real work: a measured healthy lane used 59 assistant turns, 58 carrying tool calls, with a clean final report — which explore (35), critique (45) and every 40 would have killed; intern (20) three times over.

Removed

  • Director packagesnudge.maxTurns from all 17
  • Resolution chainresolveSubAgentMaxTurns, resolveDefaultSubAgentMaxTurns, clampSubAgentMaxTurns, validateTaskMaxTurns, Settings.subagentMaxTurns and its schema/load/save plumbing
  • StopssubAgentTurnLimitExceeded, the turn-budget stop reason and report text, TURN_BUDGET_STOP_AFTER_DISPATCHES, shouldStopTurnBudgetRedispatch, the turn-budget branch of appendSubAgentParentHints
  • Wrap-upthrashForceReport, evaluateThrashStop, report-forced, REPORT_FORCED_WRAP_UP_NUDGE
  • Tool argsmaxTurns on task() and spawn_agent, plus the profileMaxTurns threading added in Thread the director package turn budget through spawn_agent (CL-7001) #622
  • ConfigAgentProfile.maxTurns and its arktype schema entry
  • DiagnosticsInterventionRecord.state.maxTurns and the forensics "early stop" column that read it
  • Eval harness — the global soft turn-budget rubric: evaluateSoftBudget, overBudget, budgetError, OVER_BUDGET, --max-turns, and maxTurns from all four tier cases

Why the eval rubric went too

It never stopped an agent — it failed a case after the fact for exceeding 15/25/30/40 turns. Since the healthy reference run took 59, the instrument we planned to measure this release with would have scored a correct, complete run as a failure at every tier. --agent-timeout-ms is retained as the per-eval bound, and turnsUsed is still captured and reported — just no longer part of pass/fail. Verdict is now agentExitCode === 0 && verify.exitCode === 0 && requireBehaviorCheck.ok, which still fails closed on a broken run.

On report-forced

Deleted rather than kept as a plain turn-count nudge. Without maxTurns there is no denominator for "near budget", so a nudge keyed to an arbitrary turn number would be a new limit wearing guidance clothing.

task() deprecation

Marked deprecated in both the model-visible tool description and code, pointing at spawn_agent/wait_agents. Not removed — much still routes through it. This is what CL-6942 specified: available during migration, then removed.

Prompt text

The bullet teaching the model to pass maxTurns and re-dispatch with a higher one is replaced with guidance on the real judgement: if a worker comes back without finishing, change the brief rather than repeating it — narrow the scope, name the files, or state the done-when more sharply. Prompts guide output quality; code does enforcement.

Also swept

Stale comments in intervention-log.ts, session-store.ts, fleet-report.ts, report.ts and tool-execution-watchdog.ts asserting deleted mechanisms. explore's prompt claim that "the default budget is real" is gone. 15 package tests asserting specific budget numbers deleted rather than weakened.

Gate

bun run check green: 5278 pass, 0 fail — including the vendor reactor snapshot test that fails on main.

Follow-up filed: CL-7006 — stopReasonFromReport still parses stop reasons out of report prose, a second source of truth #610 was meant to end.

No max turns anywhere. Peer coding agents have no turn cap: they end a
run on the model's own finish signal, an operator interrupt, or a hard
error. Ours ended runs on a turn count that truncated real work -- a
measured healthy lane used 59 assistant turns with a clean report, which
explore (35), critique (45) and every 40 would have killed.

Removed: nudge.maxTurns from all 17 director packages, the whole
resolution chain (resolveSubAgentMaxTurns, resolveDefaultSubAgentMaxTurns,
clampSubAgentMaxTurns, validateTaskMaxTurns, settings.subagentMaxTurns),
subAgentTurnLimitExceeded and the turn-budget stop reason, the
TURN_BUDGET re-dispatch ledger branch, thrashForceReport/report-forced,
AgentProfile.maxTurns and its schema, the maxTurns arg on task() and
spawn_agent, the intervention-log state.maxTurns field, and the eval
harness's global soft turn-budget rubric (evaluateSoftBudget/overBudget)
which failed cases for exceeding a turn count.

task() is marked deprecated in favour of spawn_agent/wait_agents.
--agent-timeout-ms is retained as the per-eval bound. Prompt text that
taught the model to operate the budget is replaced with guidance on
sharpening a brief instead.
@linear-code

linear-code Bot commented Aug 24, 2026

Copy link
Copy Markdown

CL-7004

@TheGreatAxios
TheGreatAxios enabled auto-merge (squash) August 24, 2026 14:29
@TheGreatAxios
TheGreatAxios merged commit 4b543f4 into main Aug 24, 2026
5 checks passed
TheGreatAxios added a commit that referenced this pull request Aug 27, 2026
No max turns anywhere. Peer coding agents have no turn cap: they end a
run on the model's own finish signal, an operator interrupt, or a hard
error. Ours ended runs on a turn count that truncated real work -- a
measured healthy lane used 59 assistant turns with a clean report, which
explore (35), critique (45) and every 40 would have killed.

Removed: nudge.maxTurns from all 17 director packages, the whole
resolution chain (resolveSubAgentMaxTurns, resolveDefaultSubAgentMaxTurns,
clampSubAgentMaxTurns, validateTaskMaxTurns, settings.subagentMaxTurns),
subAgentTurnLimitExceeded and the turn-budget stop reason, the
TURN_BUDGET re-dispatch ledger branch, thrashForceReport/report-forced,
AgentProfile.maxTurns and its schema, the maxTurns arg on task() and
spawn_agent, the intervention-log state.maxTurns field, and the eval
harness's global soft turn-budget rubric (evaluateSoftBudget/overBudget)
which failed cases for exceeding a turn count.

task() is marked deprecated in favour of spawn_agent/wait_agents.
--agent-timeout-ms is retained as the per-eval bound. Prompt text that
taught the model to operate the budget is replaced with guidance on
sharpening a brief instead.
TheGreatAxios added a commit that referenced this pull request Aug 27, 2026
No max turns anywhere. Peer coding agents have no turn cap: they end a
run on the model's own finish signal, an operator interrupt, or a hard
error. Ours ended runs on a turn count that truncated real work -- a
measured healthy lane used 59 assistant turns with a clean report, which
explore (35), critique (45) and every 40 would have killed.

Removed: nudge.maxTurns from all 17 director packages, the whole
resolution chain (resolveSubAgentMaxTurns, resolveDefaultSubAgentMaxTurns,
clampSubAgentMaxTurns, validateTaskMaxTurns, settings.subagentMaxTurns),
subAgentTurnLimitExceeded and the turn-budget stop reason, the
TURN_BUDGET re-dispatch ledger branch, thrashForceReport/report-forced,
AgentProfile.maxTurns and its schema, the maxTurns arg on task() and
spawn_agent, the intervention-log state.maxTurns field, and the eval
harness's global soft turn-budget rubric (evaluateSoftBudget/overBudget)
which failed cases for exceeding a turn count.

task() is marked deprecated in favour of spawn_agent/wait_agents.
--agent-timeout-ms is retained as the per-eval bound. Prompt text that
taught the model to operate the budget is replaced with guidance on
sharpening a brief instead.
@TheGreatAxios
TheGreatAxios deleted the cl-7004-delete-the-turn-budget-mechanism-entirely-and-mark-task branch August 28, 2026 00:09
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