Repository navigation
Conversation
Remove the four built-in execution backends (multiprocessing, docker, ray, e2b) and replace them with a single unified backend powered by bespokelabs-sandbox. This delegates sandbox lifecycle, isolation, and multi-provider support to the sandbox package while keeping curator's orchestration layer (caching, retries, request/response files) intact. - Add SandboxCodeExecutionBackend using bespokelabs.sandbox.Sandbox - bespokelabs-sandbox is a required dep; "local" backend works out of the box - code_execution extra installs docker/ray/e2b SDKs for non-local backends - Preserve legacy docker_image and base_url config params for backwards compat - Tar archives retain directory structure (os.path.relpath, not basename) - Regenerate poetry.lock for the new dependency graph - Update tests and examples for new backend names Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Backend SDKs are managed by bespokelabs-sandbox's own extras (e.g. pip install bespokelabs-sandbox[docker]). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The code_execution extra was removed from pyproject.toml since backend SDKs are now managed by bespokelabs-sandbox's own extras. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Non-zero exit codes are valid outcomes (e.g. code-verification workloads). Setting error on non-zero exits caused validate_existing_response_file to discard and re-run those responses on every resume. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Test all dataclass add/append methods on TokenUsage, CostInfo, RequestStats, PerformanceStats - Test CuratorResponse save/load, to_dict, get_failed_requests, __getattr__ deprecation, update_tracker_stats offline path - Test safe_model_dump normal and fallback paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The sandbox lifecycle timeout (timeout_secs) is a safety net, not the per-execution limit. Use `timeout N` in the shell command to kill the python process after exactly N seconds, matching the old subprocess.run timeout behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Distinguish exit code 124 (timeout) with message="timeout" - Format non-zero exit code errors with stderr details - Preserve stdout/stderr/files in exception handler - Add unit tests with fake sandbox for all error paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks done
madiator
added a commit
that referenced
this pull request
Jun 11, 2026
Since #716, bespokelabs-sandbox (a required dependency) installs into the same bespokelabs.* namespace package that CI measures with --cov=bespokelabs, so ~1,100 statements of third-party sandbox code (docker/e2b/modal/ray/... backends, mostly unexercised here) entered the coverage denominator and dropped the total from 79.5% to ~72%, tripping the 80% gate. Measure only curator's own package instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
madiator
pushed a commit
that referenced
this pull request
Jun 11, 2026
* Fix code execution on the local sandbox backend Since #716, CodeExecutor with the default "local" backend always failed: the command `cd /workspace && ...` escapes the sandbox path rebasing. Host-style sandbox backends (local, ray) map absolute paths under a temp $SANDBOX_ROOT via a shell prelude that wraps common file utilities, but `cd` is not among them, so the shell tried to enter the host's nonexistent /workspace and every execution returned an error output. This is also why tests/code_executor/test_code_execution.py:: test_simple_code_execution_local has been failing CI on main. Rebase the workspace path explicitly with "${SANDBOX_ROOT:-}/workspace": host-style backends expand their sandbox root, while container backends (docker, e2b, ...) leave SANDBOX_ROOT unset and keep using the real /workspace. Also invoke `python3` instead of `python`: stock macOS hosts have no bare `python` binary, so the local backend failed on Macs even with the cd fix; python3 is present on CI runners and in python docker images. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Scope CI coverage to bespokelabs.curator Since #716, bespokelabs-sandbox (a required dependency) installs into the same bespokelabs.* namespace package that CI measures with --cov=bespokelabs, so ~1,100 statements of third-party sandbox code (docker/e2b/modal/ray/... backends, mostly unexercised here) entered the coverage denominator and dropped the total from 79.5% to ~72%, tripping the 80% gate. Measure only curator's own package instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Note
Medium Risk
Replaces multiple execution backends with a new
bespokelabs-sandboxwrapper and changes the default backend tolocal, which may affect runtime behavior, file output paths, and timeout/exit-code handling across environments.Overview
Code execution backends are consolidated onto
bespokelabs-sandbox. The PR removes the bespokemultiprocessing,ray,docker, ande2bbackends and introducesSandboxCodeExecutionBackend, created via a simplified factory with aliasing (multiprocessing->local).API/config and examples are updated for the new sandbox model.
CodeExecutornow defaults tobackend="local", backend config addsimage(with legacydocker_image/base_urlsupported), and examples/tests are adjusted for new output file paths and params (e.g.,docker_image->image) plus new unit coverage for sandbox execution/error cases; CI no longer installs the removedcode_executionextra and instead depends onbespokelabs-sandbox.Written by Cursor Bugbot for commit d7dd3f6. This will update automatically on new commits. Configure here.