fix(agent): default request concurrency to unlimited (#5572)

* fix(agent): default request concurrency to unlimited

* test(agent): clarify session serialization coverage
This commit is contained in:
chengyongru
2026-08-27 23:31:38 +08:00
committed by GitHub
parent 3c61fef7e8
commit 29025f5a8b
4 changed files with 51 additions and 4 deletions
+2 -2
View File
@@ -430,8 +430,8 @@ class AgentLoop:
("cron", self._cron_turns),
("local trigger", self._local_trigger_turns),
)
# NANOBOT_MAX_CONCURRENT_REQUESTS: <=0 means unlimited; default 3.
_max = int(os.environ.get("NANOBOT_MAX_CONCURRENT_REQUESTS", "3"))
# NANOBOT_MAX_CONCURRENT_REQUESTS: unset or <=0 means unlimited.
_max = int(os.environ.get("NANOBOT_MAX_CONCURRENT_REQUESTS", "0"))
self._concurrency_gate: asyncio.Semaphore | None = (
asyncio.Semaphore(_max) if _max > 0 else None
)