hermes - 💡(How to fix) Fix Feature: Add config option to prefer web_extract over browser_navigate for simple URL fetches

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

  1. Tool pre-dispatch filter — in model_tools.py or the tool call handler, intercept browser_navigate calls where the URL looks fetchable (no query params implying interaction, ends in .md/.json/.txt/.pdf etc.) and transparently redirect to web_extract when available.
  • Disable browser toolset entirely — works as a blunt workaround but removes browser capability entirely. Users need browser for interactive tasks.
  • Per-URL routing rules — e.g., "*.github.com → web_extract, *reddit.com → browser" — too fragile, maintained poorly.
  • Model-level instruction — rely on system prompt only. Currently the advisory text in browser_navigate description already tries this and isn't reliable.

Code Example

web:
  prefer_fetch_over_browser: true   # default: false

---

browser:
  avoid_for_simple_fetch: true      # default: false

---

web:
  backend: ''
  search_backend: ''
  extract_backend: ''

browser:
  inactivity_timeout: 120
  command_timeout: 30
  engine: auto
  # no existing flag for this behaviour
RAW_BUFFERClick to expand / collapse

Problem

When both browser_navigate and web_extract tools are available, the LLM decides which to use. For simple URL content retrieval (docs, APIs, raw files), the model often picks browser_navigate even though web_extract is faster and significantly cheaper.

Spinning up a headless browser (local or cloud) has measurable overhead:

  • Local: ~1–3s startup + Chromium process
  • Cloud (Browserbase/Browser Use): API round-trip + session setup latency
  • Token cost: browser snapshots return full accessibility trees; web_extract returns compressed markdown

browser_navigate's own tool description acknowledges this:

"For simple information retrieval, prefer web_search or web_extract (faster, cheaper)."

But this is only advisory — the LLM can and often does ignore it when both tools are present.

Proposed Solution

Add a config toggle that globally signals to prefer web tools over browser for non-interactive fetch tasks. Two alternative naming directions:

Option A — target web side (what we prefer):

web:
  prefer_fetch_over_browser: true   # default: false

Option B — target browser side (what we avoid):

browser:
  avoid_for_simple_fetch: true      # default: false

When enabled, the agent should:

  1. Prefer web_extract for fetching raw/static content from URLs
  2. Reserve browser_navigate for sites requiring interaction (login, JS rendering, form submission, scroll-dependent content, etc.)
  3. Still use browser tools when the task is inherently interactive

Implementation Guidance

The preference can be enforced in one of several ways (pick best fit):

  1. System prompt injection — add a directive like "for URL content retrieval, prefer web_extract unless the page requires interaction" when the config flag is set.

  2. Tool pre-dispatch filter — in model_tools.py or the tool call handler, intercept browser_navigate calls where the URL looks fetchable (no query params implying interaction, ends in .md/.json/.txt/.pdf etc.) and transparently redirect to web_extract when available.

  3. Tool priority ordering — adjust the order discover_builtin_tools() registers tools, or add a priority field to tool schemas so web tools appear before browser tools in the tool list the model sees (making the model more likely to pick them first).

Option 1 is simplest to implement. Option 2 is most correct. Option 3 is most robust but may have unintended side effects on other tool selection.

Alternatives Considered

  • Disable browser toolset entirely — works as a blunt workaround but removes browser capability entirely. Users need browser for interactive tasks.
  • Per-URL routing rules — e.g., "*.github.com → web_extract, *reddit.com → browser" — too fragile, maintained poorly.
  • Model-level instruction — rely on system prompt only. Currently the advisory text in browser_navigate description already tries this and isn't reliable.

Config Reference

Current relevant config in ~/.hermes/config.yaml:

web:
  backend: ''
  search_backend: ''
  extract_backend: ''

browser:
  inactivity_timeout: 120
  command_timeout: 30
  engine: auto
  # no existing flag for this behaviour

This feature would add one new boolean to whichever section is chosen.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Feature: Add config option to prefer web_extract over browser_navigate for simple URL fetches