sync: harness 32d8d51#36
Merged
Alezander9 merged 1 commit intomainfrom May 6, 2026
Merged
Conversation
There was a problem hiding this comment.
1 issue found across 13 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/tests/unit/test_admin.py">
<violation number="1" location="packages/bcode-browser/harness/tests/unit/test_admin.py:401">
P2: Make this PID-reuse test deterministic by stubbing `_process_start_time`; otherwise it depends on whether PID 4242 exists on the runner and can flake instead of testing the reuse path.</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.
| # Second identify() call (right before SIGTERM) returns None — simulating | ||
| # the daemon having exited and its PID having been reused by an unrelated | ||
| # process. The function must NOT escalate to SIGTERM in that state. | ||
| identify_responses = iter([live_pid, None]) |
There was a problem hiding this comment.
P2: Make this PID-reuse test deterministic by stubbing _process_start_time; otherwise it depends on whether PID 4242 exists on the runner and can flake instead of testing the reuse path.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/bcode-browser/harness/tests/unit/test_admin.py, line 401:
<comment>Make this PID-reuse test deterministic by stubbing `_process_start_time`; otherwise it depends on whether PID 4242 exists on the runner and can flake instead of testing the reuse path.</comment>
<file context>
@@ -252,3 +252,278 @@ def fake_browser_use(path, method, body=None):
+ # Second identify() call (right before SIGTERM) returns None — simulating
+ # the daemon having exited and its PID having been reused by an unrelated
+ # process. The function must NOT escalate to SIGTERM in that state.
+ identify_responses = iter([live_pid, None])
+ monkeypatch.setattr(admin.os, "kill", fake_kill)
+ monkeypatch.setattr(admin.ipc, "identify", lambda name, timeout=5.0: next(identify_responses))
</file context>
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-harness up to
32d8d515e. 52 upstream commits since59a166f.Files updated (verbatim from upstream)
src/browser_harness/_ipc.py—BH_RUNTIME_DIRsplit fromBH_TMP_DIR(PR #318, backward-compatible fallback);umask 0077around AF_UNIX bind to remove chmod TOCTOU (PR #309); ping/identify hardening against non-dict / non-positive-pid responses (PR #294).src/browser_harness/admin.py— PID-reuse safety inrestart_daemonvia_process_start_timefingerprint (Linux/proc, macOSps -o lstart, WindowsGetProcessTimes) + newidentify()helper (PR #294).src/browser_harness/daemon.py— Chrome Canary profile discovery on macOS + Windows (PR #263); Brave on Windows (PR #284);/json/version404 →ws://127.0.0.1:<port><ws_path>fallback for Chrome 147+ default user-data-dir, IPv6 host bracketing (PR #292);set_sessionenables Page/DOM/Runtime/Network for parity with initial attach (PR #296).src/browser_harness/helpers.py—current_tabresolvestarget_idserver-side via daemon meta (PR #305);wait_for_network_idlefilters events bysession_idso background tabs don'''t poison idle (PR #296).src/browser_harness/run.py— explicitBU_CDP_URL/BU_CDP_WSblocks cloud auto-bootstrap; previously the explicit endpoint was silently overridden (PR #300).tests/unit/{test_admin,test_helpers,test_run}.py— updated for the changes above. New:tests/unit/test_daemon.py,tests/unit/test_ipc.py.README.md— banner asset URL switched to ink-bleed SVG (PR #285)..github/VOUCHED.td— two bot/fabricated-profile exclusions (PRs #308, #310).Excluded paths (skipped per UPSTREAM.md §3)
agentlist,browser-use-cloud,freewheel-mrm,tasksquad-ai,vercel,x— PRs #281, #282, #283, #288, #301, #302) plus shopify-admin reorg/cleanup. Skipped.Divergences
.gitignore(.venv/) remains, untouched in this window.BrowserCode integration impact
browser-execute.tscontinues to setBH_TMP_DIR=ctx.bhTmpDir;BH_RUNTIME_DIRfalls back toBH_TMP_DIRso behavior is unchanged.BH_RUNTIME_DIRseparately fromBH_TMP_DIRto lift the AF_UNIX 104-byte budget off the persistent path. Out of scope for this sync.Verification
script/check-harness-diff.sh: only known.gitignoredivergence remains.uv run python -c "from browser_harness import run, helpers, daemon, admin, _ipc; print('''imports ok''')"→imports ok.uv run browser-harness --version→0.1.0.uv run --with pytest pytest tests/unit/ -q→ 76 passed.