Repository navigation
fix(harness-agent): let explicit agent_kwargs keep their working directory - #5051
Conversation
…ctory Signed-off-by: Christian Munley <[email protected]>
|
/ok to test c8d4ee9 |
|
@cmunley1 Add |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no reliability concerns.
Reviewed all three changed files and traced working-directory propagation into the runner and Fabric workspace. Both branches in HarnessAgent.responses preserve explicit agent settings while retaining the task directory as the runner’s cwd. Missing settings retain the previous behavior. The new regression test checks both default and explicit-root cases.
Static review only; I could not execute tests or verify the live rollout results.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
marcromeyn
left a comment
There was a problem hiding this comment.
LGTM. setdefault lets an explicit agent_kwargs working directory win on both paths, the runner still runs in the task workdir, and agent_config is a fresh copy per request so nothing leaks between tasks.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40302105918 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40310193617 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40346066185 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40346234602 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40350654853 |
What does this PR do?
harness_agentwrites the task working directory into the harness's workdir key (cwd,repo_dir, orworkspace_root) and overwrites any value set inagent_kwargs, so an explicit setting cannot take effect.This blocks DeepAgents through NeMo Fabric. Fabric uses that directory as the DeepAgents workspace, which is also the root of its virtual filesystem. With the task directory
/app, an absolute answer path such as/logs/agent/answer.txtis written to/app/logs/agent/answer.txtand never collected. On SWE Atlas Codebase Q&A (#4777) every DeepAgents rollout scored 0 with no rubric judged.With this change an explicit
agent_kwargsvalue wins. DeepAgents can setcwd: /while the runner still starts in the task directory. Configs that do not set the key keep the current behavior.Validation
pytest responses_api_agents/harness_agent/tests: 33 passed.mainfor the explicit value and passes with this change.pre-commiton the changed files: passed.Rollouts
DeepAgents through
harness_agentand OpenSandbox on three SWE Atlas Q&A tasks (#4777) with this change andagent_kwargs.cwd: /, DeepSeek-V4.1-Flash as the policy and Claude Opus 4.5 as the judge:Without the change, the same tasks collected no answer and scored 0 with no rubric judged, because the answer landed at
/app/logs/agent/answer.txt. With it,/appstayed clean in every sandbox. DeepAgents' own state directory also moved from inside the repository to/artifacts.Compatibility and benchmark impact
Only configs that set the workdir key in
agent_kwargsare affected. Onmainthose arebenchmarks/job_bench/codex.yamlandbenchmarks/workspace_bench/codex.yaml, which setcwd: /workspace, the same directory as their task workdir, so their behavior is unchanged.Checklist