Skip to content

improve(browser): default managed Chromium to efficient headless launches - #154607

Merged
vincentkoc merged 14 commits into
mainfrom
feat/browser-07-chromium-efficiency
Oct 15, 2026
Merged

vincentkoc merged 14 commits into
mainfrom
feat/browser-07-chromium-efficiency

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Related: #154341. Browser stack 7/8; follows #154508.

What Problem This Solves

Managed Chromium should start headlessly without silently switching established profiles to headless shell or missing a correctly installed full browser.

User Impact

Managed Chromium defaults to headless while preserving explicit headed overrides, externally owned workflows and existing profile ownership. Automatic Playwright-cache discovery uses full Chromium only, including native Apple-silicon installs when Node runs under Rosetta.

Explicit headless-shell paths remain a separate-profile choice on Linux/macOS; headed shell and managed Windows shell stay unsupported. Native Windows continuity is a separate final-stack proof obligation, not claimed by these unit tests.

Why This Change Was Made

  • Preserve request, environment, profile and configuration precedence, plus attach-only, remote and existing-session ownership.
  • Respect Playwright's npm-config aliases, hermetic cache and relative-install paths without loading its runtime or downloading a browser.
  • Seed fresh headless profiles once and retain process, listener and profile identity through serialized cleanup.
  • Use the public SDK owners for logging, security, temporary paths and text utilities; keep process ownership separate from browser discovery.
  • Regenerate configuration documentation from the integrated generator inputs.

Evidence

Independently reviewed signed candidate: 912203312877f1d3622097eb3b9345b1751d2f21, tree 69d0c2c12ccd043762b7974dee7c0a6570478580. This integrates the reviewed correction with fixed baseline fe60f48f1715b148c34618a678b8e499d9ed4c41. Fresh review of the installed successor found no remaining findings; the SDK-boundary and generated-configuration findings are resolved. Required GitHub CI/security checks and enforced reviews remain separate landing gates.

Focused proof Result and attribution
Two affected Browser suites 90 tests passed in 34.52 s on parent 7512696385ff2c975e0eed2971f5545a5f10d5ba; boundary declarations, Browser typecheck and 26-file type-aware lint also passed in that run.
Seven other test files Passing evidence is retained from a separate earlier run, not attributed to the 90-test run.
Integrated configuration documentation Canonical generation/check passed on the exact cf978e36 tree snapshot with frozen integrated inputs. Nine tests in three affected files, targeted help-source lint/format and whitespace checks also passed. This is new integrated-input proof, not reuse of the older generator run.
Native lock provider The unchanged file-lock suite passed 16/16 once on the exact cf978e36 snapshot with Node 26.7.0 and fs-safe 0.26.5, required-native mode, no skips or retries. Its original scoped fault-injection exception is unchanged.
Architecture-specific cache fixtures Two missing architecture pins reproduced two failing cases. The four-line fixture-only correction passed the full affected file (28/28), targeted lint and formatting in a retained Node 26.7.0 projection. Production behavior is unchanged. This is local scoped proof, not Node 24 CI.
Formatting The original 90-test/static run remained FORMAT-FAILED overall. A subsequent scoped formatter check passed on 31 supported files in 394 ms, and diff checking passed.

The 30 non-resolution product blobs match the previously reviewed correction bdd62126a06686877ebe712199374dbe6cc7c817; the integrated changes regenerate the configuration digest and preserve the reviewed browser help wording. Earlier cache-test formatting reuse rests on syntax/behavior equivalence, not unchanged test-blob identity. The snapshot proofs above are tree-bound; they are not fresh execution of every suite or CI on signed commit 91220331. Prior-head failures are not relabeled green. CI run 38692362541 remains failed: global UI formatting, two UI lint errors, and two architecture-specific browser fixtures. Only the browser fixtures are corrected here; the unrelated UI files are unchanged. Current-head CI run 38697328760 completed successfully with all 70 jobs complete and no failures. Required native gates qualified this exact head before landing.

Earlier Linux/macOS profile-continuity and launch-performance receipts remain historical evidence on their original sources. No native Windows preservation or published-updater execution is claimed here.

Earlier targeted evidence, retained at its original source

Static and original-defect phases and final suites/hash verification used the earlier frozen dependency set. The cache suite passed 22 tests in 32.565 s; cleanup passed 46 tests in 26.178 s. Both workflow aggregates were completed/cancelled, not overall green; their proof phases and later successful native lease-stop continuations do not establish current-head CI.

@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: browser size: XL maintainer Maintainer-authored PR labels Sep 21, 2026
@vincentkoc
vincentkoc force-pushed the feat/browser-06-engine-plugins branch from 74f3df4 to 60fb947 Compare September 21, 2026 10:08
@vincentkoc
vincentkoc force-pushed the feat/browser-07-chromium-efficiency branch from c18bc0a to 89730fc Compare September 21, 2026 10:08
@vincentkoc
vincentkoc marked this pull request as ready for review September 21, 2026 10:09
@vincentkoc
vincentkoc force-pushed the feat/browser-06-engine-plugins branch from 60fb947 to 4968ca6 Compare September 21, 2026 10:54
@vincentkoc
vincentkoc force-pushed the feat/browser-07-chromium-efficiency branch from 89730fc to 4428666 Compare September 21, 2026 10:54
@vincentkoc
vincentkoc force-pushed the feat/browser-06-engine-plugins branch from 4968ca6 to 8dde9d3 Compare September 21, 2026 11:02
@vincentkoc
vincentkoc force-pushed the feat/browser-07-chromium-efficiency branch 2 times, most recently from c0baa35 to 3c64630 Compare September 21, 2026 11:23
@vincentkoc vincentkoc self-assigned this Sep 21, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 27, 2026, 2:59 AM ET / 06:59 UTC (Revision 13).

ClawSweeper review

What this changes

The Browser plugin makes managed Chromium headless by default, discovers full Chromium in Playwright caches, changes managed-profile launch and cleanup, and updates Doctor, documentation, and tests.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 12 items remain

Keep open. Current main does not provide the requested headless default, and this maintainer-associated PR has two source-backed merge blockers.

Priority: P2
Reviewed head: 3989db378d16dae6de2759037273d85ac31c5dc2
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Substantial real browser proof supports the useful change, while the default-mode regression and unproven process authority limit merge confidence.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the retained packaged Linux and native macOS runs show managed launch and profile continuity, but no allowed-versus-separately-launched shell trace shows rejection before Browser.close or SIGTERM. Add redacted final-effect evidence for that case and update the PR body for a fresh review; a maintainer can request @clawsweeper re-review if it does not trigger. No stored-data format change is identified, although Windows profile continuity remains an upgrade-proof gap.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the retained packaged Linux and native macOS runs show managed launch and profile continuity, but no allowed-versus-separately-launched shell trace shows rejection before Browser.close or SIGTERM. Add redacted final-effect evidence for that case and update the PR body for a fresh review; a maintainer can request @clawsweeper re-review if it does not trigger. No stored-data format change is identified, although Windows profile continuity remains an upgrade-proof gap.
Evidence reviewed 10 items Introduced default: The PR changes an omitted browser.headless setting from false to true for local managed profiles.
Current-main behavior: Fetched main still resolves an omitted headless setting as false, with a separate Linux no-display fallback. The PR's central default change is therefore still distinct.
Established manual-login flow: Current-main guidance tells users to open the managed profile and sign in through its visible browser. The PR's replacement instructions require stopping it and editing configuration to recover a window.
Findings 2 actionable findings [P1] Preserve visible launches for established managed profiles
[P2] Require launch ownership before stopping a lockless shell
Security Needs attention Process termination lacks launch provenance: A matching shell PID, listener, command line, and profile path establish process identity but not authority to terminate a separately launched browser; stop and stale recovery can reach Browser.close or SIGTERM.

How this fits together

The Browser plugin turns browser configuration and profile selection into a local Chromium launch or an attachment to an external browser. Its status, Doctor, and cleanup paths report or manage the resulting browser process.

flowchart LR
  A[Browser configuration] --> B[Selected profile]
  B --> C{Local managed browser?}
  C -->|Yes| D[Choose launch mode and Chromium]
  C -->|No| E[Attach to external browser]
  D --> F[Browser process and profile]
  F --> G[Browser actions and status]
  F --> H[Stop and cleanup]
Loading

Decision needed

Question Recommendation
Should an established managed desktop profile with no headless setting remain visible after this upgrade, while fresh profiles default to headless? Preserve established profiles: Keep the prior visible mode for existing profiles and apply the new headless default only to fresh profiles.

Why: The proposed default changes an established manual-login workflow, and source plus prior review do not show explicit acceptance of that upgrade tradeoff.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the retained packaged Linux and native macOS runs show managed launch and profile continuity, but no allowed-versus-separately-launched shell trace shows rejection before Browser.close or SIGTERM. Add redacted final-effect evidence for that case and update the PR body for a fresh review; a maintainer can request @clawsweeper re-review if it does not trigger. No stored-data format change is identified, although Windows profile continuity remains an upgrade-proof gap.
  • Preserve visible launches for established managed profiles (P1) - With browser.headless omitted, an existing desktop openclaw profile now launches with --headless=new. The established manual-login flow needs a visible window, and recovering it requires stopping the browser and editing config. Preserve the prior mode for established profiles or obtain explicit acceptance with in-product recovery.
  • Require launch ownership before stopping a lockless shell (P2) - A separately launched shell using the managed profile directory and CDP port passes this new listener-selection path, although OpenClaw did not spawn it; stop or stale recovery can then send Browser.close or SIGTERM. This is a late discovery on the unchanged reviewed head. Bind cleanup to a trustworthy launch owner or fail closed when provenance is absent, and cover the matching-but-unowned final effect.
  • Resolve security concern: Process termination lacks launch provenance - A matching shell PID, listener, command line, and profile path establish process identity but not authority to terminate a separately launched browser; stop and stale recovery can reach Browser.close or SIGTERM.
  • Resolve merge risk (P1) - An existing desktop managed profile with no explicit headless setting will reopen without a visible login window; the documented recovery requires stopping it and editing configuration.
  • Resolve merge risk (P1) - The new lockless-shell recovery path can close or signal a separately launched shell that uses the same profile directory and CDP port, because those identifiers do not establish OpenClaw launch ownership.
  • Resolve merge risk (P1) - Native Windows continuity of an established encrypted browser profile remains unobserved despite the cross-platform default change.
  • Resolve merge risk (P1) - The PR changes Doctor and managed-browser lifecycle behavior without a documented published-updater-to-candidate upgrade check.
  • Complete next step (P2) - Resolve the established-profile default, prevent unowned shell termination, then supply final-effect and Windows/update-path proof before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P1] Preserve visible launches for established managed profiles — extensions/browser/src/browser/config.ts:357-358
  • [P2] Require launch ownership before stopping a lockless shell — extensions/browser/src/browser/chrome.ts:245-258
  • [medium] Process termination lacks launch provenance — extensions/browser/src/browser/chrome.ts:249
Agent review details

Security

Needs attention: The new lockless-shell cleanup can act on a matching process without proving OpenClaw launched it.

PR surface

Source +366, Tests +1057, Docs +43, Generated 0. Total +1466 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 15 790 424 +366
Tests 12 1094 37 +1057
Docs 5 58 15 +43
Config 0 0 0 0
Generated 1 2 2 0
Other 0 0 0 0
Total 33 1944 478 +1466

Review metrics

Metric Value Why it matters
Managed launch default 1 default changed: omitted headless becomes true An omitted setting is common in existing desktop profiles and changes their visible behavior on upgrade.
Production and test LOC production +813/-424, tests +1071/-37 The production growth supports cache discovery and lifecycle ownership work, but its new ownership boundary needs stronger proof.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/browser/src/browser/doctor.ts, unknown-data-model-change: extensions/browser/src/doctor-browser.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Repair launch and ownership boundaries (recommended)
    Preserve the established-profile mode and require trustworthy launch ownership before closing or signaling a lockless shell.
  2. Accept the default deliberately
    A browser owner may approve the existing-profile change with visible recovery, while the shell ownership defect still needs repair and final-effect proof.
  3. Pause the default change
    Retain explicit headless opt-in if upgrade continuity and ownership cannot be established for this branch.

Technical review

Best possible solution:

Keep established managed profiles visible unless their owner explicitly selected headless mode, use headless launches for fresh profiles, and require live launch provenance before cross-runtime shell termination; verify Windows profile continuity and the published update path.

Do we have a high-confidence way to reproduce the issue?

Yes at the source level: start an existing desktop managed profile with headless omitted and it resolves to headless; a separate shell using the exact managed directory and port also satisfies the new stop path's ownership checks. This read-only review did not execute either scenario.

Is this the best way to solve the issue?

No. The fresh-profile launch improvement is useful, but unconditional upgrade behavior and lockless process ownership need narrower boundaries.

Full review comments:

  • [P1] Preserve visible launches for established managed profiles — extensions/browser/src/browser/config.ts:357-358
    With browser.headless omitted, an existing desktop openclaw profile now launches with --headless=new. The established manual-login flow needs a visible window, and recovering it requires stopping the browser and editing config. Preserve the prior mode for established profiles or obtain explicit acceptance with in-product recovery.
    Confidence: 0.97
  • [P2] Require launch ownership before stopping a lockless shell — extensions/browser/src/browser/chrome.ts:245-258
    A separately launched shell using the managed profile directory and CDP port passes this new listener-selection path, although OpenClaw did not spawn it; stop or stale recovery can then send Browser.close or SIGTERM. This is a late discovery on the unchanged reviewed head. Bind cleanup to a trustworthy launch owner or fail closed when provenance is absent, and cover the matching-but-unowned final effect.
    Confidence: 0.89
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cd481e80875d.

Labels

Label changes:

  • add merge-risk: 🚨 security-boundary: Lockless shell cleanup can infer authority to close or signal a process from matching local identifiers without launch provenance.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the retained packaged Linux and native macOS runs show managed launch and profile continuity, but no allowed-versus-separately-launched shell trace shows rejection before Browser.close or SIGTERM. Add redacted final-effect evidence for that case and update the PR body for a fresh review; a maintainer can request @clawsweeper re-review if it does not trigger. No stored-data format change is identified, although Windows profile continuity remains an upgrade-proof gap.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a useful browser improvement with bounded scope, but its upgrade and process-ownership blockers prevent landing.
  • merge-risk: 🚨 compatibility: The omitted headless setting changes existing desktop users' launch behavior.
  • merge-risk: 🚨 session-state: The changed launch mode reuses persistent browser profiles, while native Windows saved-profile continuity remains unobserved.
  • merge-risk: 🚨 security-boundary: Lockless shell cleanup can infer authority to close or signal a process from matching local identifiers without launch provenance.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the retained packaged Linux and native macOS runs show managed launch and profile continuity, but no allowed-versus-separately-launched shell trace shows rejection before Browser.close or SIGTERM. Add redacted final-effect evidence for that case and update the PR body for a fresh review; a maintainer can request @clawsweeper re-review if it does not trigger. No stored-data format change is identified, although Windows profile continuity remains an upgrade-proof gap.

Evidence

Security concerns:

  • [medium] Process termination lacks launch provenance — extensions/browser/src/browser/chrome.ts:249
    A matching shell PID, listener, command line, and profile path establish process identity but not authority to terminate a separately launched browser; stop and stale recovery can reach Browser.close or SIGTERM.
    Confidence: 0.87

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve the established-profile launch-mode decision and show the chosen upgrade behavior.
  • Add final-effect proof for a separately launched shell using the same profile and port, including rejection before close or signal.
  • Show native Windows saved-profile continuity and a published-updater-to-candidate Doctor/lifecycle check.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-23T15:20:50.131Z sha 462fb00e7ed395ac0bc276e53c25a450895ac145 :: blocked before merge. :: none
  • reviewed 2026-09-23T15:56:10.467Z sha 2f5c318 :: blocked before merge. :: none
  • reviewed 2026-09-23T16:05:13.064Z sha 2f5c318 :: blocked before merge. :: none
  • reviewed 2026-09-23T16:51:19.571Z sha 0b3b010 :: blocked before merge. :: none
  • reviewed 2026-09-23T18:22:05.289Z sha b6cda11 :: blocked before merge. :: none
  • reviewed 2026-09-23T18:52:14.662Z sha d6b89a5 :: blocked before merge. :: [P1] Preserve visible launches for existing managed profiles
  • reviewed 2026-09-23T21:21:19.570Z sha 3989db3 :: blocked before merge. :: [P1] Preserve visible launches for existing managed profiles
  • reviewed 2026-09-26T12:51:05.009Z sha 3989db3 :: blocked before merge. :: [P1] Preserve visible launches for existing managed profiles

@vincentkoc
vincentkoc force-pushed the feat/browser-06-engine-plugins branch from 8dde9d3 to e195e10 Compare September 22, 2026 05:21
@vincentkoc
vincentkoc force-pushed the feat/browser-07-chromium-efficiency branch from 3c64630 to 2247bee Compare September 22, 2026 05:21
Baseline-Refresh: cfeb04380368e1f3bf8b3d356edc35bdc4520869
Preserve Playwright cache aliases, hermetic installs, relative paths and native
Apple-silicon selection under Rosetta. Complete the merged lifecycle cleanup
and headless-source type cutover with focused frozen-dependency proof.
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call labels Oct 15, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: browser extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant