Skip to content

Conversation

@DamianB-BitFlipper
Copy link
Collaborator

@DamianB-BitFlipper DamianB-BitFlipper commented Jan 30, 2026

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • [I couldnt find the style guidelines] My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

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_workers from 10 to 50 across sandbox-backed environments (including SandboxEnv, RLMEnv, and the math_python environment) to prevent the sandbox client threadpool from becoming a bottleneck at high concurrency.

Also configures AsyncSandboxClient instances 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.

@CLAassistant
Copy link

CLAassistant commented Jan 30, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ DamianB-BitFlipper
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

@DamianB-BitFlipper DamianB-BitFlipper marked this pull request as ready for review January 30, 2026 20:56
@mikasenghaas
Copy link
Member

can go even higher? usually set to 128 for any stuff i do

@willccbb
Copy link
Member

@cursoragent update CliAgentEnv / HarborEnv limits accordingly

@cursor
Copy link

cursor bot commented Jan 31, 2026

  • Updated both CliAgentEnv and HarborEnv to align sandbox client limits with the new defaults:

    • AsyncSandboxClient(..., max_connections=100, max_keepalive_connections=50)
    • Applied in verifiers/envs/experimental/cli_agent_env.py (create/wait/delete paths) and verifiers/envs/experimental/harbor_env.py (reward compute path).
  • Committed and pushed to more-sandbox-threads (commit 1e60b52). If you want these envs to also use the threaded client with an explicit worker pool, I can follow up with a switch to ThreadedAsyncSandboxClient and expose a sandbox_client_max_workers param.

Open in Cursor Open in Web

…iAgentEnv/HarborEnv (100/50) to align with sandbox defaults

Co-authored-by: williambrown97 <williambrown97@gmail.com>
@willccbb willccbb merged commit bcfc3b6 into main Jan 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants