Sub-agent depth and tree budget limits #9

Closed
opened 2026-05-07 01:28:09 -04:00 by jasoncouture · 3 comments
jasoncouture commented 2026-05-07 01:28:09 -04:00 (Migrated from github.com)

Configurable max spawn depth plus a per-tree budget so a runaway parent agent (or a malicious one) can't infinitely recurse.

Depends on sub-agents (#8).

Tracked in TASKS.md.

Configurable max spawn depth plus a per-tree budget so a runaway parent agent (or a malicious one) can't infinitely recurse. Depends on sub-agents (#8). Tracked in [TASKS.md](../blob/main/TASKS.md).
Keesan12 commented 2026-05-19 16:25:21 -04:00 (Migrated from github.com)

Sub-agent depth limits are a good start, but I’d pair tree depth with a parent-owned admission policy.

Otherwise you can still get a shallow tree that wastes budget because every child keeps getting admitted into low-value retries. The useful gate tends to be: does the parent still have budget, is the current branch verifier-clean enough to continue, and is there a concrete reason another child is justified?

That’s been the better pattern for us than just counting descendants. The depth limit protects the shape of the tree; the admission gate protects the spend.

Sub-agent depth limits are a good start, but I’d pair tree depth with a parent-owned admission policy. Otherwise you can still get a shallow tree that wastes budget because every child keeps getting admitted into low-value retries. The useful gate tends to be: does the parent still have budget, is the current branch verifier-clean enough to continue, and is there a concrete reason another child is justified? That’s been the better pattern for us than just counting descendants. The depth limit protects the shape of the tree; the admission gate protects the spend.
jasoncouture commented 2026-05-21 19:47:57 -04:00 (Migrated from github.com)

That's a great question, to be honest, I'm not quite sure where I'm going yet. I didn't use projects and wanted to advertise stuff that could be picked up (thinking no one would look at this until I was much further along).
Having a parent budget was definitely always in the cards. There are (though I'd personally never let it go more than 2 deep) some cases where a deep sub-agent tree is helpful.
My thought here was: N sub agents with a maximum depth of M, the total cannot exceed N.

That's a great question, to be honest, I'm not quite sure where I'm going yet. I didn't use projects and wanted to advertise stuff that could be picked up (thinking no one would look at this until I was much further along). Having a parent budget was definitely always in the cards. There are (though I'd personally never let it go more than 2 deep) some cases where a deep sub-agent tree is helpful. My thought here was: N sub agents with a maximum depth of M, the total cannot exceed N.
jasoncouture commented 2026-05-23 16:25:39 -04:00 (Migrated from github.com)

Closing — going with a flat depth limit of 1. Sub-agents won't have the spawn tool in their toolset, so a sub-agent simply can't spawn further sub-agents. No per-tree budget needed.

Closing — going with a flat depth limit of 1. Sub-agents won't have the spawn tool in their toolset, so a sub-agent simply can't spawn further sub-agents. No per-tree budget needed.
Sign in to join this conversation.
No description provided.