Skip to main content
Every turn runs under fixed ceilings so a model in a long tool loop cannot run up cost or time without bound. A turn is one request to the model and everything it does to answer: its model calls, tool calls and sub-agents. Two budgets are configurable in the [tools] section of ~/.stampede/config.toml. Time limits are set per profile and per command.

Turn budgets

A value outside the range is refused when the file loads, with the key named. Every model call re-sends the conversation so far, so input grows with each round of a tool loop, and the count includes cache reads in full. On a large-window model turn_input_tokens can end a turn before turn_model_calls does, so raising turn_model_calls alone may not lengthen the turn. A repository task such as editing a site, building it and opening a pull request needs about:
Two more per-turn limits are fixed: 100 tool calls and 100,000 output tokens. The budgets cover the whole turn: the parent and all of its sub-agents draw from them. They apply to turns this machine starts: console and TUI turns, stampede agent, goal episodes, and a person’s runs for mail, gateway requests and schedules. A task room has no budget of its own; each wake is one run under these limits. A request from a paired machine gets at most the smaller of your value and the default (26 calls, 500,000 tokens). Raising the keys never widens a peer’s run, and lowering them binds it too. A resumed run keeps the limits recorded when it started.

budget_exhausted

A finished run carries a stop word, shown by stampede runs show RUN_ID as a stop: line and by stampede agent as [stopped: WORD] on stderr. budget_exhausted means the run reached a budget other than time: the model calls, the input tokens, the tool calls or the output tokens. wall_clock means it reached its time limit. At either limit the run makes one closing call with no tools and asks the model for a handoff summary in three parts:
That summary is the run’s answer. If the closing call fails, the run says so in a fixed line instead. When runs stop with budget_exhausted on work you expect to finish, raise the budget that was reached.

Turn time limit

Each profile has a wall-clock limit for one turn, set with timeout_secs on the profile:
The default is 300 seconds, and 1800 seconds for a session provider. One extra minute is kept for the closing summary. Sub-agents share their parent’s deadline.

Command timeout

A command started with run_command stops after 60 seconds unless the call asks for longer with its timeout_secs argument, up to 1800 seconds. The limit is never past the time the run has left, so a command can run only as long as the turn time limit allows. There is no configuration key for it. The model passes timeout_secs when it expects a long command, and you can ask for it in the task:
For a build that takes ten minutes, raise the profile’s timeout_secs as well (for example to 900), or the turn ends first. A command stopped at its limit has its process group stopped. The run gets a timed-out result with what the command printed and goes on; the command may have changed files before it stopped. start_command runs a command in the background with no default limit. Sub-agents of a person run commands in the foreground only, under the same limit.

Applying changes

The configuration is read when a process starts. After editing config.toml:
stampede doctor prints the loaded values in its config row (turn_model_calls = N; turn_input_tokens = N). stampede service restart restarts the installed workers (node, schedule, gateway, webhook), which serve person runs. Name one to restart only that worker, as in stampede service restart gateway. Open consoles keep the values they started with; start a new one.