Repository navigation
fix(agent): declare in-sandbox model calls and accept Kilo task timeouts - #5863
Conversation
Claude Code, Kilo, Stirrup and NOOA run their harness inside the task sandbox and call the Gym model server from there, but their agent classes did not declare `calls_model_from_sandbox`. A Harbor run (`gym eval run <target> --agent <name>`) reads that literal from the entrypoint source to decide whether the model server must advertise a sandbox-reachable address, so these harnesses needed a hand-set `use_absolute_ip`. Declare it on each class. NOOA's embedded mode calls the model from the host, which also reaches the advertised node address. Kilo's sandbox activation refused every request field except `input`, `instructions` and `model`, so every Harbor task row, which carries `metadata.agent_timeout_sec`, got a 422. Accept metadata whose only key is `agent_timeout_sec`, run Kilo for min(config `timeout`, that value) as Codex and Pi do, and report the applied budget in the response metadata. Any other metadata key is still refused. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test 4e70268 |
…el-from-sandbox-kilo-timeout Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test de311ed |
|
Optional, non-blocking: the sandboxed-mode paragraph in the NOOA README still tells users to configure |
Harbor task rows carry metadata.agent_timeout_sec, and Stirrup now declares calls_model_from_sandbox, so Harbor runs pair with it. The runner now runs for min(sandbox_runner_timeout_seconds, agent_timeout_sec), as Codex, Pi, OpenCode, Claude Code and Kilo do, and the response metadata records the applied budget. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test f455010 |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test 03bba1d |
|
/ok to test 5c70874 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42719482087 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42744451434 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42922032345 |
What changed and why
Two small consistency fixes across the agent-harness adapters. Neither changes a shared contract.
1. Declare
calls_model_from_sandboxon four harnesses. Claude Code, Kilo, Stirrup and NOOA run their harness inside the task sandbox and call the Gym model server from there, but their agent classes did not declare it. A Harbor run (gym eval run <target> --agent <name>) reads this literal from the entrypoint source without importing it (entrypoint_class_flag, used byruns_in_sandboxinnemo_gym/data/tasks/harbor/prepare.py). It then setsuse_absolute_ipandabsolute_ip_server_types: [responses_api_models]for the run. Without the declaration, these four harnesses needed a hand-setuse_absolute_ip. Eachapp.pynow declarescalls_model_from_sandbox: ClassVar[bool] = True, as Codex, Pi, OpenCode, Hermes and the others already do.localprovider, the runner runs on the host, and the node address is reachable from there as well.use_absolute_ipkept: the configs that set it themselves do not go through the Harbor path, so they keep it:claude_code_agent/configs/profiles/benchmark.yaml(HLE profile) andbenchmarks/swebench/pro/nooa.yaml(SWE-bench Pro through its Resources server).2. Kilo accepts a task row's
metadata.agent_timeout_sec. Kilo's sandbox activation refused every request field exceptinput,instructionsandmodel. Every Harbor task row carriesmetadata.agent_timeout_sec, so every Harbor row got a 422. Kilo now:metadatawhose only key isagent_timeout_sec;resolve_agent_timeout(metadata, ceiling=timeout), that is min(configtimeout, task value), as Codex, Pi, OpenCode and Claude Code do;Any other metadata key is still refused with 422. The host-side (non-session) Kilo path is unchanged.
3. Stirrup honors a task row's
metadata.agent_timeout_sec. With the declaration above, Harbor runs now pair with Stirrup, and every Harbor row carries a task budget. Stirrup already accepted request metadata but ignored it, so it always ran forsandbox_runner_timeout_seconds(12600 s by default). The runner now getsresolve_agent_timeout(metadata, ceiling=sandbox_runner_timeout_seconds), and the response metadata records the appliedagent_timeout_sec, like Kilo above.Issue: none. These are small consistency fixes that need no design decision.
Compatibility
use_absolute_ip: trueplusabsolute_ip_server_types: [responses_api_models]by default. Only the model server advertises the node address. An explicit config or command-line value still wins.agent_timeout_sec.metadata.agent_timeout_secbelow the configured limit now stop at the task's budget. Runs without it are unchanged.Validation
pre-commit run --files <touched files>: passed.PYTHONPATHandNEMO_GYM_EXTRA_ROOTS): 873 passed, 28 skipped. Suites:responses_api_agents/kilocode_agent/tests,responses_api_agents/claude_code_agent/tests,tests/unit_tests/data/tasks/harbor/test_harbor_tasks.py,tests/unit_tests/server_runtime/test_ray_opt_out.pyandtests/unit_tests/agents/test_base_responses_api_agent.py.stirrup/nooapackages added): 918 passed, 10 skipped, 20 failed. The 20 failures are instirrup_agent/tests/test_sandbox_runner.pyandtest_sessions.py. They run the local process supervisor, which reads/proc/uptime, so they fail on macOS. The same 20 fail withorigin/main'sstirrup_agent/app.py, so this change does not cause them. CI runs them on Linux.origin/main's adapter code: the 10 new or changed assertions fail on main and pass here. Those are the four flag cases, the accept/min-budget cases and the response-metadata case. The "other metadata key is still refused" cases pass on both, as intended.test_shipped_sandboxed_harnesses_declare_model_calls_from_sandboxnow lists all 15 shipped harnesses that declare the flag, including the four new ones plusbrowsecomp_agentandpool_agent, which were declared but not listed.test_task_timeout_metadata_reaches_activation,test_task_timeout_shortens_but_never_extends_the_configured_budget(none / 600 / 5000 / invalid against a 900 s ceiling), and two more rejected-metadata cases intest_unsupported_request_semantics_are_rejected.test_task_timeout_shortens_but_never_extends_the_configured_budget(same four cases against a 900 ssandbox_runner_timeout_seconds), and the response-metadata assertion intest_the_response_is_built_from_the_runner_reportnow includes the applied budget.f455010310):stirrup_agent/tests/test_app.py47 passed. A/B against the previousapp.py: the 5 new or changed assertions fail there. The full Stirrup suite is 162 passed, 20 failed; those are the same 20 macOS-only supervisor failures described above.Rollout evidence
The Stirrup timeout change has no real-model smoke yet: it changes only the deadline passed to the existing runner, which the wall-time tests exercise on Linux CI.
A real-model Kilo smoke on the bundled Harbor example tasks (
environment_servers/harbor/data/tasks, the folder behinddata/example.jsonl):nvidia/nemotron-3.5-super-vl-120b-a12bbehindvllm_model, with thinking off. The servers listened on the docker0 bridge address.gym eval run environment_servers/harbor/data/tasks --agent kilocode/kilocode_sandboxed --sandbox docker --model-type vllm_model ...4e70268c2f)origin/main(349f23eb11), taskfirst-lineuse_absolute_ip: true,absolute_ip_server_types: [responses_api_models]422 {"detail":"Unsupported Kilo sandbox request fields: metadata"}harness_execution: sandbox, the container hostname,kilo_version: 7.4.15,agent_timeout_sec: "60.0"(min of config 900 and the row's 60)first-line, Kilo ranhead -n 1 /app/input.txt > /app/output.txtthrough its bash tool, and the verifier passed it. On the other four tasks, the model answered with the right command as text and did not run it. These example prompts end with "Return a single shell command to do so" because they were written for a single-command harness. That is the model's choice, not a harness failure: every rollout made real model calls (about 9.8k input tokens each) from inside its task container.default_hostto the docker0 bridge address, which applies to every server. The new declaration is what putsuse_absolute_ipin the generated run config; this smoke does not check reachability through the default node address on its own.🤖 Generated with Claude Code