Repository navigation
feat(webvoyager): add benchmark and shared web runtime infrastructure - #2295
Conversation
4dc5d85 to
ef9a959
Compare
|
FYI @mpatel31415 |
mpatel31415
left a comment
There was a problem hiding this comment.
-
osworld_internalis mentioned in a few files (e.g. `benchmarks/webvoyager/native-v3.md), but actually it's not used and 2 new runtimes are implemented. From discussion with @Glorf i understood that osworld work can be reused here. -
If only WebVoyager is validated we need to keep the changes only related to this benchmarks and add visualwebarena and webarena in the follow-up PRs, once they are validated too. Review done by CC mentioned some correctness issues for webarena, so I think we should be careful about it.
-
Can you clarify difference between 2 implemented runtimes? if legacy WebVoyager with browsergym_web is not validated maybe it's not needed now and we can just drop it? Adding not valdiated code paths to Gym is risky in my opinion.
-
Is it correct to assume that native_web should be used for Super 3.5 VL ? I see in benchmarks/webvoyager/README.md "The maintained 552-task Nano Omni", so it's a bit confusing which version is the one to be used for Super 3.5 VL
-
I think that we should not have versions of the models (v3) used to index markdown files or or e.g. "Native Nano Omni route" comments inside benchmark, they should be model-agnostic.
-
I'm attaching results of review done by CC, I'd be glad to take a deeper dive into the code myself once it contains only validated and needed runtimes and benchmarks.
Browsergym is for other models, current native_gym only works for nemotron. legacy webvoyager is for pure omni v3 (without any change toward behavior like super3.5) and I could remove it if it is not needed at all.
Until our tokenizer alike component is stable enough.
|
Could you please point me to any resources so I could understand e. g. "any change toward behavior like super3.5" or "we use customized tokenizer/chat-template, etc to make nano omni behave like super 3.5. ". What is this customised tokenizer? Our goal is to compare Qwen3.5-122B-A10B and Super 3.5 VL and I'm not sure that it's possible to do so with this version of WebVoyager, considering that "Browsergym is for other models" and " current native_gym only works for nemotron". |
There was a problem hiding this comment.
@JeffPengCoder - just to let you know, that there is "Use of AI and LLM Tools" section in contribution guide in Gym's documentation. You might want to look into this section which describes when changes to a PR are required.
“Customized tokenizer” was also an imprecise description. It refers to model-serving assets used by the Nano alignment profile:
For a fair comparison between Qwen3.5-122B-A10B and Super 3.5 VL, both models must use the same:
We have completed an end-to-end Qwen3.5 diagnostic on the BrowserGym path, but we have not yet completed a same-runtime Qwen-versus-Super comparison. The PR also does not currently contain a pinned Super 3.5 VL model profile, but current infrastructure of Omin does apply for Super 3.5 on native web path. |
Get, let me try to use stacked PR |
776a6a6 to
f5677f3
Compare
|
/ok to test 893f01d |
|
/review-approve reset=true |
mpatel31415
left a comment
There was a problem hiding this comment.
Completed the incremental source review at 893f01d: no new material source findings. The PR's runtime/test/lock bytes retain their reviewed scope; the release caller now pins merged FW620 at 1ea8987.
Two current integration-CI blockers are verified:
- Combined core coverage is 94.72% against the existing 95% gate. Its four core artifacts plus sandbox artifact exclude the server-suite coverage. I prepared a test-only patch moving the existing 18 CAPTCHA tests from resources_servers/visual_browser/tests/test_captcha.py to tests/unit_tests/benchmarks/visual_browser/test_captcha.py, with the package marker and measured timing entry. The tests are byte-identical: routed 18/18 pass, core collection finds all 18, two partition checks pass, and Ruff/format/test-quality checks pass. Actual local execution covers 211 statements listed as missing in CI under the original 302-statement mask. That would only just clear the observed deficit at a fixed denominator; the actual combined CI must verify it.
- Server shard 1 fails 21 WMT tests while downloading the FLORES200 tokenizer with an expired-certificate validation error. WMT app/tests match base e10c3a1 exactly; the other seven components, including interactive_browser, pass. The log does not isolate the failing certificate chain or runner cause.
Jeff, who will apply the prepared CAPTCHA test-file move to the source branch?
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD
I found two BLOCKER issues and five RISK issues, detailed inline. Missing judge evidence currently becomes an unmasked score of zero, and cancellation during browser-pool recycling can permanently remove a slot.
I completed the static review across the 115 changed files and their affected agent, browser, judge and recovery paths. Two delegated reports weren't returned, so I inspected those areas directly. Lock-file inspection covered resolver policy and relevant package metadata, not independent verification of every external package hash.
The earlier mixed-terminal evidence fix, cancelled-mutation fence, and judge deadline and nested-grade corrections are present in the current source; I haven't repeated those findings.
No tests, CI jobs or browser/model rollouts ran in this review. The patches and acceptance checks below are proposed and need verification before adoption. The external release-template implementation isn't mounted, so this review doesn't certify that dependency or benchmark qualification.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Move CPU-only visual browser and CAPTCHA tests into the benchmark core suite so their coverage is included by the core+sandbox gate. Retain the server packaging contract and add provider failure, polling deadline, proxy, cookie and token injection cases. Validation: 53 focused core tests and 1,347 related regression tests pass; pre-commit --all-files passes. Combining the original five CI coverage artifacts with the new local core coverage passes the unchanged 95% gate at 95.19% (76,057 statements, 3,659 missed). Signed-off-by: Jeff Peng <[email protected]>
|
@JeffPengCoder I verified your published The fixes cover:
Validation on source-attributed private candidates: 149 parser/agent cases, 37 judge/schema cases, 19 pool cases and three additional independent pool probes pass. The final assertion/import-only edits were separately rerun; Ruff and exact-preimage patch application pass. Original-source regressions fail before the fixes. These are focused local checks with external process/model/browser boundaries controlled; they are not a new real-process or model rollout. The previously inspected Nano SDK 2.45 positive trajectories retain their scope; the changed pool cancellation/close boundaries still need targeted runtime evidence before claiming those paths qualified. Your published core-test migration supersedes my earlier CAPTCHA routing proposal and is kept out of this patch. Its retained source/test review and focused validation still apply. Current native CI at I also reviewed the complete The targeted actual-process validation is now published in I inspected current Server shard1 job131185388977: its WMT component reports 21 failures and 97 passes. Every failure in that component’s pytest summary is a FLORES tokenizer download rejected by TLS with “certificate has expired.” This establishes the current failure shape; I have not verified the separate main-branch reproduction claim, and the required CI gate remains failed. No TLS workaround, rerun or waiver was applied. Jeff’s exact-head MEMBER CI comment and the trusted mirror already cover Incorporated runtime/test patch — historical preimage only (15 paths; SHA256 e4ee68fd75a5eba76355b9430f4f9908e7ea2e09b225d2eb00456e3aae081c08)diff --git a/nemo_gym/web/actions.py b/nemo_gym/web/actions.py
--- a/nemo_gym/web/actions.py
+++ b/nemo_gym/web/actions.py
@@ -220,20 +220,25 @@
try:
try:
arguments = json.loads(raw_arguments) if isinstance(raw_arguments, str) else raw_arguments
- except json.JSONDecodeError as exc:
+ except ValueError as exc:
raise ActionParseError(f"invalid JSON arguments for Nano Omni tool {name!r}") from exc
if arguments is None:
arguments = {}
if not isinstance(arguments, dict):
raise ActionParseError(f"Nano Omni tool {name!r} arguments must be an object")
- if name not in NANO_OMNI_TOOL_NAMES:
+ if not isinstance(name, str) or name not in NANO_OMNI_TOOL_NAMES:
raise ActionParseError(f"unsupported Nano Omni browser tool: {name!r}")
- arguments, computer_actions = _validate_native_tool_arguments(
- name,
- arguments,
- max_computer_actions=max_computer_actions,
- limits=limits,
- )
+ try:
+ arguments, computer_actions = _validate_native_tool_arguments(
+ name,
+ arguments,
+ max_computer_actions=max_computer_actions,
+ limits=limits,
+ )
+ except ActionParseError:
+ raise
+ except (TypeError, ValueError, OverflowError) as exc:
+ raise ActionParseError(f"invalid arguments for Nano Omni tool {name!r}") from exc
except ActionParseError as exc:
if (
calls
diff --git a/responses_api_agents/web_agent/qwen_computer_use.py b/responses_api_agents/web_agent/qwen_computer_use.py
--- a/responses_api_agents/web_agent/qwen_computer_use.py
+++ b/responses_api_agents/web_agent/qwen_computer_use.py
@@ -563,7 +563,10 @@
computer_actions.append(action)
status = "action"
elif name in {"scroll", "hscroll"}:
- requested = int(_number(params.get("pixels"), 0.0))
+ pixels = _number(params.get("pixels"), 0.0)
+ if not math.isfinite(pixels):
+ raise ActionParseError("Qwen scroll pixels must be finite")
+ requested = int(pixels)
amount = min(abs(requested), MAX_SCROLL_AMOUNT)
if name == "scroll":
direction = "up" if requested >= 0 else "down"
diff --git a/responses_api_agents/web_agent/app.py b/responses_api_agents/web_agent/app.py
--- a/responses_api_agents/web_agent/app.py
+++ b/responses_api_agents/web_agent/app.py
@@ -217,7 +217,7 @@
if qwen_state is None:
raise ActionParseError("Qwen policy state is required for qwen_xml_computer_use")
return parse_qwen_action(
- qwen_response_text(response),
+ _extract_output_text(response),
coordinate_type=qwen_state.coordinate_type,
original_size=qwen_state.original_size,
processed_size=qwen_state.processed_size,
diff --git a/tests/unit_tests/web/test_actions.py b/tests/unit_tests/web/test_actions.py
--- a/tests/unit_tests/web/test_actions.py
+++ b/tests/unit_tests/web/test_actions.py
@@ -370,3 +370,50 @@
with pytest.raises(ActionParseError) as error:
parse_nano_omni_tool_calls(prefix + [bad], max_calls=1 if prefix_kind in {"at_limit", "over_limit"} else None)
assert error.value.validated_prefix is None
+
+
+@pytest.mark.parametrize(
+ "name,arguments",
+ [
+ pytest.param("computer", {"actions": [{"action": []}]}, id="unhashable-action"),
+ pytest.param(
+ "computer",
+ {"actions": [{"action": "scroll", "scroll_parameters": {"scroll_direction": [], "scroll_amount": 1}}]},
+ id="unhashable-direction",
+ ),
+ pytest.param("terminate", {"status": []}, id="unhashable-status"),
+ pytest.param("navigate", {"url": "http://["}, id="malformed-navigate-url"),
+ pytest.param("tabs_create", {"url": "http://["}, id="malformed-tab-url"),
+ pytest.param(
+ "computer", {"actions": [{"action": "left_click", "coordinate": [10**400, 0]}]}, id="float-overflow"
+ ),
+ pytest.param([], {}, id="nonstring-tool-name"),
+ pytest.param("navigate", '{"url":' + "9" * 5000 + "}", id="json-integer-limit"),
+ ],
+)
+def test_native_deterministic_argument_errors_remain_parse_errors(name, arguments) -> None:
+ item = {"type": "function_call", "name": name, "arguments": arguments}
+ with pytest.raises(ActionParseError) as error:
+ parse_nano_omni_tool_calls([item])
+ assert error.value.reason == "invalid_tool_arguments"
+ assert error.value.validated_prefix is None
+
+
+def test_native_schema_exception_exposes_only_previous_complete_calls() -> None:
+ calls = [
+ {"type": "function_call", "call_id": "first", "name": "navigate", "arguments": '{"url":"back"}'},
+ {
+ "type": "function_call",
+ "call_id": "bad",
+ "name": "computer",
+ "arguments": '{"actions":[{"action":"wait","duration":0},{"action":[]}]}',
+ },
+ {"type": "function_call", "call_id": "later", "name": "navigate", "arguments": '{"url":"forward"}'},
+ ]
+ before = json.dumps(calls)
+ with pytest.raises(ActionParseError) as error:
+ parse_nano_omni_tool_calls(calls)
+ assert error.value.validated_prefix.arguments["calls"] == [
+ {"id": "first", "name": "navigate", "arguments": {"url": "back"}}
+ ]
+ assert json.dumps(calls) == before
diff --git a/responses_api_agents/web_agent/tests/test_qwen_computer_use.py b/responses_api_agents/web_agent/tests/test_qwen_computer_use.py
--- a/responses_api_agents/web_agent/tests/test_qwen_computer_use.py
+++ b/responses_api_agents/web_agent/tests/test_qwen_computer_use.py
@@ -7,7 +7,7 @@
import pytest
from PIL import Image
-from nemo_gym.web import WebImage, WebObservation
+from nemo_gym.web import ActionParseError, WebImage, WebObservation
from responses_api_agents.web_agent.qwen_computer_use import (
COLLAPSED_SCREENSHOT_TEXT,
QwenPolicyState,
@@ -187,3 +187,31 @@
)
def test_qwen_smart_resize_uses_factor_32(height, width, expected) -> None:
assert smart_resize(height, width) == expected
+
+
+@pytest.mark.parametrize("action", ["scroll", "hscroll"])
+@pytest.mark.parametrize("pixels", ["NaN", "Infinity", "-Infinity", "1e999"])
+def test_qwen_scroll_rejects_nonfinite_values_as_parse_errors(action, pixels) -> None:
+ with pytest.raises(ActionParseError, match="finite"):
+ parse_qwen_action(
+ _xml(action, pixels=pixels),
+ coordinate_type="relative",
+ original_size=(1920, 1080),
+ processed_size=(1920, 1088),
+ )
+
+
+@pytest.mark.parametrize("action,positive,negative", [("scroll", "up", "down"), ("hscroll", "right", "left")])
+@pytest.mark.parametrize("pixels,amount", [("1e300", 50), ("-100000", 50), ("0", 0)])
+def test_qwen_finite_scroll_keeps_cap_sign_and_zero(action, positive, negative, pixels, amount) -> None:
+ parsed = parse_qwen_action(
+ _xml(action, pixels=pixels),
+ coordinate_type="relative",
+ original_size=(1920, 1080),
+ processed_size=(1920, 1088),
+ )
+ parameters = parsed.arguments["calls"][0]["arguments"]["actions"][0]["scroll_parameters"]
+ assert parameters == {
+ "scroll_direction": negative if pixels.startswith("-") else positive,
+ "scroll_amount": amount,
+ }
diff --git a/responses_api_agents/web_agent/tests/test_app.py b/responses_api_agents/web_agent/tests/test_app.py
--- a/responses_api_agents/web_agent/tests/test_app.py
+++ b/responses_api_agents/web_agent/tests/test_app.py
@@ -31,6 +31,9 @@
_redact_old_images,
_web_failure_kind,
)
+from responses_api_agents.web_agent.qwen_computer_use import QwenPolicyState
+from responses_api_agents.web_agent.qwen_computer_use import response_text as qwen_response_text
+from responses_api_agents.web_agent.tests.test_qwen_computer_use import SCREENSHOT, _xml
def _model_response(text: str) -> dict:
@@ -73,6 +76,145 @@
payload["status"] = "incomplete"
payload["incomplete_details"] = {"reason": "max_output_tokens"}
return payload
+
+
+def _reasoning_response(final: str) -> dict:
+ payload = _model_response(final)
+ payload["output"].insert(
+ 0,
+ {
+ "id": "draft-reasoning",
+ "type": "reasoning",
+ "summary": [{"type": "summary_text", "text": _xml("type", text="draft must not execute")}],
+ },
+ )
+ return payload
+
+
+@pytest.mark.parametrize("final", [_xml("left_click", coordinate="[500, 250]"), "The requested answer is 42."])
+def test_qwen_action_boundary_ignores_reasoning_but_keeps_history(final: str) -> None:
+ response = NeMoGymResponse.model_validate(_reasoning_response(final))
+ state = QwenPolicyState(instruction="Find the answer")
+ action = _parse_response_action(
+ response,
+ WebActionProfile.COMPUTER_USE,
+ policy_protocol="qwen_xml_computer_use",
+ qwen_state=state,
+ )
+ if final.startswith("Action:"):
+ assert action.arguments["calls"] == [
+ {
+ "id": None,
+ "name": "computer",
+ "arguments": {
+ "actions": [{"action": "left_click", "coordinate": pytest.approx([500 / 999, 250 / 999])}]
+ },
+ }
+ ]
+ else:
+ assert action.terminal is True
+ assert action.arguments["calls"] == [
+ {"id": None, "name": "terminate", "arguments": {"status": "success", "answer": final}}
+ ]
+ assert action.answer == final
+ state.record_response(qwen_response_text(response), action)
+ assert "draft must not execute" in state.responses[0]
+ assert final in state.responses[0]
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize("protocol", ["nano_omni_toolcall", "qwen_xml_computer_use"])
+async def test_deterministic_parser_failure_exhausts_budget_then_evaluates(protocol: str) -> None:
+ agent = _agent(
+ parse_retries=1,
+ policy_protocol=protocol,
+ nano_omni_retry_invalid_tool_calls=True,
+ nano_omni_parse_retry_delay_secs=0,
+ )
+ seed = _seed()
+ seed["observation"]["screenshot"]["data_url"] = SCREENSHOT
+ response = (
+ _native_model_response("computer", '{"actions":[{"action":[]}]}')
+ if protocol == "nano_omni_toolcall"
+ else _model_response(_xml("scroll", pixels="NaN"))
+ )
+ calls = _wire(
+ agent,
+ {
+ "/seed_session": [seed],
+ "/v1/responses": [response, response],
+ "/evaluate": [{"result": {"valid_sample": True, "reward": 1.0, "task_success": True}}],
+ "/close": [{"closed": True}],
+ },
+ )
+ request = MagicMock()
+ request.cookies = {}
+ result = await agent.run(
+ request,
+ WebAgentRunRequest(
+ responses_create_params={"input": [], "temperature": 0.1},
+ web_task=WebTask(benchmark=WebBenchmark.WEBARENA, task_id="0"),
+ ),
+ )
+ assert [path for _server, path, _body in calls] == [
+ "/seed_session",
+ "/v1/responses",
+ "/v1/responses",
+ "/evaluate",
+ "/close",
+ ]
+ assert (result.model_turns, result.environment_steps) == (2, 0)
+ assert result.reward == 1.0
+ assert result.mask_sample is False
+ assert result.truncated is True
+
+
+@pytest.mark.asyncio
+async def test_schema_exception_executes_only_complete_prefix_before_evaluation() -> None:
+ agent = _agent(parse_retries=0, nano_omni_retry_invalid_tool_calls=False)
+ response = _native_model_response("navigate", '{"url":"back"}')
+ response["output"].extend(
+ [
+ {
+ **_native_model_response("computer", '{"actions":[{"action":"wait","duration":0},{"action":[]}]}')[
+ "output"
+ ][0],
+ "call_id": "bad",
+ },
+ {**_native_model_response("navigate", '{"url":"forward"}')["output"][0], "call_id": "later"},
+ ]
+ )
+ before = json.dumps(response)
+ calls = _wire(
+ agent,
+ {
+ "/seed_session": [_seed()],
+ "/v1/responses": [response],
+ "/step": [{"operation_id": "step-0", "observation": _observation(), "execution_ok": True}],
+ "/evaluate": [{"result": {"valid_sample": True, "reward": 1.0, "task_success": True}}],
+ "/close": [{"closed": True}],
+ },
+ )
+ request = MagicMock()
+ request.cookies = {}
+ result = await agent.run(
+ request,
+ WebAgentRunRequest(
+ responses_create_params={"input": []},
+ web_task=WebTask(benchmark=WebBenchmark.WEBARENA, task_id="0"),
+ ),
+ )
+ assert [path for _server, path, _body in calls] == [
+ "/seed_session",
+ "/v1/responses",
+ "/step",
+ "/evaluate",
+ "/close",
+ ]
+ step = next(body for _server, path, body in calls if path == "/step")
+ assert step["action"]["arguments"]["calls"] == [{"id": "call-1", "name": "navigate", "arguments": {"url": "back"}}]
+ assert (result.reward, result.mask_sample, result.model_turns, result.environment_steps) == (1.0, False, 1, 1)
+ assert json.dumps(response) == before
def test_incomplete_model_reason_reads_openai_response_details() -> None:
diff --git a/resources_servers/webvoyager_judge/app.py b/resources_servers/webvoyager_judge/app.py
--- a/resources_servers/webvoyager_judge/app.py
+++ b/resources_servers/webvoyager_judge/app.py
@@ -97,12 +97,12 @@
"event=webvoyager_judge_short_circuit task=%s reason=missing_judge_evidence "
"valid_sample=%s elapsed_seconds=%.3f",
body.task.task_id,
- True,
+ False,
time.monotonic() - started,
)
return WebVoyagerJudgeResponse(
result=WebVerifierResult(
- valid_sample=True,
+ valid_sample=False,
failure_kind="web:missing_judge_evidence",
verifier_version=self.config.verifier_version,
)
diff --git a/resources_servers/webvoyager_judge/task_data.py b/resources_servers/webvoyager_judge/task_data.py
--- a/resources_servers/webvoyager_judge/task_data.py
+++ b/resources_servers/webvoyager_judge/task_data.py
@@ -11,8 +11,8 @@
class TaskData(WebTaskRow):
final_answer: str = Field(default="", json_schema_extra={"consumed_by": ["verify"]})
- screenshots: List[str] = Field(default_factory=list, json_schema_extra={"consumed_by": ["verify"]})
- page_urls: List[str] = Field(default_factory=list, json_schema_extra={"consumed_by": ["verify"]})
+ screenshots: List[str] = Field(default_factory=list, max_length=200, json_schema_extra={"consumed_by": ["verify"]})
+ page_urls: List[str] = Field(default_factory=list, max_length=200, json_schema_extra={"consumed_by": ["verify"]})
response: Optional[Dict[str, Any]] = Field(
default=None,
description="Optional stored rollout response used to recover judge evidence during reverification.",
diff --git a/resources_servers/webvoyager_judge/tests/test_app.py b/resources_servers/webvoyager_judge/tests/test_app.py
--- a/resources_servers/webvoyager_judge/tests/test_app.py
+++ b/resources_servers/webvoyager_judge/tests/test_app.py
@@ -4,13 +4,14 @@
import asyncio
import json
import logging
+from pathlib import Path
from unittest.mock import AsyncMock, MagicMock
import pytest
from pydantic import ValidationError
from nemo_gym.client import ServerClient
-from nemo_gym.config import ModelServerRef
+from nemo_gym.config import ConfigError, ModelServerRef
from nemo_gym.eval.rollout_reverification import InputRolloutPair, _build_verify_payload
from nemo_gym.server_runtime import ReverifyMode
from nemo_gym.verification import is_judge_failure
@@ -102,8 +103,8 @@
)
-def _standard_request() -> WebVoyagerStandardVerifyRequest:
- evidence_request = _request()
+def _standard_request(*, screenshot_count: int = 1) -> WebVoyagerStandardVerifyRequest:
+ evidence_request = _request(screenshot_count=screenshot_count)
return WebVoyagerStandardVerifyRequest.model_validate(
{
"responses_create_params": {"input": "Solve"},
@@ -114,6 +115,88 @@
"page_urls": evidence_request.page_urls,
}
)
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize("answer", ["", "answer"])
+async def test_standard_verify_masks_missing_required_screenshots(answer: str, caplog) -> None:
+ import httpx
+
+ server = _server()
+ server.server_client.post = AsyncMock(side_effect=AssertionError("missing evidence must not call the judge"))
+ request = _standard_request(screenshot_count=0).model_copy(update={"final_answer": answer})
+ transport = httpx.ASGITransport(app=server.setup_webserver(), raise_app_exceptions=False)
+
+ with caplog.at_level(logging.WARNING, logger="nemo_gym.resources_servers.webvoyager_judge"):
+ async with httpx.AsyncClient(transport=transport, base_url="http://test") as client:
+ response = await client.post("/verify", json=request.model_dump(mode="json"))
+
+ assert response.status_code == 200, response.text
+ result = response.json()
+ assert result["reward"] == result["verifier_result"]["reward"] == 0.0
+ assert result["mask_sample"] is True
+ assert result["verifier_result"]["valid_sample"] is False
+ assert result["failure_kind"] == result["verifier_result"]["failure_kind"] == "web:missing_judge_evidence"
+ assert result["judge_text"] == ""
+ assert result["response"] == request.response.model_dump(mode="json")
+ assert "reason=missing_judge_evidence valid_sample=False" in caplog.text
+ server.server_client.post.assert_not_awaited()
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize("verdict,reward", [("SUCCESS", 1.0), ("FAILURE", 0.0)])
+async def test_standard_verify_supports_text_only_judging_when_configured(verdict: str, reward: float) -> None:
+ import httpx
+
+ server = _server(require_screenshot=False)
+ server.server_client.post = AsyncMock(
+ return_value=_FakeHttpResponse(_model_response(json.dumps({"verdict": verdict})))
+ )
+ request = _standard_request(screenshot_count=0)
+ transport = httpx.ASGITransport(app=server.setup_webserver(), raise_app_exceptions=False)
+ async with httpx.AsyncClient(transport=transport, base_url="http://test") as client:
+ response = await client.post("/verify", json=request.model_dump(mode="json"))
+
+ assert response.status_code == 200, response.text
+ result = response.json()
+ assert result["reward"] == result["verifier_result"]["reward"] == reward
+ assert result["mask_sample"] is False
+ assert result["verifier_result"]["valid_sample"] is True
+ assert result["failure_kind"] is None
+ assert result["verifier_result"]["metadata"]["parsed"]["verdict"] == verdict
+ assert result["verifier_result"]["metadata"]["screenshots_used"] == 0
+ server.server_client.post.assert_awaited_once()
+ params = server.server_client.post.await_args.kwargs["json"]
+ assert [block["type"] for block in params.model_dump(mode="json")["input"][0]["content"]] == ["input_text"]
+
+
+@pytest.mark.asyncio
+async def test_committed_screenshotless_examples_match_missing_evidence_contract() -> None:
+ import httpx
+
+ data_dir = Path(__file__).resolve().parents[1] / "data"
+ rows = [json.loads(line) for line in (data_dir / "example_rollouts.jsonl").read_text().splitlines()]
+ metrics = json.loads((data_dir / "example_metrics.json").read_text())
+ server = _server()
+ server.server_client.post = AsyncMock(side_effect=AssertionError("screenshotless fixture must not call the judge"))
+ transport = httpx.ASGITransport(app=server.setup_webserver(), raise_app_exceptions=False)
+ async with httpx.AsyncClient(transport=transport, base_url="http://test") as client:
+ for row in rows:
+ response = await client.post("/verify", json=row)
+ assert response.status_code == 200, response.text
+ result = response.json()
+ assert row["screenshots"] == []
+ assert row["reward"] == result["reward"] == 0.0
+ assert row["mask_sample"] is result["mask_sample"] is True
+ assert row["failure_kind"] == result["failure_kind"] == "web:missing_judge_evidence"
+ assert row["verifier_result"]["valid_sample"] is result["verifier_result"]["valid_sample"] is False
+ assert row["verifier_result"] == result["verifier_result"]
+ assert row["verifier_metadata"] == result["verifier_metadata"] == {}
+
+ assert len(rows) == metrics["Number of examples"] == 5
+ assert metrics["Masked examples"] == sum(row["mask_sample"] for row in rows) == 5
+ assert metrics["Scored examples"] == sum(not row["mask_sample"] for row in rows) == 0
+ server.server_client.post.assert_not_awaited()
@pytest.mark.asyncio
@@ -438,13 +521,13 @@
@pytest.mark.asyncio
-@pytest.mark.parametrize("verdict,reward", [("SUCCESS", 1.0), ("FAILURE", 0.0)])
+@pytest.mark.parametrize("verdict,reward", [("SUCCESS", 1.0), ("FAILURE", 0.0), (None, 0.0)])
async def test_public_rejudgment_persists_consistent_nested_grade(tmp_path, verdict, reward):
import httpx
from nemo_gym.rollouts import RolloutStore, RunManifest
- request = _standard_request()
+ request = _standard_request(screenshot_count=0 if verdict is None else 1)
inputs = [{"_ng_task_index": 0, "_ng_rollout_index": 0, "agent_ref": {"name": "agent"}}]
source = tmp_path / "input.jsonl"
source.write_text(json.dumps(inputs[0]) + "\n")
@@ -484,11 +567,24 @@
_ng_rejudge_operation_id=pending.operation_id,
_ng_rejudge_admitted_at=pending.admitted_at,
)
- assert store.record_rejudgment(failure, result)
+ if verdict is None:
+ assert result["mask_sample"] is True
+ assert result["verifier_result"]["valid_sample"] is False
+ with pytest.raises(ConfigError, match="no scored result"):
+ store.record_rejudgment(failure, result)
+ store.withdraw_rejudgment("0-0", pending.operation_id, unsaved_judge_failure=True)
+ else:
+ assert store.record_rejudgment(failure, result)
+ if verdict is None:
+ assert RolloutStore.read(output).selected("success") == []
+ assert RolloutStore.read(output).selected("failure") == [failure]
+ server.server_client.post.assert_not_awaited()
+ return
(saved,) = RolloutStore.read(output).selected("success")
assert saved["reward"] == saved["verifier_result"]["reward"] == reward
- assert saved["mask_sample"] is False and saved["verifier_result"]["valid_sample"] is True
- assert saved["verifier_result"]["failure_kind"] is None
+ assert saved["mask_sample"] is False
+ assert saved["verifier_result"]["valid_sample"] is True
+ assert saved["failure_kind"] == saved["verifier_result"]["failure_kind"] is None
assert saved["task_success"] == saved["verifier_result"]["task_success"] == (reward == 1)
assert saved["verifier_metadata"] == saved["verifier_result"]["metadata"]
assert saved["response"] == failure["response"]
diff --git a/tests/unit_tests/web/test_task_data.py b/tests/unit_tests/web/test_task_data.py
--- a/tests/unit_tests/web/test_task_data.py
+++ b/tests/unit_tests/web/test_task_data.py
@@ -5,8 +5,12 @@
from pathlib import Path
import pytest
+from pydantic import ValidationError
from nemo_gym.data.task_data import load_task_data_schema, validate_jsonl_rows
+from nemo_gym.web.models import WebTask
+from resources_servers.webvoyager_judge.models import WebVoyagerJudgeRequest, WebVoyagerStandardVerifyRequest
+from resources_servers.webvoyager_judge.task_data import TaskData as JudgeTaskData
REPO_ROOT = Path(__file__).resolve().parents[3]
@@ -39,3 +43,53 @@
report = validate_jsonl_rows(component_dir.name, adapter, "invalid.jsonl", [json.dumps(row)])
assert report.error_rows == 1
+
+
+@pytest.mark.parametrize("field", ["screenshots", "page_urls"])
+@pytest.mark.parametrize("count", [0, 200])
+def test_judge_evidence_boundary_is_accepted_by_dataset_and_runtime(field: str, count: int) -> None:
+ row = json.loads((REPO_ROOT / "resources_servers/webvoyager_judge/data/example.jsonl").read_text().splitlines()[0])
+ row[field] = [f"evidence-{index}" for index in range(count)]
+
+ dataset = JudgeTaskData.model_validate(row)
+ standard = WebVoyagerStandardVerifyRequest.model_validate(row)
+ evidence = WebVoyagerJudgeRequest.model_validate(
+ {"task": WebTask.model_validate(row["web_task"]), field: row[field]}
+ )
+
+ assert len(getattr(dataset, field)) == count
+ assert len(getattr(standard, field)) == count
+ assert len(getattr(evidence, field)) == count
+ component_dir = REPO_ROOT / "resources_servers/webvoyager_judge"
+ adapter = load_task_data_schema(component_dir)
+ assert adapter is not None
+ report = validate_jsonl_rows(component_dir.name, adapter, "boundary.jsonl", [json.dumps(row)])
+ assert report.clean, report.summary()
+
+
+@pytest.mark.parametrize("field", ["screenshots", "page_urls"])
+def test_judge_evidence_overflow_is_rejected_by_dataset_and_runtime(field: str) -> None:
+ row = json.loads((REPO_ROOT / "resources_servers/webvoyager_judge/data/example.jsonl").read_text().splitlines()[0])
+ row[field] = [f"evidence-{index}" for index in range(201)]
+
+ with pytest.raises(ValidationError, match="List should have at most 200 items"):
+ WebVoyagerStandardVerifyRequest.model_validate(row)
+ with pytest.raises(ValidationError, match="List should have at most 200 items"):
+ WebVoyagerJudgeRequest.model_validate({"task": WebTask.model_validate(row["web_task"]), field: row[field]})
+ with pytest.raises(ValidationError, match="List should have at most 200 items"):
+ JudgeTaskData.model_validate(row)
+ component_dir = REPO_ROOT / "resources_servers/webvoyager_judge"
+ adapter = load_task_data_schema(component_dir)
+ assert adapter is not None
+ report = validate_jsonl_rows(component_dir.name, adapter, "overflow.jsonl", [json.dumps(row)])
+ assert report.rows == report.error_rows == 1
+
+
+@pytest.mark.parametrize("field", ["screenshots", "page_urls"])
+def test_judge_evidence_schema_limits_cannot_drift(field: str) -> None:
+ limits = [
+ model.model_json_schema()["properties"][field].get("maxItems")
+ for model in (JudgeTaskData, WebVoyagerStandardVerifyRequest, WebVoyagerJudgeRequest)
+ ]
+
+ assert limits == [200, 200, 200]
diff --git a/resources_servers/webvoyager_judge/data/example_rollouts.jsonl b/resources_servers/webvoyager_judge/data/example_rollouts.jsonl
--- a/resources_servers/webvoyager_judge/data/example_rollouts.jsonl
+++ b/resources_servers/webvoyager_judge/data/example_rollouts.jsonl
@@ -1,5 +1,5 @@
-{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-0","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--0","intent":"Find a highly rated vegetarian lasagna recipe suitable for six people."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":false,"failure_kind":"agent_no_final_answer","judge_text":"","verifier_metadata":{}}
-{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-1","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--1","intent":"Find a four-star vegetarian lasagna recipe that uses zucchini."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":false,"failure_kind":"agent_no_final_answer","judge_text":"","verifier_metadata":{}}
-{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-2","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--2","intent":"Find a vegetarian lasagna under 600 calories per serving."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":false,"failure_kind":"agent_no_final_answer","judge_text":"","verifier_metadata":{}}
-{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-3","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--3","intent":"Find highly rated vegan chocolate chip cookies."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":false,"failure_kind":"agent_no_final_answer","judge_text":"","verifier_metadata":{}}
-{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-4","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--4","intent":"Find a four-star baked salmon recipe with under 30 minutes of prep time."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":false,"failure_kind":"agent_no_final_answer","judge_text":"","verifier_metadata":{}}
+{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-0","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--0","intent":"Find a highly rated vegetarian lasagna recipe suitable for six people."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":true,"failure_kind":"web:missing_judge_evidence","judge_text":"","verifier_metadata":{},"verifier_version":"webvoyager-gemini-v1","verifier_result":{"reward":0.0,"raw_score":0.0,"task_success":false,"valid_sample":false,"failure_kind":"web:missing_judge_evidence","verifier_version":"webvoyager-gemini-v1","metadata":{},"subscores":{},"evidence":[]}}
+{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-1","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--1","intent":"Find a four-star vegetarian lasagna recipe that uses zucchini."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":true,"failure_kind":"web:missing_judge_evidence","judge_text":"","verifier_metadata":{},"verifier_version":"webvoyager-gemini-v1","verifier_result":{"reward":0.0,"raw_score":0.0,"task_success":false,"valid_sample":false,"failure_kind":"web:missing_judge_evidence","verifier_version":"webvoyager-gemini-v1","metadata":{},"subscores":{},"evidence":[]}}
+{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-2","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--2","intent":"Find a vegetarian lasagna under 600 calories per serving."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":true,"failure_kind":"web:missing_judge_evidence","judge_text":"","verifier_metadata":{},"verifier_version":"webvoyager-gemini-v1","verifier_result":{"reward":0.0,"raw_score":0.0,"task_success":false,"valid_sample":false,"failure_kind":"web:missing_judge_evidence","verifier_version":"webvoyager-gemini-v1","metadata":{},"subscores":{},"evidence":[]}}
+{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-3","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--3","intent":"Find highly rated vegan chocolate chip cookies."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":true,"failure_kind":"web:missing_judge_evidence","judge_text":"","verifier_metadata":{},"verifier_version":"webvoyager-gemini-v1","verifier_result":{"reward":0.0,"raw_score":0.0,"task_success":false,"valid_sample":false,"failure_kind":"web:missing_judge_evidence","verifier_version":"webvoyager-gemini-v1","metadata":{},"subscores":{},"evidence":[]}}
+{"responses_create_params":{"input":"WebVoyager judge fixture"},"response":{"id":"judge-fixture-4","created_at":0,"model":"fixture","object":"response","output":[],"parallel_tool_calls":true,"tool_choice":"auto","tools":[]},"reward":0.0,"web_task":{"benchmark":"webvoyager","task_id":"Allrecipes--4","intent":"Find a four-star baked salmon recipe with under 30 minutes of prep time."},"final_answer":"","screenshots":[],"page_urls":["https://www.allrecipes.com/"],"raw_score":0.0,"task_success":false,"mask_sample":true,"failure_kind":"web:missing_judge_evidence","judge_text":"","verifier_metadata":{},"verifier_version":"webvoyager-gemini-v1","verifier_result":{"reward":0.0,"raw_score":0.0,"task_success":false,"valid_sample":false,"failure_kind":"web:missing_judge_evidence","verifier_version":"webvoyager-gemini-v1","metadata":{},"subscores":{},"evidence":[]}}
diff --git a/resources_servers/webvoyager_judge/data/example_metrics.json b/resources_servers/webvoyager_judge/data/example_metrics.json
--- a/resources_servers/webvoyager_judge/data/example_metrics.json
+++ b/resources_servers/webvoyager_judge/data/example_metrics.json
@@ -5,5 +5,7 @@
"num_repeats": 1,
"license": "Apache 2.0",
"Number of examples": 5,
- "note": "Deterministic empty-answer fixtures only; no benchmark scores are reported."
+ "note": "Screenshotless fixtures are masked for missing required judge evidence; no benchmark scores are reported.",
+ "Masked examples": 5,
+ "Scored examples": 0
}
diff --git a/resources_servers/webvoyager_judge/README.md b/resources_servers/webvoyager_judge/README.md
--- a/resources_servers/webvoyager_judge/README.md
+++ b/resources_servers/webvoyager_judge/README.md
@@ -2,17 +2,21 @@
This resource server preserves WebVoyager's automated evaluation boundary:
the task instruction, final agent answer, and the final *k* screenshots are
-sent to a vision-capable judge model. A parsed `SUCCESS`/`NOT SUCCESS` verdict
+sent to a vision-capable judge model. A parsed `SUCCESS`/`FAILURE` verdict
becomes binary reward.
-No final answer is a valid policy failure with reward zero. Missing required
-screenshots, judge transport errors, or a response without a definitive verdict
-are verifier failures and must be masked by the caller.
+An empty final answer can still be judged from the screenshots. A parsed task
+failure is a valid reward zero. Missing required screenshots are inconclusive
+and return `mask_sample: true`; judge transport errors are verifier failures.
+Text-only judging is supported when `require_screenshot` is false. A response
+without a definitive verdict follows `unparseable_verdict_policy`: `zero` keeps
+the historical valid-zero behavior, while `mask` marks it inconclusive.
The prompt semantics are adapted from WebVoyager's Apache-2.0
`evaluation/auto_eval.py`; `NOT SUCCESS` is checked before `SUCCESS`, matching
the upstream scorer.
The five records under `data/` exercise Gym's resource-server data contract.
-Their stored rollouts use the deterministic empty-answer path and are fixtures,
-not WebVoyager benchmark scores.
+Their stored rollouts have no screenshots, so all five are masked for missing
+required judge evidence and none are scored. They are fixtures, not WebVoyager
+benchmark scores.
diff --git a/nemo_gym/web/browser_instance_pool.py b/nemo_gym/web/browser_instance_pool.py
--- a/nemo_gym/web/browser_instance_pool.py
+++ b/nemo_gym/web/browser_instance_pool.py
@@ -31,6 +31,10 @@
LOG = logging.getLogger("nemo_gym.web.browser_instance_pool")
+
+
+class _LaunchRollbackError(BrowserSessionError):
+ """A partial instance could not be confirmed stopped after launch failed."""
@dataclass
@@ -81,9 +85,20 @@
self._leased: dict[int, _Slot] = {}
self._lifecycle_lock = asyncio.Lock()
self._startup_cleanup: asyncio.Task[None] | None = None
+ self._recycling: dict[tuple[int, int], asyncio.Task[None]] = {}
+ self._close_task: asyncio.Task[None] | None = None
+ self._closing = False
async def start(self) -> None:
+ closing = self._close_task
+ if closing is not None:
+ await asyncio.shield(closing)
async with self._lifecycle_lock:
+ if closing is not None and self._close_task is closing:
+ self._close_task = None
+ self._closing = False
+ if self._closing:
+ raise BrowserSessionError("local_instance_pool is closing")
if self._startup_cleanup is not None:
await asyncio.shield(self._startup_cleanup)
self._startup_cleanup = None
@@ -123,9 +138,15 @@
raise result
async def acquire(self, spec: BrowserSessionSpec) -> BrowserSessionHandle:
- if self._idle is None:
+ idle = self._idle
+ if idle is None or self._closing:
raise BrowserSessionError("local_instance_pool has not been started")
- slot = await self._idle.get()
+ try:
+ slot = await idle.get()
+ except asyncio.QueueShutDown as exc:
+ raise BrowserSessionError("local_instance_pool is closing") from exc
+ if self._closing or self._idle is not idle:
+ raise BrowserSessionError("local_instance_pool is closing")
slot.leases += 1
self._leased[slot.index] = slot
LOG.info(
@@ -142,6 +163,7 @@
endpoint=f"http://{self._host}:{slot.port}",
metadata={
"slot": slot.index,
+ "lease_generation": slot.leases,
"display": slot.display,
"token": slot.token,
"request_timeout_seconds": self._request_timeout,
@@ -150,43 +172,89 @@
)
async def release(self, handle: BrowserSessionHandle) -> None:
- slot = self._leased.pop(int(handle.metadata["slot"]), None)
- if slot is None:
+ slot = self._leased.get(int(handle.metadata["slot"]))
+ if slot is None or handle.metadata.get("lease_generation") != slot.leases:
return
- healthy = await asyncio.to_thread(self._idle_and_healthy, slot)
- if not healthy:
- LOG.warning("event=browser_instance_restart slot=%d display=%s", slot.index, slot.display)
- await asyncio.to_thread(self._stop, slot)
- slot.restarts += 1
- try:
- await asyncio.to_thread(self._launch, slot)
- except Exception:
- # Keep the slot out of rotation rather than lending a broken
- # display; capacity shrinks and the failure stays visible.
- LOG.exception("event=browser_instance_restart_failed slot=%d", slot.index)
+ key = slot.index, slot.leases
+ recycling = self._recycling.get(key)
+ if recycling is None:
+ if self._closing:
+ assert self._close_task is not None
+ await asyncio.shield(self._close_task)
return
- assert self._idle is not None
- self._idle.put_nowait(slot)
+ assert self._idle is not None
+ # RPC cancellation must not discard a thread that is still checking,
+ # stopping or replacing the instance. Retries join this same owner.
+ recycling = asyncio.create_task(self._recycle(slot, key, self._idle))
+ self._recycling[key] = recycling
+ await asyncio.shield(recycling)
+
+ async def _recycle(self, slot: _Slot, key: tuple[int, int], idle: asyncio.Queue[_Slot]) -> None:
+ try:
+ healthy = await asyncio.to_thread(self._idle_and_healthy, slot)
+ if not healthy:
+ LOG.warning("event=browser_instance_restart slot=%d display=%s", slot.index, slot.display)
+ await asyncio.to_thread(self._stop, slot)
+ slot.restarts += 1
+ try:
+ await asyncio.to_thread(self._launch, slot)
+ except _LaunchRollbackError:
+ raise
+ except Exception:
+ # _launch has rolled back. Retire this slot, rather than
+ # lending a failed replacement or starting it twice.
+ LOG.exception("event=browser_instance_restart_failed slot=%d", slot.index)
+ self._leased.pop(slot.index)
+ self._recycling.pop(key)
+ return
+ except Exception:
+ # Retain the failed task and its lease until close can stop the
+ # instance. A duplicate release must not report uncertain cleanup
+ # as success merely because the first waiter stopped awaiting it.
+ LOG.exception("event=browser_instance_recycling_failed slot=%d", slot.index)
+ raise
+ self._leased.pop(slot.index)
+ self._recycling.pop(key)
+ if not self._closing and self._idle is idle:
+ idle.put_nowait(slot)
async def close(self) -> None:
+ if self._close_task is not None and self._close_task.done() and self._close_task.exception() is not None:
+ self._close_task = None
+ if self._close_task is None:
+ self._closing = True
+ if self._idle is not None:
+ self._idle.shutdown(immediate=True)
+ self._close_task = asyncio.create_task(self._close())
+ await asyncio.shield(self._close_task)
+
+ async def _close(self) -> None:
async with self._lifecycle_lock:
+ if self._idle is not None:
+ self._idle.shutdown(immediate=True)
if self._startup_cleanup is not None:
await asyncio.shield(self._startup_cleanup)
self._startup_cleanup = None
+ if self._recycling:
+ await asyncio.gather(*tuple(self._recycling.values()), return_exceptions=True)
results = await asyncio.gather(
*(asyncio.to_thread(self._stop, slot) for slot in self._slots), return_exceptions=True
)
- self._idle = None
- self._leased.clear()
for result in results:
if isinstance(result, BaseException):
raise result
+ self._idle = None
+ self._leased.clear()
+ self._recycling.clear()
def _launch(self, slot: _Slot) -> None:
try:
self._launch_slot(slot)
except BaseException:
- self._stop(slot)
+ try:
+ self._stop(slot)
+ except Exception as exc:
+ raise _LaunchRollbackError(f"browser instance rollback failed for slot {slot.index}") from exc
raise
def _launch_slot(self, slot: _Slot) -> None:
diff --git a/tests/unit_tests/web/test_browser_instance_pool.py b/tests/unit_tests/web/test_browser_instance_pool.py
new file mode 100644
--- /dev/null
+++ b/tests/unit_tests/web/test_browser_instance_pool.py
@@ -0,0 +1,258 @@
+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+import asyncio
+import threading
+from dataclasses import dataclass, field
+
+import pytest
+
+from nemo_gym.web.browser_instance_pool import LocalBrowserInstancePoolProvider
+from nemo_gym.web.browser_session import BrowserSessionError, BrowserSessionSpec
+from tests.unit_tests.web.test_session_manager import _manager
+
+
+@dataclass
+class _Processes:
+ """Control only blocking instance-process boundaries; the pool stays real."""
+
+ launches: int = 0
+ stops: int = 0
+ healthy: bool = True
+ live: bool = False
+ blocked: str | None = None
+ failure: str | None = None
+ entered: threading.Event = field(default_factory=threading.Event)
+ proceed: threading.Event = field(default_factory=threading.Event)
+ finished: threading.Event = field(default_factory=threading.Event)
+
+ def boundary(self, name: str) -> None:
+ if self.blocked == name:
+ self.entered.set()
+ try:
+ if not self.proceed.wait(3):
+ raise TimeoutError(f"test did not unblock {name}")
+ finally:
+ self.blocked = None
+ self.finished.set()
+ if self.failure == name:
+ raise RuntimeError(f"{name} failed")
+
+ def launch(self, slot) -> None:
+ self.launches += 1
+ self.boundary("launch")
+ self.live = self.healthy = True
+
+ def stop(self, slot) -> None:
+ self.stops += 1
+ self.boundary("stop")
+ self.live = False
+
+ def health(self, slot) -> bool:
+ self.boundary("health")
+ return self.healthy
+
+
+@pytest.fixture
+async def pool(monkeypatch, tmp_path):
+ processes = _Processes()
+ provider = LocalBrowserInstancePoolProvider(size=1, port_base=42000, log_dir=str(tmp_path / "pool"))
+ monkeypatch.setattr("shutil.which", lambda tool: f"/usr/bin/{tool}")
+ monkeypatch.setattr(provider, "_launch", processes.launch)
+ monkeypatch.setattr(provider, "_stop", processes.stop)
+ monkeypatch.setattr(provider, "_idle_and_healthy", processes.health)
+ await provider.start()
+ try:
+ yield provider, processes
+ finally:
+ processes.proceed.set()
+ processes.failure = None
+ if processes.entered.is_set():
+ assert await asyncio.to_thread(processes.finished.wait, 3)
+ await asyncio.wait_for(provider.close(), 3)
+
+
+async def _turn() -> None:
+ # Give an already-ready release/acquire coroutine its first event-loop turn.
+ await asyncio.sleep(0)
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize("stage", ["health", "stop", "launch"])
+@pytest.mark.parametrize("cancellation", ["direct", "manager_deadline"])
+async def test_recycling_survives_waiter_cancellation(pool, tmp_path, stage, cancellation):
+ provider, processes = pool
+ handle = await provider.acquire(BrowserSessionSpec())
+ processes.healthy = False
+ processes.blocked = stage
+ manager, _ = _manager(
+ tmp_path / "manager", browser_session_provider=provider, browser_release_timeout_seconds=0.02
+ )
+ first = asyncio.create_task(
+ provider.release(handle) if cancellation == "direct" else manager._release_browser_lease(handle)
+ )
+ retries = []
+ try:
+ assert await asyncio.to_thread(processes.entered.wait, 2)
+ if cancellation == "direct":
+ first.cancel()
+ with pytest.raises(asyncio.CancelledError):
+ await first
+ else:
+ assert await first is False
+ assert manager._browser_leases_released == 0
+ # The first manager deadline must not make a cleanup retry report success
+ # while the real instance operation is still blocked.
+ manager.config.browser_release_timeout_seconds = 2
+ for _ in range(2):
+ retries.append(asyncio.create_task(manager._release_browser_lease(handle)))
+ done, _ = await asyncio.wait(retries, timeout=0.02)
+ assert not done
+ processes.proceed.set()
+ assert await asyncio.wait_for(asyncio.gather(*retries), 2) == [True, True]
+ assert processes.launches == 2 and processes.stops == 1
+ replacement = await asyncio.wait_for(provider.acquire(BrowserSessionSpec()), 1)
+ waiting = asyncio.create_task(provider.acquire(BrowserSessionSpec()))
+ try:
+ await _turn()
+ assert not waiting.done()
+ await provider.release(replacement)
+ await asyncio.wait_for(waiting, 1)
+ finally:
+ waiting.cancel()
+ await asyncio.gather(waiting, return_exceptions=True)
+ finally:
+ processes.proceed.set()
+ await asyncio.gather(first, *retries, return_exceptions=True)
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize("busy", [False, True])
+async def test_old_lease_cannot_release_a_reused_slot(pool, busy):
+ provider, processes = pool
+ old = await provider.acquire(BrowserSessionSpec())
+ await provider.release(old)
+ current = await provider.acquire(BrowserSessionSpec())
+ processes.healthy = not busy
+ counts = processes.launches, processes.stops
+ await provider.release(old)
+ assert (processes.launches, processes.stops) == counts
+ waiting = asyncio.create_task(provider.acquire(BrowserSessionSpec()))
+ try:
+ await _turn()
+ assert not waiting.done()
+ assert old.metadata["lease_generation"] != current.metadata["lease_generation"]
+ await provider.release(current)
+ next_handle = await asyncio.wait_for(waiting, 1)
+ assert next_handle.metadata["lease_generation"] > current.metadata["lease_generation"]
+ finally:
+ waiting.cancel()
+ await asyncio.gather(waiting, return_exceptions=True)
+
+
+@pytest.mark.asyncio
+async def test_close_waits_for_recycling_even_if_close_waiter_is_cancelled(pool):
+ provider, processes = pool
+ handle = await provider.acquire(BrowserSessionSpec())
+ processes.healthy = False
+ processes.blocked = "launch"
+ releasing = asyncio.create_task(provider.release(handle))
+ closing = None
+ try:
+ assert await asyncio.to_thread(processes.entered.wait, 2)
+ closing = asyncio.create_task(provider.close())
+ await _turn()
+ assert not closing.done()
+ assert processes.stops == 1 # only the recycling stop, not shutdown yet
+ closing.cancel()
+ with pytest.raises(asyncio.CancelledError):
+ await closing
+ processes.proceed.set()
+ await asyncio.wait_for(releasing, 2)
+ await asyncio.wait_for(provider.close(), 2)
+ assert processes.launches == 2 and processes.stops == 2
+ assert not processes.live
+ with pytest.raises(BrowserSessionError):
+ await provider.acquire(BrowserSessionSpec())
+ finally:
+ processes.proceed.set()
+ await asyncio.gather(releasing, *(tuple() if closing is None else (closing,)), return_exceptions=True)
+
+
+@pytest.mark.asyncio
+async def test_failed_replacement_is_retired_and_duplicate_release_does_not_retry(pool):
+ provider, processes = pool
+ handle = await provider.acquire(BrowserSessionSpec())
+ processes.healthy = False
+ processes.failure = "launch"
+ await provider.release(handle)
+ await provider.release(handle)
+ assert processes.launches == 2 and processes.stops == 1
+ assert not processes.live
+ with pytest.raises(TimeoutError):
+ await asyncio.wait_for(provider.acquire(BrowserSessionSpec()), 0.02)
+
+
+@pytest.mark.asyncio
+async def test_failed_launch_rollback_retains_uncertain_cleanup(pool, monkeypatch):
+ provider, processes = pool
+ handle = await provider.acquire(BrowserSessionSpec())
+ processes.healthy = False
+
+ def partial_launch(slot):
+ processes.launches += 1
+ processes.live = True
+ processes.failure = "stop"
+ raise RuntimeError("replacement launch failed")
+
+ # Keep the real launch wrapper: its rollback also fails, leaving an owned
+ # partial process. This differs from a safely rolled-back failed launch.
+ monkeypatch.setattr(provider, "_launch", LocalBrowserInstancePoolProvider._launch.__get__(provider))
+ monkeypatch.setattr(provider, "_launch_slot", partial_launch)
+ for _ in range(2):
+ with pytest.raises(BrowserSessionError, match="rollback"):
+ await provider.release(handle)
+ assert processes.live
+ assert processes.launches == 2 and processes.stops == 2
+ with pytest.raises(TimeoutError):
+ await asyncio.wait_for(provider.acquire(BrowserSessionSpec()), 0.02)
+ processes.failure = None
+ await provider.close()
+ assert not processes.live
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize("stage", ["health", "stop"])
+async def test_unfinished_cleanup_failure_cannot_become_a_successful_duplicate(pool, stage):
+ provider, processes = pool
+ handle = await provider.acquire(BrowserSessionSpec())
+ processes.healthy = False
+ processes.failure = stage
+ for _ in range(2):
+ with pytest.raises(RuntimeError, match=f"{stage} failed"):
+ await provider.release(handle)
+ with pytest.raises(TimeoutError):
+ await asyncio.wait_for(provider.acquire(BrowserSessionSpec()), 0.02)
+
+
+@pytest.mark.asyncio
+async def test_close_wakes_an_acquisition_waiting_for_a_recycling_slot(pool):
+ provider, processes = pool
+ handle = await provider.acquire(BrowserSessionSpec())
+ processes.healthy = False
+ processes.blocked = "launch"
+ releasing = asyncio.create_task(provider.release(handle))
+ acquiring = asyncio.create_task(provider.acquire(BrowserSessionSpec()))
+ closing = None
+ try:
+ assert await asyncio.to_thread(processes.entered.wait, 2)
+ closing = asyncio.create_task(provider.close())
+ with pytest.raises(BrowserSessionError):
+ await asyncio.wait_for(acquiring, 1)
+ processes.proceed.set()
+ await asyncio.wait_for(asyncio.gather(releasing, closing), 2)
+ finally:
+ processes.proceed.set()
+ await asyncio.gather(
+ releasing, acquiring, *(tuple() if closing is None else (closing,)), return_exceptions=True
+ ) |
Integrate the prepared seven-finding repair from NVIDIA-NeMo#2295 (comment). Mask missing required judge screenshots, align dataset evidence limits, retain recycling across cancelled release/close waiters, isolate lease generations, parse Qwen actions from final output, and keep deterministic argument failures on the policy parse path. Validation: 200 focused tests and 1,523 broader browser, agent, judge, schema and public API regression tests pass; pre-commit --all-files passes. Targeted real-process cancellation/recycling validation remains in progress. Co-authored-by: Martyna Patelka <[email protected]> Signed-off-by: Jeff Peng <[email protected]>
|
/ok to test 726f208 |
Wait for the real health endpoint before yielding the threaded HTTP fixture. This prevents the reset request from racing socket binding under parallel CI load. A delayed-server probe reproduces the original failure and passes with the readiness wait; all 26 browser-instance and pool tests pass. Signed-off-by: Jeff Peng <[email protected]>
|
/ok to test 1e100cd |
|
/ok to test f99e46c |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43234412665 |
e8fe0a9
Merge main e8fe0a9 after the squash merge of WebVoyager PR NVIDIA-NeMo#2295. Retain the existing WebArena head as a parent so the dependent VisualWebArena PR NVIDIA-NeMo#2918 keeps its current review diff and both the user fork and upstream PR branch can advance without rewriting history. Preserve main's browser/parser hardening and canonical data imports. Retain every main secret-baseline entry and add only the two WebArena source-lock hashes. The benchmark and reference evaluator files are byte-identical to the previously reviewed WebArena source. Construct the two fixed-URL server-test fixtures through the existing public build_collision_plan API, addressing review comment 4546453096. Validation: 264 component tests including 22 real Chromium cases and example-data validation; 525 shared Web, agent, judge, benchmark and import contract tests; 289 managed dependency locks; all-files pre-commit; Fern check (zero errors, one inherited warning); git diff whitespace checks. The earlier 475/812 remains scoped to frozen source 363bd7c9. This merge does not qualify a new full-population benchmark score. Signed-off-by: Jeff Peng <[email protected]>
) * feat(webvoyager): add benchmark and shared web runtime Add the WebVoyager benchmark, BrowserGym and native browser resource servers, external judge, shared web rollout agent and protocol, and the Nano Omni alignment profile. Preserve current upstream behavior while adding opt-in proxy support and safe validation diagnostics. Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): avoid duplicate terminal evidence Do not append the unchanged observation returned by an explicit native terminate action. Continue retaining valid observations from non-terminal actions that end the environment, while preserving the browser-target-closed safeguard. Add regression coverage for all three paths and structured runtime evidence logging. Signed-off-by: Jeff Peng <[email protected]> * fix(web): align task-data schemas with current main Declare the normalized web-task row contract for BrowserGym, native WebVoyager, and the external judge so main's schema drift gate validates committed datasets. Move the ArXiv smoke dataset onto its judge resource server with an explicit agent pin, matching main's decoupled benchmark layout. Keep BrowserGym exports lazy so schema discovery remains dependency-light, and cover each committed web example dataset. Signed-off-by: Jeff Peng <[email protected]> * test(web): cover native browser runtime Exercise native browser lifecycle, navigation, evidence capture, terminal handling, and computer actions. This restores the repository-wide CI coverage gate after adding the shared native browser driver. Signed-off-by: Jeff Peng <[email protected]> * docs(webvoyager): add native end-to-end runbook Signed-off-by: Jeff Peng <[email protected]> * docs(webvoyager): allowlist provenance hashes Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): make benchmark preparation self-contained Download the pinned official 643-task source into Gym local ignored data storage, verify its checksum and denominator, and retain explicit source overrides. Add a Fern end-to-end tutorial for both WebVoyager profiles and cover download caching, population validation, and the new navigation entry. Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): fetch native benchmark data Download the pinned 552-task native WebVoyager source directly during preparation, while retaining verified offline-source overrides. Keep the source lock, E2E docs, and regression tests aligned with the executable path. Signed-off-by: Jeff Peng <[email protected]> * chore(webvoyager): keep source lock scan stable Place the informational raw URL after the existing SHA field so the pinned secret-scanner false-positive remains on its baseline line. The exact CI detector then passes without a repository-wide baseline rewrite. Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): make component tests self-contained Install pytest and pytest-asyncio in the native WebVoyager browser component so gym env test executes with the component CPython 3.13 environment instead of falling back to an unrelated global pytest interpreter. Signed-off-by: Jeff Peng <[email protected]> * refactor(webvoyager): unify the visual browser runtime Remove the duplicate BrowserGym path and consolidate WebVoyager on a model-neutral visual_browser resource with shared computer-use actions. Add bounded browser-session provider lifecycle and per-session operation isolation so local Chromium remains serialized per display while remote or AgentEnv-backed providers can be integrated without blocking the async service. Add separate Nano Omni and Qwen 3.5 policy profiles on the shared runtime, consolidate benchmark preparation and judge configuration, and update the Fern runbook and regression coverage. Validation: 250 focused WebVoyager tests passed; pre-commit passed; full 552-task Qwen and Nano Omni rollouts used the matching frozen source snapshot. Signed-off-by: Jeff Peng <[email protected]> * docs(webvoyager): record unified runtime validation Signed-off-by: Jeff Peng <[email protected]> * Make WebVoyager parsing parser-faithful Treat the configured model-server reasoning and tool parsers as the authoritative output boundary. Remove Gym-side JSON, delimiter, and tool-alias repair, and reject out-of-contract scroll values instead of silently clamping them. Update the Nano Omni profile, documentation, and regression tests accordingly. Signed-off-by: Jeff Peng <[email protected]> * Document parser-faithful WebVoyager validation Signed-off-by: Jeff Peng <[email protected]> * Consolidate WebVoyager documentation Signed-off-by: Jeff Peng <[email protected]> * Simplify WebVoyager benchmark configuration and tooling Consolidate dataset and policy provenance into one manifest consumed by prepare.py, and fold the Nano Omni transport override into its main profile without changing sampling or browser behavior. Remove benchmark-local summary and CapSolver account-smoke scripts. Document the generated env.yaml and standard Gym aggregation and health-check workflow in README and Fern. Relocate the existing eight provenance hash findings in the secrets baseline to their new file and line numbers. Preserve the scanner configuration and all unrelated entries; no additional value is allowlisted. Validation: 276 benchmark and CLI tests passed; standard prepare produced 552 tasks; Fern reported zero errors; all-file pre-commit and the targeted secrets hook passed. Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): address documentation and inline allowlist review Keep the complete WebVoyager setup, smoke, full-population execution and reconciliation guide in the benchmark README. Remove the duplicate Fern page and retain a link from the evaluation index. Clarify that both policy profiles connect to separately managed model endpoints; Gym does not allocate GPUs or launch their vLLM servers. Convert the provenance manifest from JSON to YAML so the eight non-secret Git revisions and SHA-256 checksums can carry inline allowlist comments. Update the loader, tests and documentation, and restore the global secrets baseline byte-for-byte to the PR base without touching upstream findings. All provenance values and types, the 552 prepared task rows and both generated policy configurations remain identical to the previous revision. Browser, agent, model and judge runtime behavior is unchanged. Validation: - 99 benchmark, CLI and Fern-link tests passed, plus 20 subtests. - Repository-wide pre-commit and PR-scoped detect-secrets checks passed. - Removing each inline annotation re-exposes exactly its former finding. - Fern check reported zero errors; authenticated redirect check was skipped. Addresses PR NVIDIA-NeMo#2295 discussions r3985809661 and r3985810226. Signed-off-by: Jeff Peng <[email protected]> * fix(web): evaluate terminal policy errors without repairing model output Treat context exhaustion as a truncated rollout and evaluate retained state, including first-turn rejection. Recognize newer vLLM decoder-prompt errors. Preserve parser output and remove duplicate action echo from Nano observations. Expose matched agent/resource call limits and opt-in stop-and-evaluate semantics for invalid structured calls. Execute only the complete validated prefix before the first invalid call; never repair arguments or execute later calls. Existing retry and call-count defaults remain unchanged. Validation: 295 focused tests passed; pre-commit --all-files passed. Full r2 WebArena evidence is 397/812 with no invalid samples, but the complete successor changes are not yet full-benchmark qualified. Signed-off-by: Jeff Peng <[email protected]> * fix(web): retain browser session ownership through cancellation and cleanup Address the operational failure modes discussed in issue NVIDIA-NeMo#2921 without copying its implementation. Allocate caller identity before seed, retain seed and close tasks independently of HTTP waiters, and authorize cookie-less cleanup with a redacted close capability. Bound tombstone retention and automatic retries without expiring active rollouts. Retain failed provider, backend, executor and site cleanup handles until release succeeds. Keep occupied admission capacity and report session_lost or session_release_failed separately from valid task rewards. Check the exact Playwright-matched headed Chromium executable at startup, with serialized bounded auto-install and an offline fail-fast option. Preserve task data, prompt, action parsing, screenshot history, judge evidence and reward formulas. Add fault-injection tests and Fern lifecycle documentation. Validation: 710 targeted tests passed, pre-commit run --all-files passed, git diff --check passed. Real browser/model and trainer regression remain pending; in-memory ownership does not claim crash-proof remote lease recovery. Signed-off-by: Jeff Peng <[email protected]> * chore(web): declare Ray usage for the web servers Main starts Ray only for servers that declare ray_enabled = True, and test_shipped_server_classes_declare_ray_usage requires each shipped server class to declare it on the class itself. The visual browser, the WebVoyager judge and the web agent do not use Ray. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * chore(web_agent): declare its legacy-agent environment server Main deprecates agents without an environment server, and test_repository_configs_declare_every_environment_server fails for web_agent.yaml. Add the legacy_agent relay block that scripts/add_legacy_agent_environment_servers.py writes. Both WebVoyager profiles resolve with the relay fronting their renamed benchmark agent and without the deprecation warning. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(web_agent): declare Pillow for the Qwen computer-use adapter The Qwen adapter decodes and resizes screenshots with Pillow, but the agent declared only nemo-gym[dev]. Pillow used to arrive through mlflow's matplotlib dependency; main now ships mlflow and wandb as optional extras (NVIDIA-NeMo#3547), so a fresh web_agent venv could not import PIL and its tests failed at collection. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * test(visual_browser): run the resources server tests in its own venv The visual browser resources server shipped no tests of its own, so `gym env test` exited with pytest's "no tests collected" code, which the server suites report as missing tests. Move the two test modules that cover this server from tests/unit_tests into resources_servers/visual_browser/tests, next to the code and dependencies they exercise. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(web): namespace web-only failure kinds as web:<kind> Main's failure vocabulary warns once per unregistered failure_kind and counts it under "unregistered" in rollout telemetry. Keep the registered names the web components already use (session_lost, session_release_failed, verifier_error, transport_timeout, judge_failed, judge_unparseable) and emit every web-only kind in main's namespaced form: web:model_quota_exhausted, web:model_context_overflow, web:captcha_budget_exhausted, web:missing_verifier_result, web:missing_judge_evidence and web:external_judge_required. Resources-server HTTP error bodies keep their error_kind values; the web agent namespaces them where they become a failure_kind, so new error kinds are covered too. Runtime statuses and truncation reasons are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(web): record browser video when record_video is enabled record_video was accepted in the visual browser configuration but never passed to Playwright, so the recording artifacts that /close reports, and the web agent copies into its result, were always empty. When enabled, record the context at viewport size into the session's video directory. Playwright finishes the file when the context closes, before /close lists recordings. The default stays off. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(web_agent): retry rollouts that ended on an unreachable site When the browser exhausted its CAPTCHA failure budget, or a run ended without a verdict, the agent returned a masked result row. The collector persists every result row as finished, so resume never ran the task again and it left the denominator silently, contrary to the README's "routed to retry". Mark both cases with _ng_failure_class=retryable_infrastructure, as judge failures already are. The collector writes them to the failures sidecar, and resume runs them again with a fresh session within its attempt limit. They are not marked terminal. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(web): run a failed seed again once its cleanup finishes WebSessionControl kept the finished seed task per session identity and replaced it only after a CapacityUnavailableError. The web agent reuses one identity for every seed retry, so any other seed failure was replayed from the cache until the agent's retry budget ran out. In a full WebVoyager run, a single navigation error (net::ERR_SOCKET_NOT_CONNECTED) on the first seed cost the whole 1800 s budget, and the row could only be recovered by a second wave. Replay only a successful seed. A failed or cancelled seed runs again once the manager reports its cleanup finished (can_retry_seed); until then a retry receives the same failure, so a retry can never start a second browser while the failed one still holds its lease. The agent retries only 5xx responses, so deterministic 4xx failures are not seeded again. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * feat(webvoyager): render dated questions for a reference date 79 Booking and Google Flights questions name absolute check-in, departure or return dates. The pinned source renders them from its template/webvoyager.template.jsonl for 2026-07-26, so they expire: a run on 2026-10-10 found 38 dates in the past, and all 38 tasks failed, 30 at the 100-step limit, because the live sites cannot search a past date. prepare.py now downloads the hash-pinned template from the same source commit, checks that it reproduces every source question for 2026-07-26, and renders the questions again for reference_date in provenance.yaml (2026-10-11, 11 weeks later; the closest date is 2026-11-10). Only the dates change; original_metadata keeps the source question. The reference date must be whole weeks after the source's, so weekdays, including the two "weekend" questions, are unchanged, and preparation fails when a rendered date is not after today. --reference-date renders for a later run. The renderer matches the source's render_webvoyager.py for every template entry and every reference date from 2026-01-01 through 2029-12-30. For 2026-07-26 the prepared file is byte-identical to the previous population (SHA-256 bf61d491...); for 2026-10-11 only those 79 intents differ (SHA-256 951bfe5c...). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * feat(visual_browser): lease one browser instance process per session A headed PyAutoGUI driver acts on its process's X display, so a visual_browser resources server could hold one session. Add a browser instance: a single-threaded HTTP server with its own display that hosts the unchanged web backend (WebVoyager driver plus evaluator) for one session at a time. RemoteWebBackend forwards reset/observe/step/evaluate/ close to a leased instance, and the local_instance_pool provider keeps N instances (Xvfb + server each), reuses healthy idle ones and restarts the rest. max_sessions may exceed 1 when the provider is not local_process. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(visual_browser): a failed instance close does not hold a session slot Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(visual_browser): give each browser instance its own Xauthority file python-xlib, which PyAutoGUI uses, fails without one even though Xvfb runs with -ac; the per-worker launcher always created an empty file. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * build(visual_browser): add a runtime image for browser instances Base is Playwright's own v1.55.0-noble image, whose Chromium-1187 matches the cache of the WebVoyager 552 reference runs file for file. Adds the reference image's X tools and fonts, Python 3.13.14 and the visual_browser component with dependencies pinned to the reference venv. The build script sends only committed files as the context and can convert the image to an enroot squashfs for Pyxis. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(visual_browser): image context has no resources_servers/__init__.py resources_servers is a namespace package. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(visual_browser): include cache/ in the image context The root pyproject puts egg-info under cache/ (egg_base), so the editable install needs that directory. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(visual_browser): check the image's imports under Xvfb pyautogui opens the X display at import time. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(visual_browser): keep INFO logs of the driver inside a browser instance Importing nemo_gym configures the root logger first, so the instance's basicConfig was a no-op and every INFO record (step, CAPTCHA, close) of the driver running in the instance was dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * feat(web): optional per-site session limit (site_pool_mode: site_limits) Public sites rate-limit by client IP. With one shared rollout queue, the instance-pool runtime ran up to 8 concurrent GitHub and Hugging Face sessions from one egress IP (the per-worker layout ran 4-7) and drew about twice the rate-limit pages. site_limits caps concurrent sessions per task site (max_sessions_per_site, default 4); a seed for a full site is rejected as capacity-unavailable so the agent backs off and retries, and other sites are not blocked. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * build(webvoyager): lock component venv package versions The component servers run from venvs that Gym resolves when it first builds them, outside `uv sync --frozen`. Between the 2026-10-11 reference runtime and the 2026-10-17 instance-host runtime they drifted by 20+ minor releases per component (pillow 12.3.0 -> 13.0.0, aiohttp, fastapi, pydantic, ...). Full WebVoyager runs on the drifted venvs had 12-17 rollouts with unparseable model actions against 1-8 on the reference venvs; with the venvs pinned back to the reference versions the instance-host run had 4 (32 sessions per arm, 423/552 vs control 421/552). - benchmarks/webvoyager/component-constraints.txt: the versions of the six reference component venvs (151 packages), for UV_CONSTRAINT at venv build time. grpcio is pinned to 1.84.0 for all components (two reference venvs had 1.85.0rc1). - visual_browser image lock: same versions as the constraints. The image built from e0b894a still carries the drifted versions in its own interpreter; runs use the component venvs, not that interpreter. - README: how to apply the constraints; test: the constraints are exact pins and the image lock agrees with them. Checked: `uv pip compile` of all six components with the constraints (python 3.13.14, x86_64 manylinux) resolves to exactly the reference venvs except pip (seeded) and the planned grpcio pin. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): pin huggingface-hub to main's version in the component lock After the merge of main at b3103ea, nemo-gym requires huggingface-hub<2, so the lock's huggingface-hub==2.2.0 (from the 2026-10-11 reference venvs) made every component that installs nemo-gym[dev] unresolvable. The release verification build on cw-dfw failed on it for openai_model. Pin 1.33.0, the root uv.lock version, in the component constraints and the visual-browser image lock. All six WebVoyager components resolve again with the lock (Python 3.13.14, x86_64 manylinux); every other package that still resolves keeps its reference version (pillow 12.3.0, ...). Packages that the merged tree no longer installs in these components (ray and its dependencies, now an extra) keep their pins, which have no effect. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): track active tabs and honor runtime wait budgets Follow live focused tabs after GUI actions without stealing focus, and distinguish closed tabs from lost browsers during capture and CAPTCHA handling. Advertise and enforce configurable per-action and per-step wait limits so sites asking for a 60-second retry can be handled without rewriting model actions. Preserve specific termination reasons, expose process-local site-limit scope, and add sanitized serving completion diagnostics. Add opt-in malformed-judge retries under one deadline and masking after exhaustion while retaining legacy defaults. No JSON repair, EOS override, model checkpoint, or historical benchmark record is changed. Validation: 692 focused web, resource, agent, judge and vLLM tests passed; changed-file hooks and repository-wide pre-commit passed. Live 552-task model/browser qualification is pending in a separate experiment, not implied by unit tests. Signed-off-by: Jeff Peng <[email protected]> * docs(webvoyager): record completed 552-task runtime validation Record 418/552 = 75.72% on frozen runtime commit 60fa5e3 and the reference-date-2026-10-11 task population. Distinguish the tuned checkpoint from public v3, preserve first-valid zero-reward outcomes, and disclose the append-only recovery and observed successor handoff. No runtime behavior or deployment assets change. Validation: 37 WebVoyager benchmark tests and repository-wide pre-commit passed. The full 552-task rollout was evaluated at 60fa5e3; this commit only records that evidence. Signed-off-by: Jeff Peng <[email protected]> * refactor(web): align runtime with current Gym packages Signed-off-by: Jeff Peng <[email protected]> * build(webvoyager): align browser build contracts with current main Signed-off-by: Jeff Peng <[email protected]> * build(webvoyager): follow managed component lock conventions Signed-off-by: Jeff Peng <[email protected]> * build(webvoyager): use managed component lock in browser image Signed-off-by: Jeff Peng <[email protected]> * fix(web): preserve terminal evidence and fence cancelled mutations Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): classify the complete judge deadline Signed-off-by: Jeff Peng <[email protected]> * fix(webvoyager): persist consistent grades after rejudgment Signed-off-by: Jeff Peng <[email protected]> * fix(web): align component locks with main OpenAI SDK Signed-off-by: Jeff Peng <[email protected]> * feat(web): add WebArena visual browser benchmark Signed-off-by: Jeff Peng <[email protected]> * Align WebArena profile with parser-faithful agent Remove the retired nano_omni_action_recovery and nano_omni_tool_alias_recovery options. The current shared agent ignores these fields and no longer repairs JSON or tool aliases; keeping them would misleadingly advertise behavior that is not executed. Add an offline composed-profile regression test covering parser settings, resource routing, dataset path, and the preserved history-thinking transport option. Leave task data, evaluation, sampling, and parse-retry settings unchanged. Validation: 291 focused Web unit, agent, benchmark, and evaluator tests passed; pre-commit run --all-files, uv lock --check --offline, scoped detect-secrets, and base-relative git diff --check passed. No new full WebArena rollout or success-rate result is claimed. Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): align terminal policy and verify shopping authentication False-positive shopping login admission exposed guest pages to the policy. Require the protected account URL and visible My Account heading, using existing bounded setup retries and closing failed pages. Remove the implicit 16384 output cap, match agent/resource uncapped call-list admission, and stop then evaluate execution or invalid-call failures without correction feedback or temperature overrides. Preserve bounded missing-tool retries and original model output. Validation: 15 focused benchmark/auth tests and pre-commit --all-files passed. These successor profile and auth changes still require a fresh full benchmark; do not attribute the preceding r2 397/812 score to the complete changes. Signed-off-by: Jeff Peng <[email protected]> * fix(web): make scroll limits configurable with bounded execution The fixed 50-tick validator rejected parser-produced reference actions before execution. Add matching optional limits to the tool schema, agent and resource validators, retaining the existing default of 50. Explicitly relaxed profiles execute the original integer without JSON repair, clamping or automatic retries. Execute relaxed scrolls in a direct child process with a configurable deadline. Timeout kills and reaps that child before capturing/evaluating the still-live browser, preventing an oversized PyAutoGUI scroll from outliving cancellation. Add regression coverage for strict defaults, schema isolation, exact arguments, child errors/timeouts and retained evaluation state. Validated the exact frozen candidate with 190 focused tests, real remote Chromium/timeout gates, and all 812 WebArena tasks: 484 successes, zero invalid/missing/duplicate/retry tasks. Full pre-commit passes. Full local gym dev test reports 4616 passed, 151 skipped and 6 failures; all six reproduce on unchanged base d016328 in the same environment. Overall coverage is 89.02%, below the configured 95% gate; this is not a claim of a green full suite. The observed task-411 dialog callback issue is not modified here. Signed-off-by: Jeff Peng <[email protected]> * fix(web): tolerate already-closed browser dialogs Task 411 exposed a stale dialog callback: PyAutoGUI can close a dialog before synchronous Playwright dispatches its queued event, causing Dialog.accept to report No dialog is showing. Keep accepting normal dialogs exactly once. Tolerate only the exact observed Playwright protocol error, log the session/task/step/type and already_closed outcome, and propagate unrelated errors. Do not retry actions, refocus editors, change prompt handling or modify scoring. Avoid recording dialog text, prompt values or page URLs. Add 17 regression cases covering all four normal dialog types across benchmark identities, stale-event state preservation, and unrelated errors. Validation: 207 focused tests and all applicable pre-commit hooks pass. An isolated real Chromium regression with Playwright 1.55.0 reproduces the legacy exception and verifies the candidate accepts normal dialogs, handles the stale event, and continues browser input and screenshot capture. No new model rollout or aggregate benchmark score is claimed. Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): keep shared task schemas in the resource namespace The main-sync full Linux suite exposed a semantic stack conflict: upstream now permits dependency-light task schemas to import only stdlib, pydantic, nemo_gym.task_data, or another resource server task_data module. The WebArena stack had moved the shared model into nemo_gym.web.task_data. Restore ownership to visual_browser/task_data.py and have WebArena re-export that single definition. Preserve all schema fields, defaults, extra-field behavior and the complete generated JSON schema; do not relax the repository-wide import rule or alter prompts, tasks, actions or evaluators. Validation: 340 task-data and web-schema tests passed; all-files pre-commit passed; old/new model_json_schema equality verified. Existing example-row and unknown-benchmark tests retained, with seven new identity/preservation cases. Full Linux CI and the 812-task regression will use a new frozen source candidate. Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): check headed Chromium before accepting sessions Wire the shared driver-matched Chromium startup check into the WebArena resources-server manager. Respect browser_auto_install for offline deployments and preserve the existing task validation, evaluator and site-isolation behavior. This wiring is used by VisualWebArena through its stacked parent as well. Validated with the shared lifecycle patch: 404 WebArena/web tests passed and scoped pre-commit passed. The shared implementation is inherited from feature/webarena, not duplicated in this layer. Real-model regression remains pending. Signed-off-by: Jeff Peng <[email protected]> * chore(webarena): declare Ray usage for the WebArena browser server Main starts Ray only for servers that declare ray_enabled = True, and test_shipped_server_classes_declare_ray_usage requires each shipped server class to declare it on the class itself. The WebArena browser server does not use Ray, like the visual browser it extends. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jeff Peng <[email protected]> * refactor(webarena): follow current package and test imports Signed-off-by: Jeff Peng <[email protected]> * build(webarena): adopt managed browser component lock Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): reject invalid evaluator evidence and resolve snapshot keys Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): propagate candidate failures and document source license Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): align component lock with main OpenAI SDK Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): preserve empty DOM snapshots and valid member queries Capture narrowly matched optional DOM read chains as a successful empty baseline when the node is absent. Keep invalid selectors, browser failures and arbitrary script errors inconclusive so they cannot fabricate mutations. Correct the missing JavaScript empty-string literal in sync and async GitLab member-role queries. Add real Chromium regressions for empty-before/populated-after scoring, unchanged empty controls, member roles and invalid selectors. Validation on the current PR base: 79 component tests, 154 shared web tests and 378 SDK compatibility tests passed; all-files pre-commit passed. Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): make planned evaluator evidence authoritative Score planned program-HTML, order and SKU-review captures from their deltas, including conclusive empty and nonmatching deltas. Preserve final-state scoring for targets without an applicable capture and reject unchanged text carried into a changed line as fresh matching evidence. Share optional DOM reads and member-role extraction between snapshots and final evaluation. Propagate unavailable DOM evidence and invalid scripts through the existing candidate-error aggregation, while keeping genuine absence and healthy nonmatches valid scored outcomes. Add public/sync/async regressions and real Chromium controls. Expose WebArena from the Fern tutorial and environment indexes without changing shared config. Validation: 264 component tests including 22 real Chromium cases and example data validation; 154 shared Web tests; all-files pre-commit; Fern check. The historical 475/812 remains attributed to frozen source 363bd7c, not this revised evaluator. No new full-population score is claimed. Review: NVIDIA-NeMo#2917 (comment) Review: NVIDIA-NeMo#2917 (comment) Review: NVIDIA-NeMo#2917 (comment) Signed-off-by: Jeff Peng <[email protected]> * chore(webarena): refresh checks after main retarget Re-evaluate PR NVIDIA-NeMo#2917 checks after its native stack moved from the merged feature/webarena branch to main. The initial DCO run evaluated the old base and listed existing mainline author/sign-off identity mismatches. Direct DCO re-request returned HTTP 404. This commit has no file changes. Source tree remains 4bdd4c7, exactly the tree validated at f8ce72b. No historical signature or check result is modified. Signed-off-by: Jeff Peng <[email protected]> * docs(webarena): retain source provenance through public import record Reference the immutable published import-provenance record at d46f2f6 from all three adapted-source headers and the provenance manifest. Retain the original source revision, original module paths and hashes, all file mappings, copyright notices and the complete original license. The public permalink identifies the provenance record, not a different upstream source revision. All three complete Python module ASTs match the previously tested source; the source-license bytes are unchanged. No scoring or browser behavior changes. Keep the original source URL and license-verification locators traceable through the immutable public record. Validation: pinned FW-CI 7dd05d1e scanner with the unchanged current private catalog reports zero locations across all 57 staged PR paths and the full candidate description; all-files pre-commit and whitespace checks pass. The prior 789 tests and attributed model-trace/15-browser-control evidence remain tied to their executed source, with full-module AST equivalence. Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): validate snapshot navigation before scoring Keep main-resource response status and landed URL in all four browser snapshot collectors. Reject unavailable or unauthenticated captures, including login documents served at the requested URL, and validate baseline resource identity before the agent acts. Preserve healthy empty captures, bounded site canonical redirects, not-found resources before creation, and observable after-action 404s and same-site deletion redirects as scored outcomes. Cover all collectors and phase-aware resource identity checks, plus real HTTP/Chromium before/after scoring regressions for the public and async entrypoints. Retain the existing DOM-disconnect extraction boundary. Addresses NVIDIA-NeMo#2917 (comment) Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): isolate target evidence from fallback documents Do not extract target text or images from error documents or noncanonical landing pages. Retain their navigation and target-document identity, and normalize navigation-aware retained captures before deriving deltas. Distinguish confirmed 404/410 absence from another resource's document. Other-resource captures remain valid outcomes without supplying content or proving an empty target. Allow a confirmed empty/absent target to satisfy an empty deletion criterion only when it improves on the baseline. Preserve the earlier service/auth guards, including recognizable login forms served with a 404 response. Add actual HTTP/Chromium creation, deletion, empty-value, redirect and image-evidence controls, with an independent exact-source negative control. Addresses NVIDIA-NeMo#2917 (comment) Signed-off-by: Jeff Peng <[email protected]> * fix(webarena): bind target absence to resource identity Require both a 404/410 response and the existing requested/canonical URL identity when attributing target absence. An unrelated missing landing cannot prove that the requested target is empty or deleted. Cover unrelated and accepted canonical missing-resource responses in both production sync/public and async HTTP/Chromium scoring paths. Addresses NVIDIA-NeMo#2917 (comment) Signed-off-by: Jeff Peng <[email protected]> --------- Signed-off-by: Jeff Peng <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Follow-up validation at
726f208c5All seven nemo-ci corrections are published. Local validation passed200 focused and1523 broader regression cases, with overlap, and all pre-commit hooks. Exact-source actual CPU allocation1876885 passed9 real Xvfb/instance/Chromium lifecycle cases. Scheduling barriers held cancellation windows; actual health/stop/launch, RPC, browser reset and1920x1080 screenshots ran unchanged. No policy, judge or public-site calls were made. Two native CPU-node inspections found no scoped browser processes, ports or display sockets.
Complete internal evidence is in NVIDIA GitLab project
jepeng/rl, commita3a05ea773ff51a0b603b05a5e7d234cc18147c2, filewebarena/webvoyager/runs/2026-11-12-pr2295-seven-review-fixes/REAL_PROCESS_VALIDATION_20261112.md. It includes all methods, events, process and port rows, source and image identities, and logs. This validates browser lifecycle behavior; no new model rollout, formal score, native CI pass or review approval is claimed.HTTP test-fixture readiness at
1e100cdf5The instance fixture now waits for its real
/healthzendpoint before yielding. A150ms delayed real-server start reproduces the original connection-refused failure and passes with the correction; all26 instance/pool tests and all pre-commit hooks pass. This follow-up changes one test file (+11/-0), with production code unchanged. Native CI at this head passed all four core shards, sandbox and the combined core coverage gate: 95.08% against the95% requirement (native coverage log). The remaining server-shard failure contains21 upstream FLORES-200 tokenizer certificate-expiration errors, previously reproduced on main; TLS verification remains enabled. Native review approval is still required. Complete internal evidence: NVIDIA GitLab projectjepeng/rl, commitf477dc01e46712513b5de99ab3fe27d8591c298d, filewebarena/webvoyager/runs/2026-11-12-pr2295-seven-review-fixes/INSTANCE_TEST_READINESS_20261112.md.Summary
This PR adds first-class WebVoyager support to NeMo Gym together with the shared web protocol used by the benchmark. It contains only the WebVoyager layer after splitting the former combined WebVoyager, WebArena, and VisualWebArena change into focused stacked follow-ups.
WebVoyager evaluates multimodal browser agents on live public websites and scores the final answer together with browser screenshots. NeMo Gym now exposes one model-neutral browser runtime,
visual_browser, over the maintained 552-task population. Headed Chromium runs under Xvfb; Playwright owns browser lifecycle and navigation; PyAutoGUI performs visible coordinate input. Nano Omni and Qwen3.5 retain separate policy-output adapters but use the same tasks, browser behavior, proxy/CAPTCHA path, action executor, and Gemini judge.The earlier BrowserGym-compatible 643-task route has been removed. The original Selenium runner is not copied into Gym. Large runtime images, model checkpoints, credentials, proxy endpoints, recordings, screenshots, and raw experiment artifacts remain outside this repository.
Scope split and follow-ups
The current dependency chain is:
The follow-up PRs remain drafts until equivalent full-population rollout evidence is attached. PR #2295 originates from a personal fork, so an upstream mirror of its head (
feature/webarenain this repository) is the base of #2917 while preserving this PR's review history. The mirror points at this PR's current head0a1bb0f97. The shared runtime fixes from60fa5e37cwere propagated through #2917 atd6d823701and #2918 at49805d0dfon 2026-10-21, using history-preserving merge commits and no force pushes. On 2026-10-18 #2917 and #2918 were restacked onto1864dbf53by merge commits (1abe9cf83,9e1fd2b60; the only conflict was the secrets baseline, resolved as the base's baseline plus each layer's own entries).Design
local_processkeeps one browser in the resources-server process (max_sessions: 1, one Gym stack per browser), andlocal_instance_poolkeeps one Gym stack per node that leases N browser-instance processes, each with its own Xvfb display, Xauthority, profile and port. The pool is opt-in;local_processremains the default.Main changes
nemo_gym.webtask, action, observation, artifact, session, resource-server, failure, task-image, browser-provider, and composed driver/evaluator contracts.visual_browserserver with Playwright lifecycle, PyAutoGUI coordinate actions, Unicode clipboard input, navigation recovery, proxy routing, CAPTCHA handling, redacted logs, recordings, and evidence retention.local_instance_poolbrowser-session provider: abrowser_instanceserver process per session slot (/reset,/observe,/step,/evaluate,/closeover loopback HTTP with a per-instance token) and aRemoteWebBackendthat drives it. One stack serves 16 concurrent rollouts on a node instead of 16 stacks; a hung browser occupies one instance instead of a worker, and a failed close does not hold a slot.site_pool_mode: site_limits(max_sessions_per_site), which rejects a seed with a retryable capacity error when a site already has that many sessions. Default staysunmanaged.resources_servers/visual_browser/docker/: Playwright's official base image, Xvfb, xclip, pinned Python packages) and a build script that builds from a committed tree.benchmarks/webvoyager/component-constraints.txt, the package versions of the reference component venvs, applied asUV_CONSTRAINTwhen the venvs are built (see Validation for why).provenance.yaml, from the source's own hash-pinned template, so their check-in and departure dates can be kept ahead of the run date. Preparation refuses dates that are no longer in the future.Changes since the previous review head
383151209The branch is synchronized with
mainand carries these follow-ups:1d6bb8b3dmainat8a1561172; main's input-order dispatch,upstream_errorhandler, and context-length detection replace this PR's copies3c0eafd5fray_enabled = False)7205a1445web_agentdeclares the legacy-agent environment server thatmainrequires in front of agentsbd82cf4cd781ac3b25trust_envagainst main's connection-pool setup (superseded by00329ee34)a468a9c2dweb_agentdeclares Pillow for the Qwen computer-use adapterc736e741800329ee34trust_envoption2fda9db3cweb:<kind>45be34fd1record_videoreaches Playwright (off by default)81756e38ec4886930dCapacityUnavailableErrorwas replayed from the session-control cache for the agent's whole seed retry budgeted29912c8eb4b40a7flocal_instance_pool: one browser-instance process per session behindRemoteWebBackend252f0cf331e4d85aec87b991b02,96e4e62fe,0137f7a46,e0b894a119869e88c74141df6e2site_pool_mode: site_limits)8889182c6component-constraints.txt); the image lock uses the same versions1864dbf53mainatb3103ea8a.server_utils: the validation-failure log keeps this branch's body shape (no raw body prefix) and adds main'svalidation_errors; main's header/query test checksrequest_body_shape.vllm_model: main's context-window markers (#3978) replace this branch's decoder-prompt check; this branch's test of unrelated failures drops the one message main's broader marker classifies as overflow by designe6e3633a5huggingface-hubto 1.33.0 (main'suv.lockversion): after the merge nemo-gym requires<2, and the lock's 2.2.0 made the components unresolvable60fa5e37c0a1bb0f9760fa5e37cin the benchmark README; documentation only, with 37 benchmark tests and repository-wide pre-commit passingStandard preparation and execution
From a clean Linux checkout:
From a second terminal in
benchmarks/webvoyager:../../.venv/bin/gym eval run --no-serve --concurrency 1gym eval preparerenders the dated questions for the reference date inprovenance.yaml(currently 2026-10-11) and fails once any of them is no longer in the future;benchmarks/webvoyager/prepare.py --reference-date YYYY-MM-DDrenders them for a later run, in whole weeks after 2026-07-26. Use--profile nano_omnifor the Nano Omni policy adapter. Stop the foregroundgym env startprocess with Ctrl-C; Gym currently has no separateenv stopcommand. The WebVoyager benchmark README is the single end-to-end guide for external-service preflight, smoke, full-population execution, fixed-denominator reconciliation, and training failure semantics.Validation
Full-population validation on 2026-10-21
On tested head
60fa5e37c, Nano Omniiter_0004622achieved 418/552 = 75.72% SR. All 552 tasks have valid unique scores: 418 successes and 134 scored zeros, with no missing tasks, duplicate valid results, masked selected results, or unresolved invalid tasks. This is the tuned checkpoint, not public standard Nano Omni v3.The run used the shared
visual_browserruntime withlocal_instance_pool, 16 browser instances, a per-site session limit of 2, and TP8 H100 serving. Temperature was 0.1, top_p was 0.95, and the policy output-token cap was omitted. It reused the unchanged 552-task file rendered for reference date 2026-10-11, SHA-256951bfe5c328bf53859a81b6d75e45943a630fb19f2d73e8f09a4aa275af8cb6d; dates were not re-rendered during recovery.This is the append-only completion of the 2026-10-20 run, not a fresh single-pass rerun. Recovery preserved all 275 original valid outcomes, including 59 scored zeros, and added 265 valid outcomes on the first recovery node and 12 on the successor. Only missing or infrastructure-invalid/masked tasks were retried; a valid scored zero was never replaced. No Gym code, policy prompt, task content, judge logic, or model-serving recipe changed during recovery.
Automatic continuation was exercised end to end: after the first recovery generation ended, the queued successor ran exactly the remaining 12 invalid tasks and produced 12 valid results, including 9 successes. The unused standby was cancelled and the active GPU allocation released. This verified generation-end handoff and recovery, not a four-hour-deadline handoff. These live-site results are integration evidence, not a controlled model comparison across different execution dates or recipes.
The runtime changes tested by this completed rollout are committed in
60fa5e37c. Current head0a1bb0f97adds only the result to the benchmark README; its 37 WebVoyager benchmark tests and repository-wide pre-commit pass. The dependent layers have also been synchronized and tested separately: #2917 has 516 focused core/benchmark tests, 90 web-agent tests, and 21 local-site browser tests passing; #2918 has 524 focused core/benchmark tests, 90 web-agent tests, 24 local-site browser tests, and 31 visual-browser resource tests passing. Those restack checks are not new WebArena or VisualWebArena full-population scores.On head
e6e3633a5: a fresh reference build of the WebVoyager components undercomponent-constraints.txtpasses, every installed package equal to the lock (104–112 locked packages per component); with it, one browser-instance stack (16 instances, Nano Omniiter_0004622) ran half of the 552 tasks (276): 206 of 275 valid solved (GitHub--40masked, CAPTCHA), against 208–216 for eight earlier full runs on the same tasks (every per-task difference p ≥ 0.21). The constraints file and image lock test pass.On head
1864dbf53(after mergingmainatb3103ea8a):uv lock --checkpasses; pre-commit passes on the resolved files. Core unit tests with the CI extras (-m "not sandbox"): 9,020 passed; the 23 other failures fail identically onmainb3103ea8aon the same macOS host (launcher, CI-environment, OpenSandbox and telemetry-memory tests). Shared web and WebVoyager 253,vllm_model571,web_agent87 andvisual_browser29 pass, each server in its own environment.On head
8889182c6:tests/unit_tests/test_web*.py216,benchmarks/webvoyager/tests37) pass, and thevisual_browsertests (29) pass in their own Python 3.13.14 environment.web_agentis unchanged sinceed29912c8.pre-commit run --from-ref ed29912c8 --to-ref 8889182c6passes anddetect-secretsfinds nothing in the files changed sinceed29912c8;pyproject.tomlanduv.lockare unchanged.uv pip compileof all six WebVoyager components withcomponent-constraints.txt(Python 3.13.14, x86_64 manylinux) resolves to exactly the reference venvs' versions, apart from the seededpipand thegrpciopin noted in that file.Browser-instance provider, full WebVoyager runs against a same-time
local_processcontrol (Nano Omniiter_0004622, the 552 tasks rendered for 2026-10-11, same checkpoint, serving, sampling and step limit; each pair started together on reference H100 hardware, append-only reconciled, 552/552 valid in every run):local_instance_poollocal_processlocal_processalone scored 420–436 over four runs on these tasks. With the component venvs built a week apart and unlocked (Pillow 13.0 instead of 12.3 and 20+ other minor releases per component), the instance-pool runs had 12–17 rollouts with unparseable model actions against 1–8 for the control; with the versions locked it had 4. At 32 sessions per arm the site limit kept every site at no more than 4 concurrent sessions (control: up to 7), while GitHub's per-IP restriction page appeared in both arms alike. In the 32-session control, one browser step in one worker never returned; the worker's only session slot stayed occupied and its remaining tasks waited out the seed budget. With the pool the same hang occupies one of 16 instances.On head
ed29912c8:tests/unit_tests/test_web*.py,benchmarks/webvoyager/tests) pass, as do theweb_agent(87) andvisual_browser(29) tests in their own environments.uv lock --checkand repository-widepre-commit run --all-filespass, and the branch merges cleanly withmainat4a9236e48.detect-secretsfinds nothing in the changed files; the nine non-secret Git revision and checksum lines inbenchmarks/webvoyager/provenance.yamlcarry inline# pragma: allowlist secretannotations. This PR does not change the root.gitignore,.pre-commit-config.yaml, or GitHub workflow definitions.gym eval prepare --benchmark webvoyagerdownloads the pinned source and template and writes exactly 552 tasks.template/render_webvoyager.pyfor all 79 template entries at every reference date from 2026-01-01 through 2029-12-30: 115,340 renderings, including 17,048 month-crossing and 1,460 year-crossing ranges, with no difference. Rendered for 2026-07-26, the prepared file is byte-identical to the population used by every full run below (SHA-256bf61d4913acce8175d28d30e7e68166cce490b0891d2e3fa1ce10e0db1ba504b). Rendered for 2026-10-11 (SHA-256951bfe5c328bf53859a81b6d75e45943a630fb19f2d73e8f09a4aa275af8cb6d), only the 79 dated intents differ.c4886930danded29912c8are covered by unit tests, the offline checks above, and the full run oned29912c8below.Full runs, all on the hash-pinned 552-task population and the
visual_browserruntime. The first four used the source's dates for 2026-07-26; the last rendered them for 2026-10-11:iter_0004622, parser-faithful r1iter_0004622, parser-faithful r2iter_0004622,81756e38eiter_0004622,ed29912c8, dates for 2026-10-11Every run produced 552 valid unique task results with no missing, malformed, or duplicate-valid tasks, and every task whose date had passed failed. On the 514 tasks whose dates were open in all four Nano Omni runs, they scored 390, 396, 391, and 401. In the
81756e38erun, two first-wave rows were retried and solved:GitHub--40(CAPTCHA budget exhausted, the routing added in81756e38e) andGoogle Search--25(one seed navigation error replayed for the full 1800 s seed budget, the defect fixed inc4886930d). Oned29912c8, with the dates rendered for 2026-10-11, no date had passed: the run solved 33 of the 38 tasks that had expired for the81756e38erun (Mingjie's golden run, which executed them before any date passed, solved 30) and 401 of the 514 (golden 399). Two of its seeds failed on the same navigation error asGoogle Search--25and ran again on the agent's first retry; both tasks succeeded.GitHub--40needed two recovery waves for the same CAPTCHA.The two parser-faithful repetitions used the same frozen source, tuned checkpoint, parser configuration, external services, judge, and generation parameters; their mean was 417.5/552, or 75.63 percent, with a five-task difference. The
81756e38erun used the same checkpoint, serving recipe, and services with this branch's source, which no longer echoes the previous action into each observation (d703eabf1). In the parser-faithful profile, Gym validates parser-produced structured calls but does not repair malformed JSON, complete delimiters, infer aliases, or silently clamp action arguments. Because WebVoyager uses live websites and external proxy, CAPTCHA, judge, and policy services, these numbers are integration evidence rather than stable leaderboard guarantees.Operational requirements and non-goals
xclip; live-site access; US egress for proxy-scoped domains; a funded CAPTCHA provider; a configured multimodal judge; and policy-serving assets that match the selected recipe lock.🤖 Generated with Claude Code
Saved-result rejudgment repair — 2026-11-11
Published fix:
86f1bc9f0f566332cb79785e71df72c090ab03c8. Addresses the persisted nested-grade review. The standard verify response now includes its freshly computedverifier_result, preventing RolloutStore from retaining an old masked nested grade when the flat verdict changes. This is the minimal two-line production repair; the separate CAPTCHA and judge-JSON follow-ups are not included.The regression posts to the real in-process ASGI
/verifyroute, admits rejudgment against a manifest-backed RolloutStore, callsrecord_rejudgment, then reloads persisted output. Both SUCCESS/reward1 and FAILURE/reward0 assert consistent flat/nested reward, task success, mask/validity, cleared nested failure kind and verifier metadata, and an unchanged original policy response.Validation: 44 judge/rejudgment tests; final restacked selection 507 passed with one warning; repository-wide pre-commit passed. Final selection:
Existing standalone-ad8, stack-top fixture and live WebVoyager evidence retain their actual executed source identities. They are not relabeled as full-run evidence for this later repair. The WebVoyager partial result is 410/551 valid tasks (74.41016333938294%), with GitHub--40 unresolved; it is not a qualified552-task score. The WebArena qualified full-population gate remains separate and unchanged.
CI follow-up at
711c9966fb2810ae490081627b929db94299a96f(2026-11-11)Addressed the middleware and Guardwords handoff in the review comment: bearer authentication now delegates directly through ASGI in the caller task, with the existing token lookup, parsing, public paths and 401 payload preserved. The unchanged repository middleware policy fails on the previous head and passes with the repair. Both new task/context cases fail under a deliberate child-task mutation, and the original source was restored afterward.
Neutralized historical reference wording in the constraints comment, the historical image-lock comment and the two description phrases above. Every dependency pin and historical count remains unchanged. The exact pinned scanner with the current private catalogue reports four locations before and zero after; the extra location relative to the prior native CI report is the historical image-lock comment.
For release validation, consume the existing FW-CI-templates #619 repair at
a689c8faa078c7aa501442ca40bd8232eb4b2700, which has a member approval on that exact SHA. Its complete two-dot delta from the previousf7af92c4pin is the release-finalizer repair plus its contract-test file; no other template changes are imported. The upstream PR is still open. This uses that reviewed file-handoff implementation.Local validation:
8ca53ab5422baf98b9b6b9e9a32b1df845e0073c175b3b1c5aa720fe8bb2b935), with no publication and cleanup verified.pre-commit run --all-files, the pinned source/description Guardwords scan, andgit diff --cached --checkpassed; the commit has DCO sign-off.Commands used the local CPython 3.13.14 project environment, with the candidate source first on PYTHONPATH:
These are local HTTP/ASGI and shell/jq checks. Native CI for this exact consumer head and a fresh real model/browser/judge rollout remain pending; no new benchmark score is claimed here.
Release-finalizer state correction — 2026-11-11
The release workflow now pins
254abeee7640aac4a3de654630f5346de0a8f46afrom NVIDIA-NeMo/FW-CI-templates#620. This incorporates #619 and Martyna Patelka's correction for missing/empty generated files and stale-note fallback, supplied in discussion_r4537142113. The new template SHA is pending maintainer review; it is not described as member-approved. #620 is separate because I cannot update #619's author branch.The same ten-test inert fixture has four failures against the old workflow and passes all ten against the correction. An additional 1,875,002-byte UTF-8 body is preserved exactly. Publishing is stubbed. Applicable pre-commit checks and git diff --check pass. This Gym change only updates the workflow pin; the Nano4 run remains on its independently pinned source. Native consumer release validation and trusted CI still require applicable member authorization.