sync: harness 04f7716#20
Merged
Alezander9 merged 1 commit intomainfrom Apr 29, 2026
Merged
Conversation
7 upstream commits since fefca43. Windows fixes (#232, #240) + skill rename (#242). All in the protected src/browser_harness/ zone — taken verbatim. No divergences touched. Files: - src/browser_harness/_ipc.py: BH_TMP_DIR override; drop DETACHED_PROCESS - src/browser_harness/admin.py: ensure_daemon warm probe via ipc.connect - src/browser_harness/helpers.py: screenshot + debug-click via ipc._TMP - SKILL.md: name: browser-harness -> browser - install.md: name: browser-harness-install -> browser-install
There was a problem hiding this comment.
1 issue found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/bcode-browser/harness/src/browser_harness/helpers.py">
<violation number="1" location="packages/bcode-browser/harness/src/browser_harness/helpers.py:235">
P2: Ensure the screenshot parent directory exists before writing, otherwise `BH_TMP_DIR` values that don't already exist will cause `capture_screenshot()` to fail with `FileNotFoundError`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
| """Save a PNG of the current viewport. Set max_dim=1800 on a 2× display to | ||
| keep the file under the 2000px-per-side limit some image-aware LLMs enforce.""" | ||
| path = path or str(Path(tempfile.gettempdir()) / "shot.png") | ||
| path = path or str(ipc._TMP / "shot.png") |
There was a problem hiding this comment.
P2: Ensure the screenshot parent directory exists before writing, otherwise BH_TMP_DIR values that don't already exist will cause capture_screenshot() to fail with FileNotFoundError.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/bcode-browser/harness/src/browser_harness/helpers.py, line 235:
<comment>Ensure the screenshot parent directory exists before writing, otherwise `BH_TMP_DIR` values that don't already exist will cause `capture_screenshot()` to fail with `FileNotFoundError`.</comment>
<file context>
@@ -232,7 +232,7 @@ def scroll(x, y, dy=-300, dx=0):
"""Save a PNG of the current viewport. Set max_dim=1800 on a 2× display to
keep the file under the 2000px-per-side limit some image-aware LLMs enforce."""
- path = path or str(Path(tempfile.gettempdir()) / "shot.png")
+ path = path or str(ipc._TMP / "shot.png")
r = cdp("Page.captureScreenshot", format="png", captureBeyondViewport=full)
open(path, "wb").write(base64.b64decode(r["data"]))
</file context>
Suggested change
| path = path or str(ipc._TMP / "shot.png") | |
| path = Path(path) if path else ipc._TMP / "shot.png" | |
| path.parent.mkdir(parents=True, exist_ok=True) | |
| path = str(path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings
browser-use/browser-harnessup to04f7716. 7 upstream commits sincefefca43.Three groups of changes:
ensure_daemonwarm probe now goes throughipc.connectinstead of rawsocket.AF_UNIX(which doesn't exist on Windows Python), so Windows users don't churn the daemon on every warm call. NewBH_TMP_DIRenv override so callers (e.g. browsercode per-session scratch) can redirect sock/port/pid/log + screenshots to a single dir. DropDETACHED_PROCESSfrom Windows daemon spawn flags to suppress an emptypython.execonsole window._open_inspect=Falseflag onensure_daemon;run_setuppasses it to avoid spawning new tabs in a recovery loop.SKILL.mdfrontmattername:browser-harness→browser; same forinstall.md. Pure end-user surface change (slash command/browser); no integration code on our side references it.Files updated
packages/bcode-browser/harness/src/browser_harness/_ipc.py—BH_TMP_DIRoverride, spawn-flag fixpackages/bcode-browser/harness/src/browser_harness/admin.py—ipc.connectwarm probe,_open_inspectflag, drop unused_paths()helperpackages/bcode-browser/harness/src/browser_harness/helpers.py—capture_screenshotand debug-click overlay route throughipc._TMPpackages/bcode-browser/harness/SKILL.md,packages/bcode-browser/harness/install.md— skill name renameAll changes are in the protected
src/browser_harness/*.pyzone — taken upstream verbatim perharness-sync.mdpolicy.Divergences
No change. Still just
.gitignoreadding.venv/.Verification
uv run python -c "from browser_harness import run, helpers, daemon, admin, _ipc"→imports okuv run browser-harness --version→0.1.0ensure_real_tab,page_info,js,capture_screenshot(lands inBH_TMP_DIR),click_at_xy,scroll, plus PID-stable warm-probe verification.Sync log
UPSTREAM.mdrow appended.