Skip to content

Conversation

@rasdani
Copy link
Contributor

@rasdani rasdani commented Jan 7, 2026

Adds a get_sandbox_request(state) method that subclasses can override to customize the sandbox request per-rollout.

Use case: Environments with dynamic docker images per example (e.g., SWE-bench has different images per task).

Change:

  • get_sandbox_request() returns self.sandbox_request.model_copy()
  • setup_state() uses self.get_sandbox_request(state) instead of self.sandbox_request

Backwards compatible - existing subclasses work unchanged.

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

  • 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


Note

Enables per-rollout customization of sandbox creation without altering existing subclasses.

  • Add get_sandbox_request(state) in sandbox_env.py returning self.sandbox_request.model_copy() (overrideable)
  • Update SandboxEnv.setup_state() and RLMEnv._recreate_sandbox() to call get_sandbox_request(state) when creating sandboxes
  • Keeps existing behavior by default via a copied base request

Written by Cursor Bugbot for commit a9523de. This will update automatically on new commits. Configure here.

Co-authored-by: williambrown97 <williambrown97@gmail.com>
@CLAassistant
Copy link

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.

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

@willccbb willccbb merged commit 5666abc into main Jan 7, 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