Repository navigation
fix(openclaw): retain model errors and capture ownership - #5119
Conversation
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP — LGTM, no concerns found.
Reviewed all four changed files and traced terminal-error handling, runtime/cleanup failure precedence, capture ownership, and environment outcome-policy consumption. The regression cases cover preserved model failures and rejected-attempt ownership; the updated documentation matches the inspected behavior.
Static review only: tests and the external OpenClaw runtime were not executed. The PR supplies representative real-model smoke evidence and describes the scoring compatibility change.
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.
|
@prokotg Following up on the error-handling questions in your #5120 review: these cases had not been checked. I reproduced them with the pinned OpenClaw 2026.6.11 CLI and pushed bdd0364.
Context limits follow Gym's existing ungraded, nonretryable default, configurable to verify. This changes provider context overflow previously treated as generic HTTP 400; the original error is retained. Validation: 466 adapter tests passed (2 skipped), all eight new real-CLI error regressions passed on the stack, 7/7 P0 scenarios passed, and the real-model tool/verification smoke passed. The raw socket fault probes validate outcome delivery and deliberately bypass model capture. Could you re-review and approve this updated adapter commit if it looks good? |
Signed-off-by: Giulio Lovisotto <[email protected]>
Signed-off-by: Giulio Lovisotto <[email protected]>
bdd0364 to
8f603d6
Compare
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41476681997 |
What does this PR do?
OpenClaw sandbox sessions attach every captured model attempt to its invocation, including rejected requests without a response ID. The provider sends the invocation ID as
x-session-id; the rollout URL continues to identify the episode.Model failures return a structured failed response with the original error, partial output, usage and
ng_agent_outcome, allowing the environment to apply its configured policy:model_request_errorand the upstream status.model_transport_error.model_context_limit.The adapter requires successful cleanup and a recognized CLI termination. A supervisor deadline remains an incomplete response; unrelated aborts, worker crashes and cleanup failures still raise. No separate public issue: these fixes address gaps reproduced by controlled harness probes. Conformance registration and regression coverage are isolated in stacked follow-up #5120.
The rebase preserves upstream Bash process supervision and MCP grant handling. The capture-ownership regression uses the renamed
join_agent_model_callshelper through the public trajectory API; existing test callers use the same export.Validation
On Linux ARM64 with OpenClaw 2026.6.11 / Node 22.19.0:
python -m pytest -o addopts= --import-mode=importlib responses_api_agents/openclaw_agent/tests -q: 494 passed, 1 skipped (the opt-in process-identity test).HARNESS=openclaw python -m pytest -o addopts= --import-mode=importlib scripts/harness_conformance/tests tests/unit_tests/harness_capabilities -q: 412 passed, 2 skipped, including eight real-CLI error regressions.python -m pytest -o addopts= --import-mode=importlib tests/unit_tests/test_public_api_facades.py tests/unit_tests/test_agent_outcome.py tests/unit_tests/trajectory/test_trajectory_record.py -q: 371 passed.The additional CLI regressions cover exhausted 429/500/503, connection reset, interrupted SSE, native idle timeout, provider context overflow and local context precheck. Raw socket faults intentionally bypass model capture and validate outcome delivery, not capture completeness.
Compatibility and benchmark impact
Structured outcomes allow environment policy to distinguish model failures from agent endpoint failures. Transport failures default to retry. Context overflow now follows the existing
model_context_limitrule: an ungraded, nonretryable failure by default, configurable viaagent_outcome_policy.by_failure_kind.model_context_limit. This includes provider context overflow formerly treated as a generic, verifiable HTTP 400. The original provider message and captured exchange remain available; no HTTP status is fabricated for a local precheck.Runtime pins and legacy local execution are unchanged. The real-model smoke validates integration, not benchmark accuracy.