Repository navigation
feat(subagents): add optional budgets and runtime limits - #1044
Closed
KB (KB-syntheticsciences) wants to merge 12 commits into
Closed
KB (KB-syntheticsciences) wants to merge 12 commits into
KB (KB-syntheticsciences) wants to merge 12 commits into
Conversation
Use USD allowances for priced local proxies. Reacquire returned grants through ancestor capacity, expose that capacity to continuation controls, and retain accounting in model-facing handoffs and compacted receipts. Add regressions for these cases and for cross-process allocation and reservation races.
The admission guard priced all input and output at the highest rate across every speed, rejecting Standard calls before dispatch. Share normal context pricing, bound input and output separately, and reserve replay growth before the final handoff. Pass the selected speed through physical-call admission and expose each worker grant and estimated rejection minimum. Add Standard, Fast, replay-growth and actual Task regressions.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Release definite request rejections without releasing ambiguous accepted work. Estimate text, images, PDF pages and offered tool schemas consistently before preparation and physical dispatch; keep JSON tool output counted as text. Preserve deadline stops through stream cleanup and late reservation failures. Document mandatory runtime guards and the trusted local approval boundary.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do, and why?
Add opt-in bounded runs for delegated subagents. Users choose a model policy, shared conversation allowances for paid calls or subscription tokens, and assignment deadlines. The main agent stays outside these limits. Bounded runs remain off by default.
The runtime reserves each request before dispatch, returns definite rejection reservations, retains uncertain outcomes and stops work at its deadline. Input estimates count text, images, PDF pages and offered tool schemas without treating encoded media bytes as text. Worker reports retain partial output, command evidence, usage and the actual stop reason. A user can increase an allowance and continue the same worker; the lead assesses whether its result meets the objective.
Cancellation, background delivery, inheritance, explicit CLI model selection, retries, nesting and recovery preserve the assignment contract. Database connections finalize their statements before closing so Windows can release the files. ADR 0002 explains why runtime limits are independent of optional harness guidance and documents the trusted local API boundary: these controls do not isolate untrusted same-user code with control API or ledger-file access.
Linked issue
ROADMAP.mditem 14 — worker contracts and limits.How did you verify it?
96b00f33: Deep CI, Fast CI, browser E2E, runtime compatibility and secret scanning.Checklist
Keep this PR as a draft for reviewer approval. The protected-main packaged rehearsal remains an integration gate; it does not publish packages. No merge or release is authorized by this preparation.