Skip to content

feat(saas-bench): add browser-use and OpenCode evaluation - #5969

Merged
yfw merged 38 commits into
NVIDIA-NeMo:mainfrom
bpritam14:feat/saas-bench-dual-harness-svg
Nov 16, 2026
Merged

yfw merged 38 commits into
NVIDIA-NeMo:mainfrom
bpritam14:feat/saas-bench-dual-harness-svg

Conversation

@bpritam14

@bpritam14 bpritam14 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Adds SaaS Bench evaluation through browser-use 0.13.7 or OpenCode harness 2.1.1 (CLI 1.17.11), with Gym entry points for both and matching Eval Factory recipes.

Source and compatibility

The public source is UniPat-AI/SaaS-Bench, commit 48c22deb18b98c0ed78f81e7f3be82bc162de2c8, before v1.1. Its runtime is Apache-2.0; task data, inputs and graders are CC-BY-4.0. Upstream saas_bench/**, docker/** and the retained task verifiers map to the same relative paths under responses_api_agents/saas_bench_agent/benchmark/. Every imported file names its source/revision/license. NVIDIA-authored extensions are distinguished from upstream imports; copyright modifications blocks, ATTRIBUTIONS, NOTICE and VENDORING describe the changes.

95 unmodified public graders are external data, pinned byte-for-byte alongside metadata/media in the 323-file manifest. 11 modified graders remain in Gym: the original seven grading/schema adaptations plus four Drupal Unicode reader fixes added since the review's older head. Source bindings now cover 51 shipped files (23 upstream imports and 28 NVIDIA-authored extensions). The fork is not presented as upstream provenance.

The modified tasks can score differently from public upstream. In particular, business_052 requires exactly 24 percent discount instead of upstream's approximate 10.04-or-24 check; its check 15 also requires exact line items and total tolerance 0.01 instead of at least three lines and tolerance 1.0. The Pretix template enables manual payment for new events, which can make go-live checks easier. software_008 and software_025 change Baserow authorization from Token to JWT. All eleven changes are individually disclosed in headers and VENDORING; public-reference score equivalence is not claimed.

Task data and app/browser images are deployment inputs. The README documents portable mounts, image/helper requirements and the public pinned data checkout. Model/judge credentials are runtime references. No separate private benchmark-code checkout is required.

Review corrections

  • Confirmed model endings keep their typed model attribution and the measured final-state grade, including partial credit. They no longer replace a usable grade with zero. Browser CDP/startup/screenshot/provider/unknown runtime faults remain masked evaluation faults. OpenCode empty or startup-only timeouts remain retryable.
  • A missing final SCORE line invalidates incomplete verifier output. App readiness is checked after verification; a stopped app cannot turn readback failure into a scored zero. Native checks and diagnostics are retained.
  • Inconclusive live verification retries before teardown with configurable inconclusive_verification_retries (default1, range0–3). Attempt receipts and wall times are retained. Exhausted judge/verifier faults are masked with terminal fail/evaluation attribution: there is no promise of detached re-judging after app cleanup.
  • Judge endpoint configuration is required before an episode starts. Trailing-slash URLs retain judge-fault detection for both HTTP clients. Masked rows without model output carry Gym's no-generation marker so recovery can rerun startup faults.
  • Cancellation reaps detached Enroot apps even during readiness. Startup compares prepared runtime and external data bytes against this checkout and the pinned release; stale bundles fail before episodes.
  • Each evaluation requires an explicit unique run root; reusing it resumes that run and its scores. Collector concurrency defaults to agent concurrency, avoiding queued rows spending their deadline on a semaphore. Both benchmark manifests load; the unused saas_bench compatibility alias was removed while prepare.py remains shared.
  • Both slirp network paths disable host-loopback access. Docker-compatible exec excludes caller credentials/configuration and keeps only PATH plus explicit container/runtime values. Cache/build guards use the real passwd home, and platform roots are deployment-configured absolute directories.
  • The blanket pre-commit exclusion is removed. Reviewed hash and seeded-app/test-fixture false positives are recorded in the secrets baseline, with no actor/judge credentials added. Public headers/docs/description no longer point at private resources.

Environment Server and harness scope

Both benchmark configs use Gym's shipped legacy_agent Environment Server. It forwards /run and aggregation to saas_bench_agent; the native agent/worker owns application setup, harness execution, final-state verification, failure policy and cleanup. OpenCode harness 2.1.1 / CLI 1.17.11 and browser-use 0.13.7 both remain supported. Existing flat prepared rows, repeat identity and both Factory entrypoint names are retained.

Following the latest review, this revision removes environment_servers/saas_bench_environment and the SaaS agent-session registration. The new custom Environment Server still relied on an agent-supplied grade, so it did not make harnesses interchangeable. The browser outer-deadline fix and the OpenCode recovery/no-generation rule in response.py are preserved unchanged.

A separate follow-up will move apps, browser state/tools, action budgets, verification and metrics to a Resources Server under single_agent_turn_legacy, with stock opencode_agent over MCP and a browser-use session adapter retaining the baseline protocol. This PR supports evaluation with two harnesses; it does not qualify multi-harness RL training or stock-harness score parity. Existing frozen evaluation/training campaigns retain their original pins and results.

Validation

Current Gym head: 4ba300842360955ba9951b2764459d3d4724cbf1, including main 25c5d318c4f638ac6d608771ec59eeaa82cfc137.

  • Current CI: Lint check, DCO and Nemo_CICD_Test pass. The sandbox suite, all four core shards, all eight server shards and combined core coverage pass.
  • Final fixture changes: 203 focused local-provider/supervisor/session tests pass, plus all-files pre-commit. Four negative controls confirm that the corrected tests still expose startup, expiry and grace-ordering faults.
  • The preceding main-sync head passed 1,105 SaaS/model/public-API tests and all 305 managed dependency locks. The subsequent change touches only two test files, leaving these runtime and lock inputs unchanged.
  • The merge repair changes only test fixtures. The main sync changes no SaaS agent, benchmark preset or VLLM model-adapter source. Production deadlines, grading, harness protocols and existing frozen campaigns are unchanged; additional model rollouts for this repair are N/A. Measured native-harness rollouts remain below.
  • Environment Server compliance still reports the intentionally retained legacy run/aggregation adapter. This follows the reviewer-requested legacy_agent design above; Resources Server separation is a follow-up. These warnings are advisory, not merge requirements. No check, assertion, coverage threshold or branch rule was suppressed.

Rollouts

Fresh Factory/Gym hosted-model smoke completed successfully at Gym 2bca62095dee190d3551fd66510e3796188e7e1d using the restored legacy_agent relay. One media_027 task per harness ran sequentially on one CPU node with a five-step budget. Both returned valid, unmasked native partial grades; each verifier ran nine checks with no judge failures. The allocation completed with exit code 0.

Harness Native score Masked Tool calls Tool errors Retained screenshots
OpenCode 2.1.1 / CLI 1.17.11 0.143 false 5 0 3
browser-use 0.13.7 0.143 false 6 0 2

These bounded smokes validate execution and live final-state grading, not full-task completion or public-reference score equivalence. Operational receipts, cluster job IDs and internal deployment details remain outside the public Gym checkout. Existing frozen campaigns are unchanged.

Merge-queue test reliability

The merge-queue repair addresses three shared fixture assumptions:

  • Wait for an atomically published child PID before expiring the worker. This proves the SIGTERM-ignore handler is installed before testing SIGKILL cleanup. Both normal and delayed startup, in-group and detached children, must pass.
  • Check the real 0.2-second expiry timeout, cancellation of the hung upload, retry state and a deliberate event-loop pause, under an outer safety timeout. Scheduler latency cannot invalidate a correctly delivered cancellation.
  • Reserve five seconds of fixture grace for the one-second checkpoint save and test a 6.2-second pre-TERM scan. The scan must not consume the post-TERM grace; the saved checkpoint and successful cleanup receipt remain mandatory.

All production timeout and cleanup policies are unchanged.

@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

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

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Nov 10, 2026
@bpritam14 bpritam14 changed the title Add SaaS Bench evaluation with browser-use and OpenCode feat(saas-bench): add browser-use and OpenCode evaluation Nov 12, 2026
@bpritam14
bpritam14 marked this pull request as ready for review November 12, 2026 18:38
@bpritam14
bpritam14 requested a review from a team as a code owner November 12, 2026 18:38
Merge current upstream main and regenerate the SaaS Bench component lock for OpenAI SDK 2.45.0. This resolves the stale dependency graph reported by lock-freshness and uv lock --check without changing the SaaS harness or vendored benchmark runtime.

Signed-off-by: Pritam Biswas <[email protected]>
Import exported failure kinds and config parser through Gym public APIs. Patch get_global_config_dict in its defining module so SaaS model tests do not leave a shadowing attribute on the lazy config facade and break later core tests.

Signed-off-by: Pritam Biswas <[email protected]>

@AdamRajfer AdamRajfer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Adam’s AI assistant
I reviewed this for Adam, and only for failure handling. I didn't look at the verifiers' task logic or the data.

Blocking:

  1. A judge fault scores the model 0. If the judge still returns 429/5xx after the retry in verifier_transport.py, the verifiers record a failed check. The error text ("Max retries exceeded … too many 503 error responses") doesn't match _INFRA, so unavailable stays false. A 200 with no choices behaves the same way. Judge errors should mask and retry the row, not score it.
  2. failure_outcome_action and failure_outcome_attribution aren't declared anywhere. Please declare them as terminal_bench_2_1 and deepswe do, and map malformed output, output caps, context limits and timeouts to the model kinds (counted as 0) instead of agent_run_error.
  3. Some model-side endings are masked and rerun as infra: an OpenCode context overflow it can't recover from, and a browser-use timeout or agent exception. These are model results and should be graded.

Minor:

  • The OpenCode timeout is graded without a failure kind; it should be agent_timeout.
  • The description and some file headers point at internal resources, and this repo is public.

Persist judge transport/schema faults independently of verifier exception text for requests and urllib callers. Apply shared typed retry/evaluation versus counted-zero/model outcomes. Grade unrecovered context limits, output caps, actor errors and timeouts while app state is alive. Retain measured checks, cancellation cleanup and source provenance, without changing task verifier criteria.

Signed-off-by: Pritam Biswas <[email protected]>
Use immutable public import snapshot links in source headers and the README. Retain original source hashes, revision attestations, author notices and licenses in provenance.json. Verified that every Python AST is unchanged by this metadata-only cleanup and all public snapshot targets exist.

Signed-off-by: Pritam Biswas <[email protected]>
Write agent_timeout in the worker result as well as the Gym response, and preserve it from the explicit timeout flag when execution-health metadata is absent. Test the real timed-out CLI path and the serialized response's counted-zero/model policy.

Signed-off-by: Pritam Biswas <[email protected]>
Merge b2a2791 to clear advisory lock drift introduced while review fixes were validated. All 292 managed locks, 1572 targeted regressions and full pre-commit checks pass after this sync.

Signed-off-by: Pritam Biswas <[email protected]>
@bpritam14

Copy link
Copy Markdown
Contributor Author

@AdamRajfer Thanks for the failure-handling review. The fixes for all three blocking points and both minor points have been pushed (current head b78db89c).

  • Judge transport failures after retries, including 429/5xx, and malformed/empty completions now produce explicit judge-failure metadata. These rows are masked with evaluation/retry attribution, even when a task verifier catches the exception and prints FAIL. Valid negative judge answers remain scored task failures.
  • Responses now populate the inherited typed failure_outcome_action and failure_outcome_attribution fields using the shared outcome policy. Malformed model output, output caps, unrecovered context limits and actor timeouts use model failure kinds and count as zero.
  • Unrecovered OpenCode context overflow and browser-use actor timeout/exception now reach final-state verification before app cleanup rather than being treated as infrastructure retries. Judge unavailability still takes precedence and masks the row.
  • OpenCode timeouts explicitly report agent_timeout in both the native worker result and Gym response.
  • Private links in the PR description and source headers have been replaced with public snapshot links. Original source/license attestations remain in the provenance manifest.

Validation: 1,572 regression tests, all 292 managed lock checks, and four SaaS Factory composition tests passed. Both live hosted-model harness smokes completed with unmasked grading (OpenCode 0.143; browser-use 1.0). The live smokes used functional-fix commit aad3be24; subsequent public-header, native-timeout-tag and main-sync changes were covered by regression checks. Full NVIDIA runner CI is still subject to the repository validation gate.

Ready for another look at the failure-handling changes.

@AdamRajfer AdamRajfer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Adam’s AI assistant
I reviewed this for Adam, again only for failure handling.

Thanks, judge faults and the model kinds look right now. Two things went the other way:

  • browser-use: the blanket except Exception (browser_worker.py:132), together with run_task's own catch-all, turns a Chrome CDP startup failure or a screenshot error into agent_invalid_output = 0. Only actor endings the model caused should count. Browser and runtime setup errors should stay evaluation faults and be retried.
  • OpenCode: a timeout with no events (worker.py:392) is now scored as agent_timeout. With no model turn at all, that's most likely a hung endpoint, not a model result. Please keep it retried.

Minor: provenance.json, NOTICE, the README and the description still reference gitlab-master and /lustre paths.

@bpritam14

Copy link
Copy Markdown
Contributor Author

/ok to test 828a008

@yfw

yfw commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

We no longer need main's order in .github/workflows/config/.secrets.baseline. The secrets detector writes its results sorted by file name, so this order is the tool's own output.

yfw
yfw previously approved these changes Nov 16, 2026
@yfw
yfw enabled auto-merge November 16, 2026 00:07
chtruong814
chtruong814 previously approved these changes Nov 16, 2026
@yfw
yfw added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43789993849

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 16, 2026
@bpritam14
bpritam14 added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43792472283

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 16, 2026
@bpritam14
bpritam14 dismissed stale reviews from chtruong814 and yfw via 57efb27 November 16, 2026 07:33
@bpritam14

Copy link
Copy Markdown
Contributor Author

/ok to test 57efb27

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 16, 2026 07:35
@bpritam14

Copy link
Copy Markdown
Contributor Author

/ok to test a84b4c5

@bpritam14

Copy link
Copy Markdown
Contributor Author

/ok to test 4ba3008

@yfw
yfw enabled auto-merge November 16, 2026 09:00
@yfw
yfw added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43894123274

Merged via the queue into NVIDIA-NeMo:main with commit f34dbf8 Nov 16, 2026
76 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants