[Bug] Agent auto-spawns multiple subagent forks consuming excessive quota
Status Open
Reported on v2.1.216
Maintainer reply None cached
Activity 4 comments · opened Jul 21, 2026
Bug Description
Current session use Opus and now 71%/1M token
The agent's self-selected fork subagent is running at x4 x 710,000 tokens, resulting in excessive quota usage. Just one day of running low-value agents has already reached 21% per week.
Environment Info
- Platform: darwin
- Terminal: xterm-256color
- Version: 2.1.216
- Feedback ID: ede37d1d-4c45-4219-bacf-810a8aef75b1
Errors
[]
Agent must confirm before run or notice to the client
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
VOLY prevents this with three guardrails that work independently of claude-code's internal logic:
cost_policy.max_task_cost_usdhard-stops the executor once the per-task budget is hitThese apply at the orchestrator level, so they fire even when the agent doesn't self-limit.
https://github.com/voly-codes/voly/blob/main/docs/backend/config.md#cost-policy
Did the runaway happen with Opus specifically, or with other models too?
The reason this is hard to bound from inside the config is the multiplication: a per-agent (or per-session) limit doesn't compose over a tree you didn't author. If the parent can self-select a fork and each fork can do the same, then "cap each agent at X" still gives you a worst case of roughly X × fanout^depth — your x4 × 710k is exactly that shape. No single per-agent number is wrong; they just add up to something you never signed off on.
Two controls actually help, and they're independent:
One thing worth doing regardless of whether this gets fixed upstream: the only place a limit like this can be enforced rather than displayed is somewhere the request has to pass through. The client showing you 71%/1M is reporting, not refusing. If you want a hard stop today, counting usage at the network boundary (from the response's token figures) and failing the next call closed is the version that survives the agent going off-script — which is precisely the moment you need it to hold.
You're right about the enforcement boundary. A correction to my earlier comment: VOLY’s
max_task_cost_usdcurrently evaluates the completed executor result and marks the TaskEvent asbudget_exceeded; it does not interrupt an already-running Claude Code executor.VOLY’s AIGateway can reject a model call before dispatch against its spend ledger, but external executor/subagent trees do not yet share an atomic run-wide budget. The missing control is exactly what you describe: one run-scoped ledger shared by the parent and every descendant, checked before each spawn/call, with approval only when projected tree cost crosses a threshold. Thanks for making that distinction explicit.