Repository navigation
fix(opencode_sandboxed_agent): keep the provider kind when a sandbox command's outcome is unknown - #5859
Conversation
…command's outcome is unknown When sandbox.exec returns a result that does not say how the command ended (an error type, or the -1 signal-death sentinel), the agent reported it as a bare harness agent_route_failed. The row then carried no provider evidence, so a sandbox fault read as an unnamed harness failure. Report it as a provider_command_outcome_unknown sandbox event, with the provider, sandbox id and the provider's reason as typed details, and let the agent route failure only route it (stage agent), as pi_sandboxed_agent already does. The collector types the failed /run row by that cause. Retry and scoring are unchanged: the attempt is still ungraded and rerun under the attempt cap, never counted as a model result. Genuine harness contradictions (missing launch marker, exit 0 without a completion marker) keep agent_route_failed. Signed-off-by: Adam Rajfer <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE — the new test introduces an import-check failure, and required rollout evidence is missing.
RISK — Record a representative model-backed smoke rollout. The supplied validation lists unit tests and Ruff checks, but no real rollout evidence or justified N/A. This changes the observable failure contract in the agent execution branch, so the repository’s smoke-rollout requirement applies. Unit tests alone leave the running harness-to-collector integration unvalidated.
Could you run a representative task with a model at this head and add the config, provider, model, task, artifact location, and inspected agent/verifier results to the PR description? The normal rollout should reach verification and retain its native reward. A controlled unknown-outcome check should retain provider_command_outcome_unknown in the collected failure, produce no model score, and preserve the existing bounded rerun behavior. These are proposed acceptance checks, not executed results; they don't require new retry or scoring rules.
Preserve the neighboring cases: the timeout regression must retain its nonempty partial output and captured export, and the confirmed-OOM regression must retain the verifier’s reward without forcing zero.
I inspected both changed files and traced provider evidence, failure routing, collection, recovery, and verification preservation. I found no additional production-code defect. This was static review; I couldn’t execute tests or model rollouts with the available tools.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| choose_stage_outcome, | ||
| failure_report_for, | ||
| ) | ||
| from nemo_gym.core.failure_transport import FailureHeader |
There was a problem hiding this comment.
RISK — Import FailureHeader through the public core API. This new import adds a failing entry to the repository-wide import guard. The guard scans server tests as code outside the library and rejects direct submodule imports of exported names. FailureHeader is already exported by the core facade, so this fails independently of whether the agent’s own suite passes. This conclusion comes from source inspection, not an executed test.
Could you add the name to the existing public import group and remove this line? The small patch at this location is:
from nemo_gym.core import (
FailureClass,
+ FailureHeader,
NgFailureEvent,
OutcomeAction,
StageOutcomePolicyConfig,
choose_stage_outcome,
failure_report_for,
)
- from nemo_gym.core.failure_transport import FailureHeaderThe facade returns the same class, so the failure contract should remain unchanged. Verify the patch by running the linked import guard and the five-case regression: the guard should report no entry for this import, and every case should still retain the typed provider details, encode a header that resolves to provider_command_outcome_unknown, and avoid downloads and verifier calls.
…nemo_gym.core API Signed-off-by: Adam Rajfer <[email protected]>
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42661798980 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42661940980 |
…VIDIA-NeMo#5925) * fix(opensandbox): time out background commands at Gym's own deadline execd reports the kill at a command's timeout only as a signal death (exit -1, "signal: killed"), and since NVIDIA-NeMo#5127 the provider no longer infers a timeout from that. With operations.background_exec a command that runs out its time therefore never comes back as a timeout. A harness that treats an unexplained -1 as an unknown outcome (opencode_sandboxed_agent since NVIDIA-NeMo#5859) reruns it as an environment fault instead of verifying it. Background exec now enforces timeout_s itself, as the session path already does: it records provider_command_timeout, interrupts a command still running at the deadline and returns 124 with error_type="timeout". execd's timer moves command_timeout_headroom_s / 2 later and only stops a command whose interrupt was refused; a refused interrupt keeps the reported exit. Signed-off-by: Adam Rajfer <[email protected]> * fix(opensandbox): keep status polling cadence after Gym's command deadline When status reads failed after the command deadline, the past deadline stayed in the sleep limits and zeroed the polling and backoff delay until the status recovery window ran out. Only a future deadline now shortens the sleep. Adds a regression test for a status outage that spans the deadline. Signed-off-by: Adam Rajfer <[email protected]> --------- Signed-off-by: Adam Rajfer <[email protected]>
What
opencode_sandboxed_agentraised a harnessagent_route_failed("Sandbox command outcome cannot be classified") wheneversandbox.execreturned a result that does not say how the command ended: anerror_typeother thantimeout, or the-1signal-death sentinel. The failed/runrow then had no provider evidence, so a sandbox fault looked like an unnamed harness failure.It now reports a
provider_command_outcome_unknownsandbox event (provider, sandbox id and the provider's reason as typed details) and lets the agent route failure only route it (stage="agent"), the same shapepi_sandboxed_agentuses for the same situation. The collector types the failed row by that cause.Genuine harness contradictions (missing launch marker, exit 0 without a completion marker, missing export) keep
agent_route_failed. A timeout still reaches the verifier, andprovider_oom_killedhandling is untouched.What does not change
Retry and scoring. The attempt was already unscored and rerun under the attempt cap, never counted as a model result unless a run explicitly counts
agent_run_erroras zero; that is unchanged. The agent-stage outcome policy is not consulted by this agent for a raised failure, so no policy rule is added (the default agent-stage action for the kind isfailand is only consulted by agents that can count a failure as zero; the environment-server agent policy already maps the kind toretry).Which values reach the branch
sandbox(docker, apptainer, enroot, openshell, daytona),pty, and OpenSandbox'suser_switch_unavailable, all with exit code 125.provider_command_outcome_unknown/provider_status_unavailableevents for missing or contradictory command status, and those propagate unchanged.Tests
test_unconfirmed_exec_result_is_a_typed_provider_failure_and_does_not_grade_a_partial_workspacecovers each of those values: the cause kind and details, the failure reason, the collector's row kind, the evaluation-side attribution, that the agent-stage policy does not count it as zero, and that the verifier is never called. It fails on main.responses_api_agents/opencode_sandboxed_agent,opencode_agent,pi_sandboxed_agent,tests/unit_tests/agentsandtests/unit_tests/corepass;ruff checkandruff formatare clean.