Describe the problem
When running unsupervised/scheduled agentic workflows that involve tool calls, there is currently no built-in way to enforce an upper token limit on the full multi-turn loop. Without this, a runaway loop can consume far more tokens than intended with no mechanism to stop it gracefully.
Desired behavior
It would be useful to have a supported way to:
- Set a hard token budget for the entire tool call loop, causing it to stop (and error/fail gracefully) if the limit is exceeded.
- Optionally inject a system-level message (e.g. "You are approaching your token limit — wrap up your response now") once a soft threshold is reached, giving the model a chance to return a partial result rather than hard-stopping.
Use case
Unsupervised scheduled reports with tool access, where cost/token control is a requirement to prevent silent runaway.
Describe the problem
When running unsupervised/scheduled agentic workflows that involve tool calls, there is currently no built-in way to enforce an upper token limit on the full multi-turn loop. Without this, a runaway loop can consume far more tokens than intended with no mechanism to stop it gracefully.
Desired behavior
It would be useful to have a supported way to:
Use case
Unsupervised scheduled reports with tool access, where cost/token control is a requirement to prevent silent runaway.