Skip to content

fix(browser): start Chromium with long Linux temp paths - #196778

Merged
vincentkoc merged 2 commits into
mainfrom
fix/browser-long-tmpdir
Nov 10, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/browser-long-tmpdir

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes managed Chromium aborting during startup when the Gateway inherits a long temporary-directory path on Linux.

User Impact

Managed browsers start without requiring operators to change the Gateway's TMPDIR. The Gateway environment, browser profile, and sandbox settings remain unchanged.

Why This Change Was Made

Chromium creates its process-singleton Unix socket under TMPDIR. The launch environment now falls back to /tmp only when the inherited path leaves insufficient space for Chromium's private temporary directory and socket name. Chromium still owns creation and cleanup of the private directory.

Evidence

  • Real Chromium through launchOpenClawChrome: before, SIGABRT with Socket path too long; after, CDP ready on an isolated profile/port with the same long Gateway TMPDIR. A later host fontconfig abort is separate; this is startup/readiness proof, not sustained browsing proof.
  • chrome.headless-launch.test.ts: 6 passed again on the final head; 105.85 seconds cold runner/compiler wall time.
  • Fresh autoreview (Claude fallback because the Codex CLI is absent): no P0–P2 findings on the final local patch against 47b0ce478c8141b52ec4631b4ddbe3d8b018ff21.
  • Formatting, git diff --check, scoped oxlint (2 files), and pnpm tsgo:extensions passed. The final head also passes lint:tmp:no-random-messaging after switching the length check to Chromium's actual inherited TMPDIR rather than Node's generic temp-directory fallback.
  • Production: +5/-0; tests: +4/-0. Four test-line credits cover the launch-boundary regression. The small production addition keeps temporary-path policy in the launch-environment owner; no new lifecycle state or cleanup path.
  • Hosted CI remains the broad gate. Blacksmith Testbox is unavailable on this host; no allocation was attempted.

@clawsweeper

clawsweeper Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: browser size: XS labels Nov 10, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 10, 2026 17:47
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR shortens Chromium’s inherited Linux temporary root when TMPDIR exceeds 50 bytes.

Example: Launch managed Chromium on Linux with TMPDIR=/tmp/gateway-gateway-gateway-gateway-gateway-gateway-gateway-gateway-gateway-gateway-.

  • Before: Chromium inherits the oversized root and can abort with “Socket path too long.”
  • After: Chromium receives TMPDIR=/tmp while the Gateway retains its original environment.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful patch with no actionable defects; inspectable validation is limited to source and mocked launch-boundary coverage.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports real Chromium through launchOpenClawChrome reaching CDP readiness with the long parent TMPDIR, but supplies no inspectable trace or shipped-CLI/Gateway run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Managed Chromium aborts during startup when the Gateway inherits an oversized Linux temporary-directory path.
Reason: This maintainer-authored repair addresses a concrete launch failure through the existing owner with no new user settings or competing implementation.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it addresses a current Chromium startup failure with a focused fix, and no actionable patch defects were found.

Priority: P2
Reviewed head: 15c17f5a6b850baecd6e7570bbb9a6ea6c588536

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported real-Chromium comparison has no inspectable output, and a red-on-base run of the added assertion is not supplied.
Agent review details

How this fits together

The browser plugin prepares a child environment from the Gateway environment, launches managed Chromium, and returns a browser handle after CDP readiness.

flowchart TD
A[Gateway environment] --> B[Chrome launch environment]
B --> C[Linux temporary root selection]
C --> D[Managed Chromium process]
D --> E[Private singleton socket]
D --> F[CDP readiness]
F --> G[Browser handle]
Loading

Technical review

Best possible solution:

Keep the byte-length fallback in the existing Chrome launch-environment owner and leave private-directory creation and cleanup to Chromium.

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

Current main passes oversized TMPDIR values into Chromium, whose inspected runtime creates and binds a filesystem singleton socket beneath that root; the body also reports a before/after reproduction, but no target code was executed during this review.

Is this the best way to solve the issue?

The patch is the smallest complete fix for the stated failure: it corrects the child environment at its existing owner without adding lifecycle state, changing the profile, or weakening sandbox settings.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6ee60ba1ebad.

Provenance checked

  • Managed Chromium child environment keeps the original intent (3df96df: Isolate managed Chromium from inherited allocator settings while preserving Gateway settings and unrelated child environment values.)
  • Managed headless launch regression suite keeps the original intent (03af810: Prove managed headless launch behavior while preserving profile ownership and explicit overrides.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 3df96df adds extensions/browser/src/browser/chrome.launch-env.ts:10 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3df96dfc805b; files: extensions/browser/src/browser/chrome.launch-env.ts)

PR surface

Source +5, Tests +4, Docs +6, Other +2. Total +17 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
Tests 1 4 0 +4
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 4 17 0 +17

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test LOC Production +5/-0; tests +4/-0 The growth is justified by one environment correction and assertions added to the existing launch-boundary suite.

Labels

Label changes:

  • add P2: Managed Chromium startup fails under a specific inherited Linux environment, with limited blast radius outside affected hosts.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Managed Chromium startup fails under a specific inherited Linux environment, with limited blast radius outside affected hosts.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Attach redacted output of the reported real-Chromium before/after launch comparison to strengthen behavioral confidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 10, 2026, 1:05 PM ET / 18:05 UTC.

@vincentkoc
vincentkoc merged commit afaaa8d into main Nov 10, 2026
116 checks passed
@vincentkoc
vincentkoc deleted the fix/browser-long-tmpdir branch November 10, 2026 18:12
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
)

* fix(browser): start Chromium with long Linux temp paths

* fix(browser): inspect the inherited Chromium temp root

Co-authored-by: Vincent Koc <[email protected]>
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)
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
)

(cherry picked from commit afaaa8d)

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 447ada38d11314ce396ba64c3e47454026f40e48)
(cherry picked from commit aee73b4603cbc18683525feb0fa7cacc31b46d12)
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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant