Official Codebase of 3DCodeVerse
Python
bench: a bare-agent session killed by a provider storm is not cached as finished
gaoypengdf1af63e448a
diff --git a/eval/bench/_bare_agent.py b/eval/bench/_bare_agent.pyindex 69046b40..fcc61d0a 100644--- a/eval/bench/_bare_agent.py+++ b/eval/bench/_bare_agent.py@@ -84,7 +84,8 @@ def run_bare_agent(spec: Spec, target: str, cell: Path, eval_ws: Workspace, *, mkind="baseline", language=spec.language.value, track=spec.track.value,env={"NODE_PATH": str(node_modules_dir())})result = get_coding_agent(target).run(job)- done.write_text(result.model_dump_json(indent=1))+ if not result.transient: # a session a 503 storm killed is not finished: a --redo must run it again+ done.write_text(result.model_dump_json(indent=1))for rel in files_for(spec.language):src = ws.root / relif src.is_file():diff --git a/eval/tests/test_bare_agent.py b/eval/tests/test_bare_agent.pyindex 82faf71c..be6594bd 100644--- a/eval/tests/test_bare_agent.py+++ b/eval/tests/test_bare_agent.py@@ -72,3 +72,18 @@ def test_run_copies_the_deliverable_and_resumes(tmp_path, monkeypatch):assert started + 600 <= job.hard_deadline_s <= time.monotonic() + 600run_bare_agent(_spec(), "gemini-cli:gemini-3.7-flash", tmp_path, eval_ws, minutes=10)assert len(agent.jobs) == 1 # a finished session is not re-run+++def test_a_storm_killed_session_is_not_cached_so_a_redo_runs_it(tmp_path, monkeypatch):+ calls: list[int] = []++ class Storm:+ def run(self, job: AgentJob) -> AgentResult:+ calls.append(1)+ return AgentResult(ok=False, exit_reason="error", transient=True)++ monkeypatch.setattr("bench._bare_agent.get_coding_agent", lambda target: Storm())+ eval_ws = Workspace(tmp_path / "eval").create()+ run_bare_agent(_spec(), "gemini-cli:gemini-3.8-flash", tmp_path, eval_ws, minutes=10)+ run_bare_agent(_spec(), "gemini-cli:gemini-3.8-flash", tmp_path, eval_ws, minutes=10)+ assert len(calls) == 2 and not (tmp_path / "agent" / ".bare_done.json").exists()