Skip to content

feat: raise agent iteration turn budgets (30/20/50 → 100/100/200) - #906

Merged
agentforce314 merged 1 commit into
agentforce314:mainfrom
fxinfo24:fix/raise-agent-turn-budgets
Aug 26, 2026
Merged

feat: raise agent iteration turn budgets (30/20/50 → 100/100/200)#906
agentforce314 merged 1 commit into
agentforce314:mainfrom
fxinfo24:fix/raise-agent-turn-budgets

Conversation

@fxinfo24

Copy link
Copy Markdown
Contributor

feat: raise agent iteration turn budgets (30/20/50 → 100/100/200)

Why

Split out from PR #903 (#903) at review request:
these constant bumps are independent of the compaction work and are easier
to review / revert on their own.

Real motivation: in practice, long multi-step agentic runs were hitting the
existing turn ceilings and truncating genuine work before it finished:

  • SUBAGENT_DEFAULT_MAX_TURNS 30 → 100 — subagents (no explicit limit)
    aborted mid-task on multi-step work.
  • DEFAULT_GOAL_MAX_TURNS 20 → 100 — /goal runs exhausted the budget
    before completing multi-step tasks.
  • QueryConfig.max_turns (and frozen twin) 50 → 200 — query/agent loops
    capped mid-run on longer sessions.
  • DEFAULT_MAX_TURNS 50 → 200 — interactive session ceiling (shared with
    --max-turns CLI flag), capped mid-task on long runs.

These are 2–4x increases to iteration budgets. They are not required
by the cost-aware compaction path (that feature degrades gracefully when
pricing is unavailable and works at any budget); they simply give real
agentic work room to finish.

Changes

Constant Before → After File
SUBAGENT_DEFAULT_MAX_TURNS 30 → 100 src/agent/run_agent.py
DEFAULT_GOAL_MAX_TURNS 20 → 100 src/goals/goals.py
QueryConfig.max_turns 50 → 200 src/query/config.py (line 13)
FrozenQueryConfig.max_turns 50 → 200 src/query/config.py (line 44)
DEFAULT_MAX_TURNS 50 → 200 src/server/agent_server.py

Verification

  • All five constants are simple integer literals; no call-site logic changed.
  • Syntax-validated the four touched modules (ast.parse).

Note for reviewers

These are pure constant bumps with no behavioral logic. If the larger
budgets are undesirable (e.g. cost/runaway-loop concerns), they revert
cleanly as a unit. Reverting this PR does not affect the compaction work
in #903.

Long multi-step agentic runs were hitting the turn ceilings and
truncating real work. Raises SUBAGENT_DEFAULT_MAX_TURNS 30->100,
DEFAULT_GOAL_MAX_TURNS 20->100, QueryConfig/FrozenQueryConfig.max_turns
50->200, and DEFAULT_MAX_TURNS 50->200. Independent of the compaction
work in agentforce314#903; split out for separate review/revert.
@fxinfo24

Copy link
Copy Markdown
Contributor Author

Split out from #903 at review request — these five max-turn constant bumps are independent of the compaction work and are easier to review/revert on their own. Rationale and the full before→after table are in the PR description.

@github-actions

Copy link
Copy Markdown

Test Results

     5 files     997 suites   27m 43s ⏱️
15 374 tests 15 349 ✅ 19 💤 6 ❌
31 022 runs  30 956 ✅ 58 💤 8 ❌

For more details on these failures, see this check.

Results for commit 0e2c51d.

@agentforce314

Copy link
Copy Markdown
Owner

LGTM. Thanks!

@agentforce314
agentforce314 merged commit beea0e8 into agentforce314:main Aug 26, 2026
4 of 8 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.

2 participants