Repository navigation
feat: workspacebench env - #3089
Conversation
Signed-off-by: Christian Munley <[email protected]>
Signed-off-by: Christian Munley <[email protected]>
Signed-off-by: Christian Munley <[email protected]>
Signed-off-by: Christian Munley <[email protected]>
Signed-off-by: Christian Munley <[email protected]>
|
/claude review |
|
/ok to test 6a60856 |
| ], | ||
| cwd=evaluation_dir, | ||
| check=True, | ||
| ) |
There was a problem hiding this comment.
RISK — judge subprocess can hang the run and fails opaquely. subprocess.run(..., check=True) runs the upstream agent-as-a-judge (an LLM-backed process) with no timeout, no capture_output, and no errors="replace". Two problems:
- No timeout. This runs inside
asyncio.to_threadinverify(). If the judge hangs (stuck LLM call, network stall), it holds the worker thread indefinitely — the verify never returns and the eval/training run stalls.verify()is on the critical scoring path. - No captured output. On non-zero exit,
check=TrueraisesCalledProcessErrorwith no stdout/stderr, so the operator sees an opaque failure. CLAUDE.md requires decoding subprocess output witherrors="replace".
FIX: pass timeout=, capture_output=True, text=True, errors="replace", and surface stderr in the raised error.
| install_str = ( | ||
| "mkdir -p $HOME/.opencode/bin && " | ||
| f"cp {quote(self.config.remote_opencode_binary_path)} $HOME/.opencode/bin/opencode" | ||
| ) |
There was a problem hiding this comment.
RISK — copied binary may not be executable. This new branch cps the binary to $HOME/.opencode/bin/opencode but never chmod +x it. If remote_opencode_binary_path points at a file whose executable bit isn't preserved through upload (many sandbox upload paths strip mode bits), the subsequent opencode invocation fails with "permission denied" and the whole rollout errors out. The script-based branches run the binary via bash <installer>, so they don't rely on the bit; this direct-cp path does.
FIX: append && chmod +x $HOME/.opencode/bin/opencode to the copy command.
|
SHIP WITH CARE — new Workspace-Bench environment (verifier + OpenCode binary-copy path). The scoring math is correct (
None block a gated/experimental rollout ( |
Signed-off-by: Christian Munley <[email protected]>
|
/ok to test da44604 |
|
/claude review |
| config: WorkspaceBenchConfig | ||
|
|
||
| def model_post_init(self, context: Any, /) -> None: | ||
| self._sandboxes: dict[str, AsyncSandbox] = {} |
There was a problem hiding this comment.
RISK — leaked sandboxes on abandoned sessions. self._sandboxes accumulates one live OpenSandbox per seed_session, but the server has no shutdown hook and only removes entries in verify() (line 159, .pop(...) with no default). Any session that is seeded but never verified — agent crash, aborted run, or a verify call for a session that was never seeded (KeyError → sandbox never stopped) — leaks a sandbox until its ttl_s (10800s / 3h in the config) expires.
BLAST RADIUS: at eval scale, aborted/failed tasks strand paid OpenSandbox instances for hours; a run that seeds N tasks and dies mid-flight leaks all of them.
FIX: mirror the pattern in resources_servers/swebench_pro/app.py — override setup_webserver() to wrap the lifespan and add a shutdown() that stops every sandbox in self._sandboxes, and use .pop(session_id, None) in verify so a missing session doesn't raise before the finally: stop().
|
SHIP WITH CARE New Findings (both inline):
No blockers. Config defaults ( |
Signed-off-by: Christian Munley <[email protected]>
d6f7548 to
0289136
Compare
Signed-off-by: Christian Munley <[email protected]>
Signed-off-by: Christian Munley <[email protected]>
|
/ok to test 7989b5d |
|
/claude review |
Signed-off-by: Christian Munley <[email protected]>
|
/ok to test 9f053a4 |
|
/claude review |
| provider = create_provider(resolve_provider_config(self.config.sandbox_provider, get_global_config_dict())) | ||
| sandbox = AsyncSandbox(provider) | ||
| try: | ||
| await sandbox.start(SandboxSpec(**self.config.sandbox_config)) |
There was a problem hiding this comment.
NOTE (attribution asymmetry): seed_session builds its SandboxSpec by merging resolve_provider_metadata(...) (e.g. opensandbox's default_metadata: {sandbox-api: opensandbox-sdk}) plus a task-id label, but the judge sandbox here is SandboxSpec(**self.config.sandbox_config), so it never gets the provider's default_metadata. WHAT: judge sandboxes are missing the attribution labels the task sandboxes carry. BLAST RADIUS: cosmetic — cluster-side sandbox attribution/cleanup filters won't match judge pods; no correctness impact. FIX (optional): mirror the seed path and merge resolve_provider_metadata(self.config.sandbox_provider, get_global_config_dict()) into the judge spec's metadata.
|
SHIP WITH CARE — solid new benchmark environment, closely modeled on the merged What I verified (no blockers):
Minor (author's call): one inline NOTE on judge-sandbox metadata attribution asymmetry vs the task sandbox — cosmetic (cluster attribution/cleanup labels), no correctness impact. Per repo policy, confirm real smoke-rollout evidence was captured with a live model + judge (the committed |
Signed-off-by: Christian Munley <[email protected]>
|
/ok to test bebc749 |
|
/claude review |
| body.artifact_id = body.artifact_id or hashlib.sha256(session_id.encode()).hexdigest() | ||
| saved = self.config.artifact_root / body.artifact_id | ||
| if replay: | ||
| if not (saved / "input.tar.gz").is_file(): |
There was a problem hiding this comment.
NOTE — replay of a natively-failed artifact crashes with an opaque 500.
The exec_error/download_error path persists input.tar.gz + request.json to saved but never writes workspace.tar.gz (confirmed by the test at test_app.py:176-179). A later artifact_id replay of such an artifact passes this input.tar.gz guard, finds no result.json, then prepare_judge_input (line 264) opens the missing saved/workspace.tar.gz → uncaught FileNotFoundError → 500.
BLAST RADIUS: only manual regrade of an artifact whose original rollout failed natively (the framework doesn't pass artifact_id in normal eval flow), so low. FIX: extend this guard to also require (saved / "workspace.tar.gz").is_file(), raising a clear "artifact has no collected workspace to regrade" message instead of letting the tar open crash.
|
SHIP WITH CARE New self-contained Verifier correctness looks sound: reward is One low-severity edge case flagged inline: replaying an artifact whose original rollout failed natively (no Two minor observations, author's call:
Per the repo quality bar, this is behavior-changing environment work: confirm real smoke rollouts against a live model + judge were run and the agent/verifier behavior inspected (green unit tests alone aren't sufficient here). |
What does this PR do?
Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).