Skip to content

Raise headless run budgets: MaxTurns 100→1000, MaxToolCalls 400→4000, and a larger default timeout #72

Closed

Description

@JAORMX

Motivation

The default session budgets are tuned for interactive use and are too tight for the headless, autonomous path (mecatequi solving a GitHub issue end-to-end). A real run hit the wall: a mecatequi run on a non-trivial atrium issue spent ~14 min exploring the codebase, reached turn 100 (stop=max_turns), and produced no patch — and because it was also near the 15-min wall-clock, both ceilings bit at once. The honest-failure path then mislabeled it (separate bug, filed elsewhere), but the root cause is the budget.

How we compare to other coding agents (turn = one LLM round-trip)

Agent Default turn cap
LangChain AgentExecutor (interactive) 15
mecatl (today) 100
Gemini CLI 100/stream (+ unlimited session)
OpenHands (autonomous issue→PR, closest analog) 500
Goose 1000
Claude Agent SDK / Codex CLI no cap (token-bounded)

The agents that cap low all keep a human in the loop to click "continue." A headless agent has nobody, so it belongs with the autonomous crowd (OpenHands 500, Goose 1000), not the interactive one. We want to match Goose at 1000.

Proposed changes

All three constants live in internal/app/build.go:83 and feed defaultLimits() (build.go:~4750), shared by mecatequi, mecated, and mecatui via service.go's zero-Limits substitution.

  1. defaultMaxTurns 100 → 1000 — match Goose.

  2. defaultMaxToolCalls 400 → 4000 — this must move with the turn cap. Today the ratio is 4 tool-calls/turn (400/100). If turns go to 1000 but tool-calls stays at 400, tool-calls becomes the new binding cap at ~turn 400 and the turn increase is mostly inert. Keeping the 4:1 ratio (→ 4000) preserves the intent. (Open to a different multiplier — 4:1 is just today's ratio held constant.)

  3. Leave defaultMaxConsecutiveFailures at 5. That's a distinct safety mechanism (it catches a stuck/erroring loop, resets on success); raising it would let a broken run thrash longer. Out of scope.

Timeout — two coupled ceilings, raise both

A bigger turn budget is useless if wall-clock kills the run first. The headless path has two timeouts that must move together (agent timeout strictly below job timeout, or the job SIGKILLs the binary mid-run with no summary):

  • Agent --timeout — default 15m on the composite action (.github/actions/mecatequi/action.yml) and the reusable-workflow input (.github/workflows/mecatequi-reusable.yml). Propose 30m–40m default for the headless path.
  • Reusable-workflow implement job timeout-minutes: 20 — must exceed the agent timeout. Propose 45m (agent 40m < job 45m).

(Consumers can already override the agent timeout via the reusable-workflow input; this is about the default so the out-of-the-box headless experience isn't artificially fenced.)

Notes / scope

  • All three binaries share the constants, so the turn/tool-call change is one edit in build.go. The timeout change is in mecatl's .github/ (reusable workflow + action defaults), not the binary.
  • The field trend is to bound by tokens/cost rather than turns (SWE-agent uses a $/instance budget; Codex/Claude SDK don't cap turns). --max-run-tokens already exists for that. Raising the turn/tool-call caps + timeout is the minimal fix; a follow-up could make tokens the primary bound and keep turns as a high runaway-loop backstop. Not required here.
  • Possible related follow-up (not required for this issue): expose --max-turns as a flag on mecatequi + a reusable-workflow input, mirroring mecated's existing per-request Limits.max_turns override. Mentioned for completeness.

Found via

mecatequi headless run on a real atrium issue hitting both stop=max_turns (100) and the 15-min wall-clock.

Activity

  1. added
    enhancement
    on Jun 16, 2026
  2. added a commit that references this issue on Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions