Repository navigation
Commit be028ec
authored
Fix code execution on the local sandbox backend (#720)
* 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.1 parent f060e1a commit be028ec
2 files changed
Lines changed: 13 additions & 2 deletions
File tree
- .github/workflows
- src/bespokelabs/curator/code_executor/code_execution_backend
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
| |||
0 commit comments