Repository navigation
Conversation
…agent A multi-step episode verifies every turn in the agent's own sandbox, and the shared verifier only emptied /tests and /logs/verifier right before it ran. Between two turns the next agent's fresh session therefore worked beside the previous turn's uploaded tests (hidden ones included: SWE-Interact uploads its root tests/test.patch from the first step on), its reward, and the previous agent's transcript at /logs/agent/trajectory.json. Before every turn after the first, the server now empties /tests and /logs/verifier and removes /logs/agent/trajectory.json as root, with the same command the shared verifier already used, as Harbor's _reset_shared_step_verifier_dirs does between steps. The first turn keeps whatever the image put in /tests. Files the agent wrote under /logs/agent stay. A sandbox that cannot do it fails the episode retryably before the next agent session opens. Reported by Yuhe Zhang in review of #4728 (P1). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
|
Thanks Felipe, this is in the stack now. I ported this commit onto #4819 as its seventh commit, 3c18874, with your authorship kept and the review points folded in: the docstrings, README and the Fern multi-step page now say that Harbor 0.22.0 empties /tests and /logs/verifier only before each step's verifier and that Harbor main does it in step preparation, which this follows, they state the /logs/agent divergence (Harbor empties or moves away the whole directory, here only the server's trajectory.json goes), the failure text names what it was clearing, and the never-runs-beside sentence is scoped to the paths. The three new tests came across unchanged and pass with the rest of the Harbor suites at every commit above. Closing this draft since #4819 carries it. |
What
A multi-step Harbor episode verifies every turn in the agent's own sandbox, and the shared verifier emptied
/testsand/logs/verifieronly right before it ran. Between two turns, the next turn's fresh agent session therefore worked beside:tests/test.patchfrom the first step on);/logs/agent/trajectory.json.Before every turn after the first, the server now empties
/testsand/logs/verifierand removes/logs/agent/trajectory.jsonas root. It uses the command the shared verifier already ran, now a helper (_reset_shared_verifier_dirs). This matches what Harbor'sMultiStepTrialdoes between steps (_reset_shared_step_verifier_dirs, "before any setup or agent code can observe them"). The first turn keeps whatever the image put in/tests, and files the agent wrote itself under/logs/agentstay. A sandbox that can't do the clean-up fails the episode retryably before the next agent session opens.Why
Reported by Yuhe Zhang in review of #4728 (P1, "Clear the grading files before the next agent turn"). The fix belongs here because the turn loop now lives in M34. Leaving the transcript in place also undoes the "fresh session per step" premise of Harbor's default multi-step trial.
Changes
environment_servers/harbor/verifier.py: the shared verifier's directory reset moves into_reset_shared_verifier_dirs, unchanged.environment_servers/harbor/app.py:_prepare_turncalls it for every turn after the first. The comment on the turn loop's failure mapping now covers it.test_multi_turn.py: the reset runs as root after turn 1'stest.shand before turn 2's activation, and not before turn 1. A sandbox that cannot reset fails the episode (agent stage, retryable) without opening the second agent session.test_verifier_filesystem.py: on a real directory tree, with plain and agent-linked/testsand/logs/verifier, the next agent can read none of the grading files. The agent's own/logs/agentfile stays, and a linked root is replaced, never followed.Validation
pytest environment_servers/harbor/tests tests/unit_tests -k "harbor or tb4": 1297 passed, 5 skipped, 4 failed.adasif/harbor-m34-multi-turn. They come from this host's umask (test_harbor_build_inputs.py×3,test_harbor_build_plan.py×1 expect modes 0644/0755 and get 0640/0750).tests/unit_tests/test_indic_in22.pywas ignored: it fails to importbenchmarks.indic.in22on the base too._prepare_turn, both new multi-turn tests fail.pre-commit runon the changed files: passed. DCO sign-off on the commit.Rollout evidence
A real oracle rollout on Docker, run with
gym dataset validate <task> --sandbox docker, on a two-step task built for this check:tests/holds a hidden-tests marker./tests,/logs/verifierand/logs/agent.multi_step_reward_strategy = "final", so the episode reward is that check.adasif/harbor-m34-multi-turn(6f6c8b0)tests: test.patch test.sh,verifier: .ng-exit reward.txt test-stdout.txt,transcript: presenttests:(empty),verifier:(empty),transcript: absentTurn 1 scored 1.0 on both. No containers were left behind.
Compatibility
No configuration or data changes. A grader that reads files an earlier turn's verifier left in
/testsor/logs/verifierwould stop finding them. Harbor's own runtime clears them the same way, so a task that works under Harbor is unaffected.🤖 Generated with Claude Code