Repository navigation
feat: improve browsecomp - #1109
Merged
Merged
Conversation
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
yuki-97
marked this pull request as ready for review
April 23, 2026 14:42
Signed-off-by: Yuki Huang <yukih@nvidia.com>
bxyu-nvidia
approved these changes
Apr 26, 2026
Merged
ritugala
added a commit
that referenced
this pull request
Jul 13, 2026
## Summary Consolidates our BrowseComp agent-harness work onto latest `main`. This brings the `browsecomp` benchmark, the `browsecomp_advanced_harness` resources server, and the `browsecomp_agent` up to the version we've been running for evals, adding a pluggable search backend, a read-only terminal/bash tool, token-based context reset, and trajectory/metrics recording. ## What's included - **Pluggable search provider (`tavily` | `exa`)** in the advanced harness, with per-call cost/latency metering. - **Terminal mode**: disk-backed page storage + a read-only `bash` tool guarded by deny/allow command lists (with a `ulimit -f 0` kernel backstop; the guard is a pragmatic speed-bump, not a security boundary). - **Token-based context reset** (`context_reset_tokens`, default 50k) as an alternative to the percentage-based reset, plus `max_reset_count`. - **Trajectory & metrics recording**: `snap_dir` writes per-sample reset/final trajectory `.jsonl`; token counts estimated via the vLLM `/tokenize` endpoint; reset-count / tool-call metrics on the response; `x-client-source` header. - **Judge grades the final assistant message**, not the concatenated `output_text` (previously the judge saw all assistant turns joined together). - **`response.output` carries the full untrimmed trajectory.** - **Reproducible sampling**: `prepare.py` defaults to a seeded 400-sample subset (seed 42); set `BROWSECOMP_RUN_FULL=1` for the full 1266. - **Judge retries at temperature 1.0** (the primary attempt stays at 0.0). - **`policy_model_no_interleaved_reasoning`**: a `_copy` of `policy_model` with `uses_interleaved_reasoning: false`, wired as the agent's model server so reasoning isn't fed back into multi-turn history. (The `uses_interleaved_reasoning` toggle itself is already in `main`; only the browsecomp config wiring is added here.) ## Relationship to #1087 / #1109 / #1203 Our harness forked from the original BrowseComp benchmark (#1087) and evolved independently, in parallel with upstream #1109 and #1203. Since both lines heavily rewrote `browsecomp_agent/app.py`, a straight merge would be a large, hard-to-review conflict. This PR instead treats our version as the source of truth for the browsecomp folders (`benchmarks/browsecomp`, `resources_servers/browsecomp_advanced_harness`, `responses_api_agents/browsecomp_agent`), which supersedes the browsecomp changes from #1109 and #1203. The substantive fixes/features from those PRs are retained in this version: - the `coerce_urls` bug fix (`urls`), - `policy_model_no_interleaved_reasoning`, - `snap_dir` snapshot recording, `max_reset_count`, - vLLM `/tokenize`-based token counting. Nothing outside the three browsecomp folders is changed. ## Testing - 43 unit tests across `benchmarks/browsecomp`, `browsecomp_advanced_harness`, and `browsecomp_agent` pass (`gym env test --resources-server browsecomp_advanced_harness`, plus the agent/prepare tests). - `ruff check` and `ruff format --check` clean (v0.9.9). - All commits DCO signed-off. --------- Signed-off-by: Ritu Gala <rgala@nvidia.com> Signed-off-by: Ewa Dobrowolska <edobrowolska@nvidia.com> Co-authored-by: Ewa Dobrowolska <edobrowolska@nvidia.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the
browsecomp_agentwith better observability and tighter control over long agentic trajectories.max_reset_count: Adds a new config field to cap the number of context resets per trajectory. Previously, context resets could happen unboundedly whenever the prompt exceeded the reset threshold. This lets users trade off context freshness against reset overhead.reset_count/num_tool_callslogging: Surfacesreset_countandnum_tool_callsdirectly on the agent response object for downstream analysis. Also fixesnum_tool_callsβ it was previously counted inside the resources server and is now correctly tracked in the agent loop.snap_dir): Adds an optionalsnap_dirconfig field. When set, the agent saves a JSONL snapshot of the full conversation at each context reset and at the end of the trajectory (keyed bytask_indexandattempt). Useful for debugging and offline analysis of long browsing runs.snap_dirandmax_reset_countinbenchmarks/browsecomp/config.yaml.