You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every Yellow modification should be evaluated for conversion to a Green extension point via upstream PR. See decisions.md §1c and ROADMAP F8.
56
56
57
-
The harness has its own narrower zone policy (see §3 below): `helpers.py` is editable, `daemon.py`/`admin.py` are protected, deliberate divergences are logged per-file.
57
+
The harness has its own narrower zone policy (see §3 below): `agent-workspace/agent_helpers.py` is editable, the `src/browser_harness/` core package is protected, deliberate divergences are logged per-file.
58
58
59
59
---
60
60
@@ -83,19 +83,20 @@ Each upstream has its own append-only table. Add a row every time you pull.
83
83
| Date | From SHA | To SHA | By | Notes |
84
84
|---|---|---|---|---|
85
85
| 2026-04-26 | — (initial) |`216a2c9`| bcode | Initial vendor at A2. Verbatim copy of `browser-use/browser-harness@216a2c9`. No divergences yet. |
86
+
| 2026-04-28 |`216a2c9`|`fefca43`| bcode | 41 upstream commits. **Major restructure** (PR #229): src-layout reorg (`*.py` → `src/browser_harness/*.py`), `domain-skills/` → `agent-workspace/domain-skills/`, agent-editable surface moved from root `helpers.py` to `agent-workspace/agent_helpers.py`, new `_ipc.py` for Windows TCP / POSIX AF_UNIX support, tests moved to `tests/{unit,integration}/`. Also: Expedia/Substack/Loom/Gmail domain skills, screenshot max-dim, helpers.switch_tab dict-accept, websockets pin 15.0.1, BU_CDP_URL, doctor improvements, JS eval refactor. Adapted our integration: `browser-execute.ts` invokes `browser-harness` console-script (not `python run.py`); `harness.ts``PRESERVED_PATHS` updated to `agent-workspace/agent_helpers.py`; smoke test now imports from `browser_harness` package; `browser-execute.txt` prompt updated to point at new helper paths. Divergences touched: none (still just `.gitignore` + `.venv/`). |
86
87
87
88
---
88
89
89
90
## 3. Harness divergences
90
91
91
92
Per-file record of where `packages/bcode-browser/harness/` deliberately differs from upstream. Read this *before* a sync diff so intentional differences aren't mistaken for missing features.
-`src/browser_harness/*.py` (`daemon.py`, `admin.py`, `helpers.py`, `run.py`, `_ipc.py`) — protected. Pulled verbatim from upstream. If behavior change is needed, upstream a PR to `browser-use/browser-harness`.
98
+
-`interaction-skills/`, `agent-workspace/domain-skills/` — verbatim from upstream. We never edit these.
99
+
- Other files (`pyproject.toml`, `LICENSE`, `README.md`, etc.) — divergence allowed but discouraged.
Copy file name to clipboardExpand all lines: harness-sync.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,23 +62,24 @@ This is where the agent earns its keep. For each file changed in `<recorded-sha>
62
62
63
63
| File category | Action |
64
64
|---|---|
65
-
| Files not in our divergences table (incl. `daemon.py`, `admin.py`, `domain-skills/`, `interaction-skills/`, `pyproject.toml`, `LICENSE`, etc.) | Take upstream verbatim — `cp temp/browser-harness/<path> packages/bcode-browser/harness/<path>`. |
65
+
| Files not in our divergences table (incl. `src/browser_harness/*.py`, `agent-workspace/domain-skills/`, `interaction-skills/`, `tests/`, `pyproject.toml`, `LICENSE`, etc.) | Take upstream verbatim — `cp temp/browser-harness/<path> packages/bcode-browser/harness/<path>`. |
66
66
| Files in our divergences table | Read each upstream hunk. For each, decide: **take** (apply upstream change to our file), **skip** (our divergence wins, ignore upstream change), or **adapt** (rewrite our divergence to coexist with the upstream change). Update the divergences row if its reason or scope shifts. |
67
67
| New upstream files | Copy in. |
68
68
| Files we have but upstream removed | Decide: keep ours (record in divergences) or delete. |
69
69
70
70
Path-allowlist policy stays in force during sync resolution as well as normal development:
-`daemon.py`, `admin.py` — protected. Always take upstream verbatim. If upstream regresses, file an issue at `browser-use/browser-harness` and pin to the prior SHA, do not patch locally.
-`src/browser_harness/*.py` (`daemon.py`, `admin.py`, `helpers.py`, `run.py`, `_ipc.py`) — protected. Always take upstream verbatim. If upstream regresses, file an issue at `browser-use/browser-harness` and pin to the prior SHA, do not patch locally.
Verifies the package builds, deps resolve, and all four modules import. We don't try to start the daemon here — that needs a real Chrome and is covered by integration tests, not the sync workflow.
82
+
The first line verifies the package builds, deps resolve, and the core modules import. The second exercises the console-script entry point we invoke from `browser-execute.ts`. We don't try to start the daemon here — that needs a real Chrome and is covered by integration tests, not the sync workflow.
● agent edits the harness and writes ithelpers.py192 → 199 lines
15
-
│ + upload_file()
14
+
● agent writes it agent_helpers.py
15
+
│ + custom helper
16
16
✓ file uploaded
17
17
```
18
18
@@ -25,14 +25,14 @@ Paste into Claude Code or Codex:
25
25
```text
26
26
Set up https://github.com/browser-use/browser-harness for me.
27
27
28
-
Read `install.md` first to install and connect this repo to my real browser. Then read `SKILL.md` for normal usage. Always read `helpers.py` because that is where the functions are. When you open a setup or verification tab, activate it so I can see the active browser tab. After it is installed, open this repository in my browser and, if I am logged in to GitHub, ask me whether you should star it for me as a quick demo that the interaction works — only click the star if I say yes. If I am not logged in, just go to browser-use.com.
28
+
Read `install.md` first to install and connect this repo to my real browser. Then read `SKILL.md` for normal usage. Use `agent-workspace/agent_helpers.py` and `agent-workspace/domain-skills/` for task-specific edits. When you open a setup or verification tab, activate it so I can see the active browser tab. After it is installed, open this repository in my browser and, if I am logged in to GitHub, ask me whether you should star it for me as a quick demo that the interaction works — only click the star if I say yes. If I am not logged in, just go to browser-use.com.
29
29
```
30
30
31
31
When this page appears, tick the checkbox so the agent can connect to your browser:
See [domain-skills/](domain-skills/) for example tasks.
35
+
See [agent-workspace/domain-skills/](agent-workspace/domain-skills/) for example tasks.
36
36
37
37
## Free remote browsers
38
38
@@ -46,16 +46,16 @@ Useful for stealth, sub-agents, or deployment.<br>
46
46
47
47
-`install.md` — first-time install and browser bootstrap
48
48
-`SKILL.md` — day-to-day usage
49
-
-`run.py` (~36 lines) — runs plain Python with helpers preloaded
50
-
-`helpers.py`(~195 lines) — starting tool calls; the agent edits these
51
-
-`admin.py` + `daemon.py` (~361 lines) — daemon bootstrap plus the CDP websocket and socket bridge
49
+
-`src/browser_harness/` — protected core package
50
+
-`agent-workspace/agent_helpers.py`— helper code the agent edits
51
+
-`agent-workspace/domain-skills/` — reusable site-specific skills the agent edits
52
52
53
53
## Contributing
54
54
55
-
PRs and improvements welcome. The best way to help: **contribute a new domain skill** under [domain-skills/](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.
55
+
PRs and improvements welcome. The best way to help: **contribute a new domain skill** under [agent-workspace/domain-skills/](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.
56
56
57
57
-**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](SKILL.md)). Please don't hand-author skill files; agent-generated ones reflect what actually works in the browser.
58
-
- Open a PR with the generated `domain-skills/<site>/` folder — small and focused is great.
58
+
- Open a PR with the generated `agent-workspace/domain-skills/<site>/` folder — small and focused is great.
59
59
- Bug fixes, docs tweaks, and helper improvements are equally welcome.
60
60
- Browse existing skills (`github/`, `linkedin/`, `amazon/`, ...) to see the shape.
Copy file name to clipboardExpand all lines: packages/bcode-browser/harness/SKILL.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,16 @@ description: Direct browser control via CDP. Use when the user wants to automate
5
5
6
6
# browser-harness
7
7
8
-
Direct browser control via CDP. Read helpers.py — that's where the functions live. For setup, install, or connection problems, read install.md.
8
+
Direct browser control via CDP. For task-specific edits, use `agent-workspace/agent_helpers.py` and `agent-workspace/domain-skills/`. For setup, install, or connection problems, read install.md.
9
9
10
10
## Usage
11
11
12
12
```bash
13
-
browser-harness <<'PY'
13
+
browser-harness -c '
14
14
new_tab("https://docs.browser-use.com")
15
15
wait_for_load()
16
16
print(page_info())
17
-
PY
17
+
'
18
18
```
19
19
20
20
- Invoke as browser-harness — it's on $PATH. No cd, no uv run.
@@ -30,9 +30,9 @@ Available domain skills:
30
30
## Tool call shape
31
31
32
32
```bash
33
-
browser-harness <<'PY'
33
+
browser-harness -c '
34
34
# any python. helpers pre-imported. daemon auto-starts.
35
-
PY
35
+
'
36
36
```
37
37
38
38
run.py calls ensure_daemon() before exec — you never start/stop manually unless you want to.
@@ -42,18 +42,18 @@ run.py calls ensure_daemon() before exec — you never start/stop manually unles
42
42
Use remote for parallel sub-agents (each gets its own isolated browser via a distinct BU_NAME) or on a headless server. BROWSER_USE_API_KEY must be set. start_remote_daemon, list_cloud_profiles, list_local_profiles, sync_local_profile are pre-imported.
43
43
44
44
```bash
45
-
browser-harness <<'PY'
45
+
browser-harness -c '
46
46
start_remote_daemon("work") # default — clean browser, no profile
# start_remote_daemon("work", profileId="<uuid>") # same, but by UUID
49
49
# start_remote_daemon("work", proxyCountryCode="de", timeout=120) # DE proxy, 2-hour timeout
50
50
# start_remote_daemon("work", proxyCountryCode=None) # disable the Browser Use proxy
51
-
PY
51
+
'
52
52
53
-
BU_NAME=work browser-harness <<'PY'
53
+
BU_NAME=work browser-harness -c '
54
54
new_tab("https://example.com")
55
55
print(page_info())
56
-
PY
56
+
'
57
57
```
58
58
59
59
start_remote_daemon prints liveUrl and auto-opens it in the local browser (if a GUI is detected) so the user can watch along. Headless servers print only — share the URL with the user. The daemon PATCHes the cloud browser to stop on shutdown, which persists profile state. Running remote daemons bill until timeout.
@@ -62,7 +62,7 @@ Profiles (cookies-only login state) live in interaction-skills/profile-sync.md
62
62
63
63
## Search first
64
64
65
-
Search domain-skills/ first for the domain you are working on before inventing a new approach.
65
+
Search `agent-workspace/domain-skills/` first for the domain you are working on before inventing a new approach.
66
66
67
67
Only if you start struggling with a specific mechanic while navigating, look in interaction-skills/ for helpers. The available interaction skills are:
68
68
- cookies.md
@@ -85,13 +85,13 @@ Only if you start struggling with a specific mechanic while navigating, look in
If you learned anything non-obvious about how a site works, open a PR to domain-skills/<site>/ before you finish. Default to contributing. The harness gets better only because agents file what they learn. If figuring something out cost you a few steps, the next run should not pay the same tax.
94
+
If you learned anything non-obvious about how a site works, open a PR to `agent-workspace/domain-skills/<site>/` before you finish. Default to contributing. The harness gets better only because agents file what they learn. If figuring something out cost you a few steps, the next run should not pay the same tax.
95
95
96
96
Examples of what's worth a PR:
97
97
@@ -118,7 +118,7 @@ The *durable* shape of the site — the map, not the diary. Focus on what the ne
118
118
119
119
- Raw pixel coordinates. They break on viewport, zoom, and layout changes. Describe how to *locate* the target (selector, scrollIntoView, aria-label, visible text) — never where it happened to be on your screen.
120
120
- Run narration or step-by-step of the specific task you just did.
121
-
- Secrets, cookies, session tokens, user-specific state. domain-skills/ is shared and public.
121
+
- Secrets, cookies, session tokens, user-specific state. `agent-workspace/domain-skills/` is shared and public.
122
122
123
123
## What actually works
124
124
@@ -139,7 +139,7 @@ The *durable* shape of the site — the map, not the diary. Focus on what the ne
139
139
- Connect to the user's running Chrome. Don't launch your own browser.
140
140
- cdp-use is only for CDPClient.send_raw. Prefer raw CDP strings over typed wrappers.
141
141
- run.py stays tiny. No argparse, subcommands, or extra control layer.
142
-
-Helpers stay short. Browser primitives in helpers.py; daemon/bootstrap and remote session admin live in admin.py.
142
+
-Core helpers stay short. Put task-specific helper additions in `agent-workspace/agent_helpers.py`; daemon/bootstrap and remote session admin live in the core package.
143
143
- Don't add a manager layer. No retries framework, session manager, daemon supervisor, config system, or logging framework.
144
144
145
145
## Gotchas (field-tested)
@@ -158,4 +158,4 @@ The *durable* shape of the site — the map, not the diary. Focus on what the ne
158
158
## Interaction notes
159
159
160
160
- interaction-skills/ holds reusable UI mechanics such as dialogs, tabs, dropdowns, iframes, and uploads.
161
-
- domain-skills/ holds site-specific workflows and should be updated when you discover reusable patterns for a website.
161
+
-`agent-workspace/domain-skills/` holds site-specific workflows and should be updated when you discover reusable patterns for a website.
0 commit comments