Skip to content

feat: improve browsecomp - #1109

Merged
bxyu-nvidia merged 6 commits into
mainfrom
yukih/improve-browsecomp
Apr 26, 2026
Merged

bxyu-nvidia merged 6 commits into
mainfrom
yukih/improve-browsecomp

Conversation

@yuki-97

@yuki-97 yuki-97 commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Improves the browsecomp_agent with 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_calls logging: Surfaces reset_count and num_tool_calls directly on the agent response object for downstream analysis. Also fixes num_tool_calls β€” it was previously counted inside the resources server and is now correctly tracked in the agent loop.
  • Trajectory recording (snap_dir): Adds an optional snap_dir config 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 by task_index and attempt). Useful for debugging and offline analysis of long browsing runs.
  • Config: Exposes snap_dir and max_reset_count in benchmarks/browsecomp/config.yaml.

yuki-97 added 4 commits April 22, 2026 03:04
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>
@copy-pr-bot

copy-pr-bot Bot commented Apr 22, 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.

@yuki-97
yuki-97 marked this pull request as ready for review April 23, 2026 14:42
yuki-97 and others added 2 commits April 23, 2026 07:50
Signed-off-by: Yuki Huang <yukih@nvidia.com>
@bxyu-nvidia
bxyu-nvidia merged commit fe9845e into main Apr 26, 2026
6 checks passed
@bxyu-nvidia
bxyu-nvidia deleted the yukih/improve-browsecomp branch April 26, 2026 03:45
@ritugala ritugala mentioned this pull request Jul 1, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants