4 Commits

Author SHA1 Message Date
chengyongru
c30e4d86f3 refactor(agent): simplify subagent concurrency with rejection over semaphore
Replace the asyncio.Semaphore queueing approach with a simple count
check in SpawnTool.execute(). When the concurrency limit is reached,
the tool returns an error string so the agent can perceive the reason
and adjust its behavior instead of silently queueing.

- Remove max_concurrent_subagents parameter threading through
  AgentLoop, commands.py, and nanobot.py
- SubagentManager reads the limit directly from AgentDefaults
- SpawnTool checks get_running_count() before calling spawn()
- Simplify tests to verify rejection behavior
2026-05-05 22:22:04 +08:00
Xubin Ren
539d82eadc test(tools): accept spawn origin message context
Made-with: Cursor
2026-05-01 20:09:59 +08:00
chengyongru
409afe1a3d test(tools): add basic regression tests for ContextVar routing context 2026-04-21 13:25:30 +08:00
jr_blue_551
ff8c28d5a8 agent: use ContextVar for tool routing context 2026-04-21 13:25:30 +08:00