Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17cfdce89f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!proc?.killed && (code !== 0 || exitSignal)) { | ||
| log.error( | ||
| `Managed Chrome for profile "${profile.name}" exited (code ${code}, signal ${exitSignal}). Check the browser executable and browser.extraArgs before retrying.${stderrDiagnostics.hint()}`, |
There was a problem hiding this comment.
Preserve raw crash diagnostics in local logs
When Chrome stderr matches a default or operator-configured redaction pattern, stderrDiagnostics.hint() masks it before passing it to the logger, so the local file permanently loses the original diagnostic. The new startup-failure log has the same issue because it logs the already-redacted tool error. Root AGENTS.md explicitly requires raw local logs with redaction only at egress. Keep a bounded raw representation for logging and redact the browser-tool error separately; the logging transport already handles console redaction.
AGENTS.md reference: AGENTS.md:L61-L61
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR retains managed Chrome crash diagnostics through CDP readiness and logs abnormal exits after startup. Example: Managed Chrome exposes discovery on port 18800, then exits with SIGABRT during the WebSocket handshake.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain This PR addresses a real diagnostic failure and has maintainer-approved direction, but three focused repairs are needed before merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe browser plugin launches managed Chrome for browser-tool requests, verifies CDP command readiness and process ownership, and returns an adopted browser handle or a diagnostic error. flowchart LR
A[Browser tool] --> B[Profile availability]
B --> C[Chrome launch owner]
C --> D[Managed Chrome child]
C --> E[HTTP and CDP readiness]
B --> F[Exact PID verification]
D --> G[Bounded stderr diagnostics]
G --> H[Tool errors and local logs]
Technical reviewBest possible solution: Keep readiness and crash diagnostics with the launch owner, route late discovery through its full readiness budget, preserve raw local logs, and update affected consumer fixtures. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that HTTP discovery can announce startup and release stderr before command readiness; the PR describes a matching isolated-child reproduction, but no target code was executed during this read-only review. Is this the best way to solve the issue? Consolidating readiness under the child-owning launch operation is the smallest complete fix, provided late discovery receives the existing readiness allowance and logging keeps raw and tool-safe representations separate. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2aba6707c06a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +11, Tests +70, Docs +13, Other +2. Total +96 across 9 files. Added test files: 0. View PR surface stats
Preflight sourceSource 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
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 8, 2026, 1:08 PM ET / 18:08 UTC. |
|
Wait for CDP command readiness before announcing managed browser startup, preserving child exit status and bounded stderr for tool errors and logs. Keep abnormal-exit diagnostics after readiness while retaining exact-PID adoption checks.
d70082c to
e7c7e38
Compare
|
Landing note: ClawSweeper's three items (reviewed on an earlier head) are addressed at 9aaec16: (1) late HTTP discovery now goes through the same command-readiness loop within localCdpReadyTimeoutMs instead of a single 800 ms WebSocket allowance; (2) local logs keep bounded raw diagnostic text, and redaction applies only to the browser-tool error and other egress; (3) the headless-cleanup fixtures return a ready diagnostic for the newly spawned child while preserving the pre-spawn stale-listener failure (browser consumer suite 3,150 passed). Root cause on Team: the Gateway's MALLOC_CONF (jemalloc background_thread) inherited by Chromium broke the zygote's single-threaded fork. Reproduced live and fixed by scrubbing inherited jemalloc settings from the Chromium and container launch environments. Exact-head CI green. |
…5331) * fix(browser): report managed Chrome startup crashes Wait for CDP command readiness before announcing managed browser startup, preserving child exit status and bounded stderr for tool errors and logs. Keep abnormal-exit diagnostics after readiness while retaining exact-PID adoption checks. * fix(process): isolate external tools from Gateway jemalloc * fix(browser): preserve late readiness and raw launch logs * style(browser): satisfy launch readiness lint rules
…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)
What Problem This Solves
A Gateway started with jemalloc can crash every managed Chromium launch: inherited
LD_PRELOAD=libjemalloc.so.2plusMALLOC_CONF=background_thread:true,...makes Chromium's zygote initialization fail, followed byGPU process launch failed: error_code=1002andGPU process isn't usable. Goodbye.The browser aborts with SIGABRT. Allocator-free and preload-only controls work.The browser could also log “started” after HTTP discovery but before CDP commands worked, then discard the useful stderr. Agents received a generic timeout instead of the launch failure.
User Impact
Managed Chrome now removes
MALLOC_CONFand only jemalloc entries fromLD_PRELOADin its child environment. Space/colon-separated unrelated preloads stay intact, and the Gateway's allocator is unchanged. The same shared policy covers the three Docker/Podman host launch paths, including persistent attach; explicit environment settings inside containers are unchanged.The launch owner confirms CDP command readiness before logging success, reports early exit signals plus bounded redacted FATAL diagnostics and recovery guidance, and logs later abnormal exits. Local subsystem logs retain bounded raw stderr; tool errors are redacted at egress. FATAL lines take priority over the stack dumps that follow them. Exact-PID ownership verification remains with adoption.
Why This Change Was Made
This fixes the environment leak at the launch owners. Chromium flags, GPU policy, sandbox policy, and Gateway allocator configuration stay unchanged. Chromium 153's zygote checks for a single-threaded process before its sandbox/fork setup; jemalloc reads configuration at initialization and can create background threads. The earlier SwiftShader hypothesis was disproven by the allocator-free controls.
Other child boundaries were audited: agent host exec already blocks
LD_*; Signal uses an environment allowlist; Codex app-server excludes loader injection variables. The Node spawn-broker worker and general command environment API retain their existing contracts; no crash was established there. Docker/Podman required all three host launch paths to change together.Evidence
Real browser-tool calls (
createBrowserTool().execute) start the browser, navigate to a local synthetic page, and capture a screenshot. Linux uses the exact Playwright chromium-1243 / Chrome for Testing 153.0.8010.12, Ubuntu's jemalloc 5.3.0, and the reported headless/no-sandbox/disable-gpu/disable-gpu-compositing/use-angle=swiftshader/ozone-platform=headless flags.background_thread:true,dirty_decay_ms:1000,muzzy_decay_ms:1000error_code=1002and GPU FATAL captured; FATAL survives in tool errors, returned in 1,854 / 1,710 msThe repeat comparison uses the exact prior launch-owner file from
17cfdce89f8cb69d2985c68803f85146a8c1dee5(SHA-2566670612cd45ff119b3e06152fc7b25031b5a61797fb8c3a33944f530de480561) while retaining the improved stderr formatter to validate real fatal diagnostics. The first comparison ran the prior PR production source unchanged. Testbox proof run: immediate allocation, 2 CPUs / 7.7 GiB RAM; lease stopped after artifact retrieval. No production access or data. Signed macOS Chrome 157.0.8103.38 also passed start/navigation/screenshot using a fresh profile, with the allocator variables present on the parent.The earlier diagnostic fault-injection A/A comparison against base
da3cea2ce4a280ac6acc89b62693a19c6534f68dremains valid: failure latency 30,596 / 30,567 → 1,272 / 1,252 ms; Gateway CPU 1.517 / 1.444 → 0.308 / 0.300 seconds; sampled allocations 225.57 / 225.68 → 109.42 / 108.95 MB. This isolates reporting latency; successful navigation and screenshot workloads are not comparable to an aborted startup. These launch owners do not scan session databases or workspace inventories, so no database-scale performance claim is made.Review repairs
Rebased on
e3a09aaba1f45ec3ff2eb4a0db4728286f53068dand addressed all three reported issues:localCdpReadyTimeoutMscommand-readiness loop. The new fake-clock regression waits more than one second for the command channel and succeeds. The existing never-ready test advances its clock through this restored retry path and still proves rejection and exact-child cleanup.The late-readiness and two logging regressions produced 3 failures before the repairs and pass afterward. Focused launch suites: 59 passed / one Linux-only skip in 38.41 seconds wall time. The final simplified never-ready fixture also passes its targeted rerun (29.91 seconds including compilation; 1.31 seconds test execution). No new real-time sleeps were added. The cleanup fixture's four failures were reproduced before repair (42 passed / 4 failed).
Validation
Complete browser consumer suite (
node scripts/run-vitest.mjs extensions/browser --maxWorkers=1): 3,150 passed / 117 skipped, 257 files passed / 18 skipped, across both browser and database-worker consumer shards; 307.97 seconds wall time. Core, core-test, extension and extension-test typechecks pass. Formatting, line-cap guards, diff whitespace and test-line budget pass.pnpm check:changedcompleted. Its two introduced extension-lint errors (implicit boolean coercion and a Promise executor return) were corrected; targeted lint then passed and all 16 launch regressions passed again (48.94 seconds including compilation). The complete consumer run preceded only these behavior-preserving lint corrections. A fresh Codex review of the corrections is also scoped-clean. All other checks passed except the inherited gates below. Ready PR head:9aaec16991f3af162a257dc01baac83654bdd10f. Exact-head CI is running;openclaw/ci-gatewas pending after the force-push. The PR remains unmerged.Prior-revision live Linux and signed macOS launch proof above is retained evidence for the unchanged allocator scrub and Chromium flags; it was not rerun for these readiness/logging repairs. The prior full build and 66-pass container boundary suite remain prior-revision evidence. Current candidate Codex autoreview through P2 is scoped-clean.
Narrow reruns on exact rebased main parent
e3a09aaba1f45ec3ff2eb4a0db4728286f53068dreproduce:OpenClawIdNodeRemovedError, introduced by #193982,21c02885fb1a51903d4c6f7f9b3893895b2c2f31; and newly exercised production-onlyNodeDialogContent, introduced by #194007,e43e623ba068405c44637adee9a51d5c75903df9. The latter has same-file production use and test-only external consumers; this is an additional main regression requiring follow-up.266a7aa0fe69e2b5fe6445c4ceb1e15b5360c957.1595dd24770799485a9631c757ccfb7740c12be2, introduced all three failures (its immediate parent passes); #191344 and #177231 explain the remaining additions. This PR's process-runtime helper is local-only and does not change the public totals.These are main regressions for follow-up. No UI-imported module changes. No new config, cache, database schema, or browser flags. Whole-PR production delta +38 lines; tests +148, covered by a scoped allocation. This revision removes nine production lines by combining late discovery with the existing readiness path and flattening failure handling. Remaining growth owns shared child allocator isolation and bounded crash diagnostics.