From 40b016db148ccb11a85428b61e8878669e8cdbd5 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Tue, 12 May 2026 17:04:36 -0400 Subject: [PATCH] agent: make max_sessions default unlimited Sessions on sprout-agent are cheap; the per-channel ACP harness already holds one session per active channel for the lifetime of that channel. A small numeric cap (previously 8) just turns into dead-letters when more channels than the cap go active, with no eviction policy in either side. Bots get bounced/restarted often enough that the unbounded growth in practice is negligible. Default to unlimited; the env var is still there for anyone who wants to clamp it. --- crates/sprout-agent/README.md | 4 ++-- crates/sprout-agent/src/config.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/sprout-agent/README.md b/crates/sprout-agent/README.md index 2c20ffd728..7651fa0be2 100644 --- a/crates/sprout-agent/README.md +++ b/crates/sprout-agent/README.md @@ -138,7 +138,7 @@ Everything is environment variables. No flags, no config files. (We are a subpro | `SPROUT_AGENT_LLM_TIMEOUT_SECS` | `120` | | | `SPROUT_AGENT_TOOL_TIMEOUT_SECS` | `660` | Per-tool call timeout in seconds | | `SPROUT_AGENT_MAX_PARALLEL_TOOLS` | `8` | Max concurrent tool calls per turn (1 = sequential) | -| `SPROUT_AGENT_MAX_SESSIONS` | `8` | Max concurrent ACP sessions | +| `SPROUT_AGENT_MAX_SESSIONS` | unlimited | Max concurrent ACP sessions. Sessions are cheap; default has no cap. | | `SPROUT_AGENT_MAX_LINE_BYTES` | `4194304` | 4 MiB. Hard cap on inbound JSON-RPC frames. | | `SPROUT_AGENT_MAX_HISTORY_BYTES` | `1048576` | 1 MiB. Old turns are evicted past this. | @@ -205,7 +205,7 @@ The trust boundary is **the operator who launched the agent**. The harness, MCP | Frame size | `SPROUT_AGENT_MAX_LINE_BYTES` (default 4 MiB). Oversize → connection killed. | | LLM response size | 16 MiB hard cap. Both `Content-Length` precheck and streaming-buffer cap. | | Cancellation | `tokio::select! { biased; _ = cancel.changed() => ... }` at every loop boundary. Cancel always wins the race. | -| Session isolation | Up to 8 concurrent sessions (configurable). One prompt per session at a time. Each session gets its own MCP servers. | +| Session isolation | Unlimited concurrent sessions by default (configurable via `SPROUT_AGENT_MAX_SESSIONS`). One prompt per session at a time. Each session gets its own MCP servers. | | `tool_use ↔ tool_result` pairing | Encoded in the type system. Every `ToolCall` and `ToolResult` carries a `provider_id: String` (not `Option`). | ### Bounded Everything diff --git a/crates/sprout-agent/src/config.rs b/crates/sprout-agent/src/config.rs index d60834374b..f48c95bbfc 100644 --- a/crates/sprout-agent/src/config.rs +++ b/crates/sprout-agent/src/config.rs @@ -103,7 +103,7 @@ impl Config { mcp_max_restart_attempts: parse_env("SPROUT_AGENT_MCP_RESTART_MAX_ATTEMPTS", 3u32)?, mcp_restart_base_ms: parse_env("SPROUT_AGENT_MCP_RESTART_BASE_MS", 500u64)?, mcp_restart_max_ms: parse_env("SPROUT_AGENT_MCP_RESTART_MAX_MS", 30_000u64)?, - max_sessions: parse_env("SPROUT_AGENT_MAX_SESSIONS", 8)?, + max_sessions: parse_env("SPROUT_AGENT_MAX_SESSIONS", usize::MAX)?, max_line_bytes: parse_env("SPROUT_AGENT_MAX_LINE_BYTES", 4 * 1024 * 1024)?, max_history_bytes: parse_env("SPROUT_AGENT_MAX_HISTORY_BYTES", 1024 * 1024)?, max_handoffs: parse_env("SPROUT_AGENT_MAX_HANDOFFS", 5)?,