Increase Sandbox Default Thread Worker Count#807
Conversation
|
|
|
can go even higher? usually set to 128 for any stuff i do |
|
@cursoragent update CliAgentEnv / HarborEnv limits accordingly |
|
…iAgentEnv/HarborEnv (100/50) to align with sandbox defaults Co-authored-by: williambrown97 <williambrown97@gmail.com>


Description
When running an env with very high concurrency, the sanbox_client's asyncio threadpool executor gets clogged up. The default value of 10 is quite low and hardware can comfortably support 50.
This took down the "sandbox is ready" time for a swe benchmark from 250s down to about 75s.
Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
refactor: Increase max workers for sandbox client setup
Note
Low Risk
Concurrency tuning only; behavior changes are limited to resource usage (more threads/connections) and could surface rate-limit or saturation issues in constrained runtimes.
Overview
Increases the default
sandbox_client_max_workersfrom 10 to 50 across sandbox-backed environments (includingSandboxEnv,RLMEnv, and themath_pythonenvironment) to prevent the sandbox client threadpool from becoming a bottleneck at high concurrency.Also configures
AsyncSandboxClientinstances in experimental envs (CliAgentEnv,HarborEnv) with explicit higher HTTP connection/keepalive limits (max_connections=100,max_keepalive_connections=50) to better support parallel sandbox operations.Written by Cursor Bugbot for commit 1e60b52. This will update automatically on new commits. Configure here.