Repository navigation
feat(codemode): remove hardcoded agent() and llm() run limits - #67267
Conversation
There was a problem hiding this comment.
Looks good. I ran the new tests against the base: the 16-agent and 32-llm() concurrency tests hang (the old limit holds calls back) and the 101-agent test fails on the old total cap. With this PR, test/codemode/agents.test.ts and test/codemode-agents-e2e.test.ts pass 17 of 17.
Public API: the SDK, server, config and plugin API are unchanged. The LIMITS export from codemode/agents.ts is removed, but nothing else in the repo used it. The prompt guide and skill text no longer mention the limits.
One thing to keep in mind, not blocking: with no concurrency cap, a script that runs Promise.all(items.map(agent)) starts every call before any of them can fail. The usage/rate-limit check then stops only later calls and retries; calls already running continue. That fits the plan to design shared bounds separately.
Summary
Removes Code Mode's hardcoded per-run caps on
agent()andllm(): 16 concurrent / 100 total agents and 32 concurrent / 500 totalllm()calls. Calls now start whenever the script starts them instead of waiting on or failing against a fixed limit.The usage/rate-limit circuit breaker is kept: after any call fails with a usage, quota or rate limit, no more calls start in that run.
retriesstill retries failures that are not limits.Guarded by the existing
codemode_agentsfeature flag.Context
Supersedes #67221 per the
#corediscussion with Adam, Kit and Aiden: hardcoded per-run caps on Code Modeagent()andllm()are not needed right now. Unified, configurable bounds shared withsubagentwill be designed separately.Verification
bun typecheckinpackages/core: no type errorsbun run test test/codemode/agents.test.ts test/codemode-agents-e2e.test.tsinpackages/core: 17 pass, 0 failbun run checkfrom the worktree root: 37/37 tasks successfulTests
agent()calls run concurrentlyllm()calls run concurrentlyagent()calls in one runretries