The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs(gateway): state the real bound on concurrent turn threads
kshitijk4poor1b00d0ad7b6b
diff --git a/gateway/run.py b/gateway/run.pyindex f413722c5e2..3ac0e5e43fd 100644--- a/gateway/run.py+++ b/gateway/run.py@@ -59,9 +59,10 @@ _TELEGRAM_CONNECT_TIMEOUT_SECS_DEFAULT = 180.0_TELEGRAM_INITIAL_CONNECT_TIMEOUT_SECS_DEFAULT = 45.0_ADAPTER_DISCONNECT_TIMEOUT_SECS_DEFAULT = 5.0# Size of the pool that runs turn bodies (blocking agent work). ``None`` = unbounded: a turn body-# holds its thread for the whole turn (every tool call blocks), so a finite pool silently queues-# turns that were already accepted behind whichever bodies are running, with nothing in the logs.-# Concurrency is bounded where turns are ADMITTED (``max_concurrent_sessions``), not here.+# holds its thread for the whole turn (every tool call blocks), so a finite pool silently queued+# already-accepted turns behind running ones. Actual bound: one live turn per session, plus turns+# abandoned by the inactivity timeout (run_turn keeps no handle; their thread runs to completion).+# ``max_concurrent_sessions`` is the only admission cap and is unset by default._TURN_MAX_WORKERS = None# Size of the separate pool for best-effort session HOUSEKEEPING; why it is separate: _run_housekeeping_in_executor._HOUSEKEEPING_MAX_WORKERS = 4diff --git a/website/docs/user-guide/configuration.md b/website/docs/user-guide/configuration.mdindex 1883092fe08..73efc481bfe 100644--- a/website/docs/user-guide/configuration.md+++ b/website/docs/user-guide/configuration.md@@ -2569,6 +2569,10 @@ When the cap is reached, Hermes returns a direct limit message naming whichsurfaces hold the slots. Existing active sessions keep their normal behavior.Run `hermes status` to see the current slot usage and every holder.+This is the only cap on concurrent gateway turns: the gateway runs each turn body+on its own thread, so with the default (unset) every accepted turn starts+immediately instead of queuing behind other running turns.+The canonical key is top-level `max_concurrent_sessions`. Hermes also accepts`gateway.max_concurrent_sessions` as a fallback, but the top-level key wins whenboth are set.