Skip to content

feat(web): drive the REAL browser for search + fetch — the persona can actually use the internet now#1943

Merged
joelteply merged 1 commit into
canaryfrom
feat/web-via-real-browser
Jul 8, 2026
Merged

feat(web): drive the REAL browser for search + fetch — the persona can actually use the internet now#1943
joelteply merged 1 commit into
canaryfrom
feat/web-via-real-browser

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The web hand was hollow: web/search used DuckDuckGo's Instant-Answer API (trivia only → count:0 for every
developer query), and there was no web/fetch at all. So the persona was offered a search tool that returned
nothing and never used it — "pretending the internet doesn't exist" because functionally, for her, it didn't.
The reqwest-scrape fix I tried first got DDG's "anomaly" bot-block page (200, zero results) — the classic
scraper wall.

Fix: drive the host's REAL headless browser (the same Chromium the screenshotter already locates) with
--dump-dom — Chrome loads the URL, runs its JS, prints the rendered DOM. A real browser gets real results
where an HTTP scrape is blocked.

  • web/browser::render_dom(url, settle) — locate browser → --headless=new --dump-dom with a real UA →
    captured stdout, 30s timeout, fail-loud on no-browser / timeout / empty DOM. Reuses
    capture::web::locate_browser (now shared) — no duplicated browser list.
  • web/search (duckduckgo) → renders html.duckduckgo.com/html/?q=…, parses result__a/result__snippet,
    unwraps the uddg redirect. Keyless floor that ACTUALLY works; Brave key still the reliable paid path.
  • web/fetch (NEW, AiSafe) → renders any URL, strips script/style/tags, returns clean capped readable text + <title>. The "read the doc/page I found" hand — the natural partner to search.

Live-verified through the persona command path: web/search → 8 real results; web/fetch → the rendered docs.rs
page. Unit-tested (parse, redirect-decode, url-encode, readable-extraction, bot-block-empty). Closes the core of
task #93.

Co-Authored-By: Claude Opus 4.8 [email protected]
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…n actually use the internet now

The web hand was hollow: `web/search` used DuckDuckGo's Instant-Answer API (trivia only → count:0 for every
developer query), and there was no `web/fetch` at all. So the persona was offered a search tool that returned
nothing and never used it — "pretending the internet doesn't exist" because functionally, for her, it didn't.
The reqwest-scrape fix I tried first got DDG's "anomaly" bot-block page (200, zero results) — the classic
scraper wall.

Fix: drive the host's REAL headless browser (the same Chromium the screenshotter already locates) with
`--dump-dom` — Chrome loads the URL, runs its JS, prints the rendered DOM. A real browser gets real results
where an HTTP scrape is blocked.

- `web/browser::render_dom(url, settle)` — locate browser → `--headless=new --dump-dom` with a real UA →
  captured stdout, 30s timeout, fail-loud on no-browser / timeout / empty DOM. Reuses
  `capture::web::locate_browser` (now shared) — no duplicated browser list.
- `web/search` (duckduckgo) → renders `html.duckduckgo.com/html/?q=…`, parses `result__a`/`result__snippet`,
  unwraps the uddg redirect. Keyless floor that ACTUALLY works; Brave key still the reliable paid path.
- `web/fetch` (NEW, AiSafe) → renders any URL, strips script/style/tags, returns clean capped readable text +
  <title>. The "read the doc/page I found" hand — the natural partner to search.

Live-verified through the persona command path: web/search → 8 real results; web/fetch → the rendered docs.rs
page. Unit-tested (parse, redirect-decode, url-encode, readable-extraction, bot-block-empty). Closes the core of
task #93.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply joelteply merged commit d5cfce6 into canary Jul 8, 2026
@joelteply joelteply deleted the feat/web-via-real-browser branch July 8, 2026 11:58
joelteply added a commit that referenced this pull request Jul 8, 2026
…a HABIT, not just an available tool (#1944)

The web tools now return real results (PR #1943), but a working tool she never reaches for is worthless. Her
acting doctrine (`ACTING_BLOCK`) told her to write/run/read — but said nothing about the web, so she'd guess a
library's API from a stale training memory instead of looking it up. That's exactly how a local model loses to
a real dev workflow.

Fix: one sentence in the acting doctrine — when she hits a library, API, error, or fact she's unsure of, SEARCH
(`web/search`) and READ (`web/fetch`) the way a developer actually works; her training has a cutoff, the web
doesn't; foraging then writing from what she found beats confidently shipping something wrong. Doctrine/PX, not
output-steering — it names when the hand is for, same voice as the rest of the block.

This is the edge canned agents don't have on real projects: she learns the current tool instead of hallucinating
last year's API. [[active-acquisition-foraging]] [[px-persona-experience-tools-as-good-ux]]


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant