Skip to content

fix: start managed browsers with large macOS process listings - #188901

Merged
shakkernerd merged 1 commit into
mainfrom
managed-browser-process-discovery
Oct 31, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
managed-browser-process-discovery

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #188889

What Problem This Solves

Managed browser startup on macOS can fail before launching a browser when unrelated host process command lines make the process listing exceed 1 MiB. A fresh, unused profile then reports that headless-shell ownership could not be verified, blocking a normal about:blank open.

User Impact

Managed profiles can start on the observed host with a process listing of approximately 1.26 MB. The profile ownership checks, executable selection, default sandbox behavior, and navigation policy are unchanged. Discovery remains bounded and still refuses startup when the command fails, times out, or exceeds the new 4 MiB limit; this is not an unbounded process scan.

Why This Change Was Made

The macOS profile census captures all process arguments before looking for headless-shell profile users. Its 1 MiB limit was smaller than the existing 4 MiB process-list budget used by browser MCP discovery. This change aligns that one capture budget while retaining the one-second timeout and every parser, live-process, duplicate-flag, and failure path.

A narrower executable census was evaluated on the affected host. It found 542 shell processes, so individual argument queries would be expensive; batching required two scans, captured roughly 278 KB plus 755 KB, and took 259–286 ms. The existing single scan completed the approximately 1.26 MB inventory in 168–177 ms when allowed a larger bounded capture. These diagnostics support the small correction, not a browser-start performance claim. The maximum permitted output rises by 3 MiB.

Evidence

A fresh isolated macOS runtime on a3cfe95 reproduced the failure through native browser.request → /tabs/open with about:blank. The profile was stopped and no browser was spawned. Five contemporaneous captures using the original command and limits failed with ENOBUFS; no raw host process arguments were retained.

The existing launch test now uses a real subprocess to produce synthetic output above 1 MiB, preserving the actual capture boundary. Its 2 MiB startup case failed with the original ownership error before the correction and passes afterward. A 5 MiB overflow still refuses launch before profile creation or spawning.

Remote formatting, lint, affected production/test type checks, and three related browser files passed: 96 tests, including existing ownership, foreign-profile, duplicate-flag, changed-port, and cleanup controls. The affected batch took 35.13 seconds in Vitest (mostly cold transform); the test runner took 37.22 seconds. The 49-line test allocation covers only the two distinct capture outcomes and their shared fixture.

On the exact PR head, the same isolated macOS environment started Chrome through the native managed-browser path, opened about:blank, and read Example Domain through a 38-node ARIA snapshot. A file: open remained blocked and did not create a tab. A second active managed profile retained its PID and tab while the first was used. The host still exceeded the old limit: the 1 MiB capture failed while the 4 MiB capture returned 1,282,985 bytes.

A real agent using the OpenClaw runtime then read IANA's Example Domains page through Browser, delivered the expected explanation, and left the page open. The second profile remained intact. No alternate manually launched browser or sandbox relaxation was used.

Independent engineering review is clean. Canonical AutoReview covered P0–P3 on a3cfe95 → 79381cb with the unchanged launch, cleanup, locking, and sibling census context, and returned scoped-clean. Exact-head CI passed its selected jobs. ClawSweeper has not produced an accessible current verdict: the first workflow was superseded before review after the evidence update, the replacement dispatch was accepted, and the observer endpoint returned HTTP 403. No ClawSweeper rating is claimed.

There are no UI layout or rendering changes; native process, tab, page-content, and ownership assertions cover the changed contract.

@shakkernerd shakkernerd self-assigned this Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@shakkernerd
shakkernerd merged commit 1f088d2 into main Oct 31, 2026
122 checks passed
@shakkernerd
shakkernerd deleted the managed-browser-process-discovery branch October 31, 2026 01:14
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: managed browser startup on macOS when large process listings exceed the former discovery limit.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…aw#188901)

Restore managed browser startup on macOS for large process listings while preserving bounded ownership verification.

Fixes openclaw#188889.
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…8901)

(cherry picked from commit 1f088d2)

Release adaptation: carry only 4 MiB ps cap and focused native capture
regression. Unknown process ownership remains a refusal.
Companions: later profile threading openclaw#200503, Linux temp path openclaw#196778,
jemalloc openclaw#195331, and retired allocation cleanup openclaw#197656 are not
prerequisites of this macOS capture bound; no PR-number follow-ups.
Validation: diff check passed; focused test setup lacks @solidjs/vite-plugin
in provided shared dependencies (lock differs), not a product verdict.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit f8f4d9f4c90a68c0e805b916918c4c1d35d23b0d)
(cherry picked from commit d77e84457d8a53075e55507c7053344a22fe08ff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: managed browser startup fails on large macOS process listings

1 participant