项目文件夹
codex flagged that set_session was now performing up to four sequential
domain enables (5s timeout each) plus a 2s Network.disable, so a slow
or remote daemon could block the synchronous IPC reply for ~22s while
the helper's _send() socket has only a 5s read timeout. Old code only
awaited Page.enable (3s) on this path.
Three changes to keep the reply under the IPC deadline:
1. _enable_default_domains now awaits asyncio.gather over the four
Domain.enable coroutines instead of looping sequentially. Per-call
timeout reduced from 5s to 4s. Worst case is bounded by a single
CDP round trip rather than four.
2. set_session schedules the old-session Network.disable in the same
gather as the four enables on the new session — independent CDP
sessions, no ordering required for correctness (the consumer-side
filter in wait_for_network_idle is the actual correctness gate).
3. The 🟢 tab-marker title-prefix Runtime.evaluate is now fire-and-forget
via asyncio.create_task (+ _silent). It's purely cosmetic; agents
shouldn't wait on it.
Worst-case set_session reply time: max(2s disable, 4s parallel enables)
≈ 4s, comfortably under the 5s IPC timeout. Normal case on a remote
daemon drops from ~800ms (4 sequential round trips) to ~200ms (1 round
trip in parallel).
Two new tests in tests/unit/test_daemon.py use a fake CDP whose
send_raw blocks on an asyncio.Event, then assert the peak in-flight
call count:
- with a previous session: peak == 5 (1 disable + 4 enables)
- first attach: peak == 4 (4 enables, disable skipped)
Sequential await would peak at 1 on both. Full suite: 65 passed.
Browser Harness ♞
Connect an LLM directly to your real browser with a thin, editable CDP harness. For browser tasks where you need complete freedom.
One websocket to Chrome, nothing between. The agent writes what's missing during execution. The harness improves itself every run.
● agent: wants to upload a file
│
● agent-workspace/agent_helpers.py → helper missing
│
● agent writes it agent_helpers.py
│ + custom helper
✓ file uploaded
You will never use the browser again.
Setup prompt
Paste into Claude Code or Codex:
Set up https://github.com/browser-use/browser-harness for me.
Read `install.md` and follow the steps to install browser-harness and connect it to my browser.
The agent will open chrome://inspect/#remote-debugging. Tick the checkbox so the agent can connect to your browser:
Click Allow when the per-attach popup appears (Chrome 144+):
See agent-workspace/domain-skills/ for example tasks.
Free Browser Use Cloud browsers
Stealth, sub-agents, or headless deployment.
Browser Use Cloud free tier: 3 concurrent browsers, proxies, captcha solving, and more. No card required.
- Grab a key at cloud.browser-use.com/new-api-key
- Or let the agent sign up itself via docs.browser-use.com/llms.txt (setup flow + challenge context included).
Architecture (~1k lines across 4 core files)
install.md— first-time install and browser bootstrapSKILL.md— day-to-day usagesrc/browser_harness/— protected core packageagent-workspace/agent_helpers.py— helper code the agent editsagent-workspace/domain-skills/— reusable site-specific skills the agent edits
Contributing
PRs and improvements welcome. The best way to help: contribute a new domain skill under agent-workspace/domain-skills/ for a site or task you use often (LinkedIn outreach, ordering on Amazon, filing expenses, etc.). Each skill teaches the agent the selectors, flows, and edge cases it would otherwise have to rediscover.
- Skills are written by the harness, not by you. Just run your task with the agent — when it figures something non-obvious out, it files the skill itself (see SKILL.md). Please don't hand-author skill files; agent-generated ones reflect what actually works in the browser.
- Open a PR with the generated
agent-workspace/domain-skills/<site>/folder — small and focused is great. - Bug fixes, docs tweaks, and helper improvements are equally welcome.
- Browse existing skills (
github/,linkedin/,amazon/, ...) to see the shape.
If you're not sure where to start, open an issue and we'll point you somewhere useful.
Domain skills
Set BH_DOMAIN_SKILLS=1 to enable agent-workspace/domain-skills/ — community-contributed per-site playbooks goto_url surfaces by domain. Contribute via PR.
The Bitter Lesson of Agent Harnesses · Web Agents That Actually Learn