Skip to content

fix(osworld): complete native AgentEnv evaluation and health reporting - #3765

Open
Glorf wants to merge 4 commits into
mainfrom
mbien/osworld-native-runtime-deps
Open

Glorf wants to merge 4 commits into
mainfrom
mbien/osworld-native-runtime-deps

Conversation

@Glorf

@Glorf Glorf commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem and result

Fresh OSWorld evaluation environments need an explicit way to install their optional runtime packages, HTTPS sandbox gateways need the configured CA bundle, and Gym's health checks need OSWorld's recorded policy turns.

This PR adds three OSWorld fixes:

  • install_optional_runtime_dependencies: true runs the existing scoped installer when packages are missing, then restarts the agent to load fresh imports. The default remains false; installation failures stop startup.
  • The local forwarder honors REQUESTS_CA_BUNDLE, then CURL_CA_BUNDLE, while keeping certificate verification enabled and ambient proxies disabled.
  • OSWorld emits ng_trajectory with actual completion response IDs and model-server identity. Parser retries remain separate turns; missing records, IDs, timestamps, or usage remain explicit observation gaps.

Integration with main

Rebased onto main 6190deec57d549e4971140183bd6534cd32b550d, including #5117. Prerequisites #3591, #4822, and the shared HTTP-lifecycle fix #4823 are merged and come from main. The PR diff contains the OSWorld fixes, review corrections, tests, and documentation: 12 files across four signed-off commits. The rebase preserved all four commit patches.

The integration preserves #4761: response.usage comes from main's policy-call accumulator, including finished responses rejected before a turn was recorded. This PR does not recompute totals from trajectory records. Unknown policy usage stays unknown, and incomplete trajectory records cannot overwrite independently measured totals. Tests also preserve main's health semantics: recovered model-call failures stay healthy; a rollout ending on failure is flagged.

No separate issue is needed: these fixes complete the OSWorld evaluation path introduced by #3592. Prompts, actions, evaluator scores, masking, and dependency versions are unchanged by this PR.

Review corrections

  • Failed requests versus missing completion evidence: the wrapper records whether it received a completion, and that fact survives adapter errors and trajectory extraction. Confirmed unsuccessful requests retain their records and captures but do not become completion turns. Ambiguous failures and completions rejected before recording retain evidence gaps; independently accumulated usage is preserved.
  • Unavailable records versus zero turns: incomplete extraction with no completion records marks turns unavailable, including when only unsuccessful requests were recorded. A complete zero-call observation still permits the genuine missing-turn check.

Validation — October 28

On rebased head fa44236c99b9505424f5cc6270110bce6ca08618, macOS ARM64 with Python 3.13.14:

  • gym env test +entrypoint=responses_api_agents/osworld_agent +should_validate_data=true +skip_venv_if_present=true: 428 passed in the isolated component environment.
  • The targeted selection below: 1,292 passed, one pre-existing failure, with no deselections. Root dependencies were installed from the lockfile with the dev, ray, sandbox, and telemetry extras.
  • The remaining failure, benchmarks/osworld/tests/test_run_scripts.py::test_managed_osworld_agent_installs_opensandbox_sdk, expects nemo-gym[dev] while main declares nemo-gym[dev,ray]. It fails identically on an unchanged checkout of main 6190deec5; the unrelated assertion is left intact.
  • Both review failure modes were reproduced before their fixes. Regression coverage exercises the actual wrapper and adapter through response building, collection, and health checks: successful recovery, terminal connection/HTTP failures, ambiguous failures, completions rejected before recording, missing completion records, and known/unknown usage. Model-I/O logging is covered both enabled and disabled. Existing parser-retry, missing ID/timestamp, cached/reasoning usage, and rollout-result preservation checks also pass.
  • Local HTTPS tests verify rejection of an untrusted certificate and success with each CA-bundle variable. The startup subprocess test verifies installation occurs once and restarted imports see the installed package.
  • pre-commit run --all-files, uv lock --check --offline, and git diff --check origin/main...HEAD: passed. The local private-guardword hook skipped because its catalog was unavailable. All four commits retain DCO sign-offs.
NEMO_GYM_EXTRA_ROOTS="$PWD" PYTHONPATH="$PWD" RAY_TMPDIR=/tmp \
  .venv/bin/python -m pytest \
  responses_api_agents/osworld_agent/tests \
  resources_servers/osworld/tests benchmarks/osworld/tests \
  tests/unit_tests/test_rollout_collection.py \
  tests/unit_tests/test_rollout_correlation.py \
  tests/unit_tests/test_rollout_health.py \
  --import-mode=importlib -q --tb=short -o addopts='' -o log_cli=false

Rollout evidence and limits

Historical evidence reported before this rebase: the HTTPS AgentEnv canary completed 12/12 evaluated, runtime-eligible rollouts, with zero masked rollouts and 128 OSWorld steps. A recorded-response replay of its 128 completions produced 12 healthy rollouts and unchanged scored results.

Those live canary and saved-run replay checks were not repeated on this rebased head. No new live benchmark or full-benchmark parity result is claimed. The full repository coverage gate remains for CI.

@Glorf Glorf added bug Something isn't working area:agent Agent harnesses and Responses API agent behavior labels Sep 29, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Glorf
Glorf marked this pull request as ready for review September 29, 2026 12:25
@Glorf

Glorf commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a56fc4c

@Glorf

Glorf commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

/claude review

@claude

claude Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

SHIP — no reliability concerns.

Focused, well-tested addition of an opt-in install_optional_runtime_dependencies flag on the OSWorld agent config, wired into require_optional_runtime_dependencies(install_if_missing=...).

Checked the two things that could bite here and both hold:

  • No restart loop. After os.execv the process re-runs require_optional_runtime_dependencies; if deps are now satisfied it returns, and if the installer failed to satisfy them, install_optional_runtime_deps.sh re-validates at its tail under set -e and exits non-zero → subprocess.run(check=True) raises CalledProcessError and startup halts. Bounded, not infinite. test_opt_in_install_failure_stops_startup covers this.
  • Correct re-exec. os.execv(sys.executable, [sys.executable, *sys.orig_argv[1:]]) reconstructs the original command line (preserves -m module / interpreter flags), and the installer targets sys.prefix — the same interpreter that restarts — so the fresh process sees the newly installed native packages. test_opt_in_install_restarts_with_fresh_imports exercises the reload-from-disk path.

Default stays False, so behavior is unchanged unless explicitly opted in; the restart-only path keeps validation and native imports out of a process that already loaded stale copies. Docs in both READMEs match the code. Sync startup path, so no async-client or ray.get concerns.

NOTE (non-blocking): the return after os.execv is dead code since execv replaces the process image — harmless.

@Glorf
Glorf requested a review from JeffPengCoder September 29, 2026 12:33
@Glorf
Glorf requested a review from a team as a code owner September 29, 2026 14:13
@Glorf
Glorf force-pushed the mbien/osworld-native-runtime-deps branch from 6a23896 to a456a51 Compare September 29, 2026 15:18
@yaoyu-33 yaoyu-33 added blocked Work cannot move forward until an external dependency is cleared complexity:high Cross-component or shared-contract change with a large review surface labels Sep 29, 2026
@Glorf Glorf changed the title fix(osworld): support opt-in runtime dependency setup fix(osworld): complete native AgentEnv evaluation and health reporting Sep 29, 2026
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Sep 30, 2026
wprazuch
wprazuch previously approved these changes Oct 20, 2026
@Glorf

Glorf commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 35f3b5a

@Glorf

Glorf commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

/claude review

@github-actions

Copy link
Copy Markdown
Contributor

@Glorf /claude review has been retired. Pull-request reviews now run through /review; comment this instead:

/review

Add model=claude to keep a Claude reviewer (the default is model=codex). mode=light|strict selects the review depth. Comment /review help for all options.

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP WITH CARE — two RISK findings in the new trajectory projection.

The projection confuses unsuccessful requests with completions missing evidence, and unavailable turn records with an observed zero-turn rollout. These produce incorrect health-check outcomes without changing evaluator scores.

Reviewed all 10 changed files and their affected startup, forwarding, collector, and health-check contracts. Startup coverage was completed directly because its delegated report was unavailable. No additional introduced defects were validated in dependency installation or HTTP CA handling.

Static review only; tests and live rollouts were not executed. The supplied historical canary/replay evidence was considered, not independently reproduced.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

@Glorf
Glorf force-pushed the mbien/osworld-native-runtime-deps branch from 35f3b5a to fa82282 Compare October 28, 2026 09:02
@Glorf

Glorf commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test fa82282

@Glorf

Glorf commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP — both prior RISK findings are resolved; no eligible concerns found in this follow-up.

  • Unsuccessful requests versus missing completion evidence: the wrapper now preserves an explicit request-outcome marker through the adapter and extraction. The projection excludes confirmed unsuccessful requests from completion turns without discarding their captures. Ambiguous failures and received completions with lost evidence still produce gaps. Inspected regression assertions distinguish healthy recovery, terminal failure, and unavailable completion evidence while preserving independent known/unknown usage.
  • Unavailable records versus observed zero turns: the completeness branch now emits turns_unavailable when extraction is incomplete and yields no completion calls. The regression cases distinguish missing evidence from a complete zero-call observation, retaining the genuine missing-turn check for the latter.

Completed the follow-up across producer, projection, collector, and health-check contracts. The previously reviewed tree was unavailable, so an independent inter-review tree comparison was not possible; this was not a fresh whole-PR review. Static source and test inspection only—tests and live rollouts were not executed.

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 findings-only review. Request a full review with /review reset=true.

@Glorf
Glorf force-pushed the mbien/osworld-native-runtime-deps branch from fa82282 to fa44236 Compare October 28, 2026 11:53
@Glorf

Glorf commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test fa44236

This branch was previously deployed

1 inactive deployment
public — fa44236c Deployed Oct 28, 2026 by copy-pr-bot[bot] via release / finalize / notify #7803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior blocked Work cannot move forward until an external dependency is cleared bug Something isn't working complexity:high Cross-component or shared-contract change with a large review surface sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants