Increase Sandbox Default Thread Worker Count #807
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


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.