Skip browser cleanup when browser is disabled#88303
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 30, 2026, 4:15 PM ET / 20:15 UTC. Summary PR surface: Source +23, Tests +166. Total +189 across 9 files. Reproducibility: yes. Current main visibly calls browser cleanup from rollover and sessions.reset without checking disabled-browser config, and the PR body provides real copied-home evidence of the pre-fix stall path. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land a final head that treats explicit browser disable switches as authoritative for lifecycle cleanup while preserving enabled-browser cleanup and recording current-head proof and focused validation. Do we have a high-confidence way to reproduce the issue? Yes. Current main visibly calls browser cleanup from rollover and sessions.reset without checking disabled-browser config, and the PR body provides real copied-home evidence of the pre-fix stall path. Is this the best way to solve the issue? Yes, with a merge gate. Centralizing the config-aware lifecycle skip and making the facade activation-aware is the narrow maintainable shape, but the latest head still needs maintainer-accepted compatibility semantics and current-head proof. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against a2b2c4a76c79. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +23, Tests +166. Total +189 across 9 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
f7a3976 to
a4731e7
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
7936844 to
ca9a7a1
Compare
3371bdd to
6cef1cb
Compare
Avoid loading the browser maintenance surface during session reset when root browser support or the default browser plugin is explicitly disabled. This keeps non-browser runtimes from paying the browser facade cold-load cost while preserving cleanup for enabled/default browser configs. Tests cover auto-reply rollover and gateway sessions.reset for both root-disabled and plugin-entry-disabled browser configs. 🤖 Generated with Codex Co-Authored-By: Codex <[email protected]>
6cef1cb to
6852403
Compare
|
Behavior addressed: Browser lifecycle cleanup now skips browser session cleanup when either root browser support is disabled or the bundled browser plugin entry is disabled. The browser maintenance facade also checks plugin activation before using a cached browser surface. Real environment tested: Local macOS checkout plus GitHub Actions on head SHA 1a7e7f0. Exact steps or command run after this patch:
Evidence after fix: Local focused Vitest shards passed, local agents-core MCP runtime test passed, git diff check passed, build passed, and autoreview reported no accepted/actionable findings. GitHub Actions passed on final head: CI 26693713166, CodeQL 26693713159, CodeQL Critical Quality 26693713157, OpenGrep PR Diff 26693713125, Workflow Sanity 26693713149, Dependency Guard 26693712478, Real behavior proof 26693717405 / 26693858594. Observed result after fix: Disabled browser configs no longer load the browser cleanup surface during auto-reply session rollover or gateway session reset, while enabled/default configs still call cleanup. The resource-only MCP server test now waits for the asynchronous rejection log instead of racing the server write. What was not tested: No live browser tab was opened or closed manually; coverage is via unit/runtime tests and CI. |
…penclaw#91736, openclaw#88303) Honor top-level and profile cdpUrl for existing-session profiles, allow profile creation with cdpUrl, and skip browser lifecycle cleanup when browser is disabled. Co-authored-by: Cursor <[email protected]>
Summary
plugins.entries.browser.enabled=falsebehavior in both reset pathsReal behavior proof
Behavior addressed:
Disabled-browser OpenClaw homes were still paying the browser maintenance cold path during daily session rollover / reset. In our real bot runtime this showed up as the first turn of the day taking roughly 2 minutes even though
browser.enabled=falseand no browser plugin was configured.Real environment tested:
Local checkout of this PR head (
a4731e704a7f3bebce97f1406df94f0804aa4fd2) with Node/tsx, replaying copied and redacted real OpenClaw home data from two Kubernetes bot PVCs: one production bot PVC and one staging bot PVC. Both copied homes havebrowser.enabled=falseand no browser plugin entry.Exact steps or command run after this patch:
Ran the real
initSessionStaterollover path from the PR-head source against each copied OpenClaw home, restoring the previous reset transcript into place so the next message triggers the same daily rollover path.Evidence after fix:
Terminal output from the PR-head checkout using copied/redacted real OpenClaw homes:
Observed result after fix:
Both real copied homes completed the session rollover as new sessions with the expected previous session matched, the main session changed, and event-loop max delay stayed around 12ms. The disabled-browser path no longer loads browser cleanup and no longer reproduces the minute-plus first-turn stall. Before this change, the same investigation measured the browser cleanup stage alone at about 43.9s locally, and the live production/staging bot logs showed dispatch-to-turn gaps of about 112-122s during the daily rollover.
What was not tested:
I did not run a full packaged OpenClaw release build or a live browser-enabled cleanup session. This proof is scoped to the changed disabled-browser behavior using real copied OpenClaw home data, plus the focused regression tests listed below.
Proof limitations or environment constraints:
The PVC data and paths are redacted to avoid exposing private bot identifiers, user content, endpoints, or secrets. The copied configs were sanitized before local replay.
Before evidence:
During the original incident investigation, the copied production and staging homes both had
browser.enabled=false; the unpatched rollover still invokedcloseTrackedBrowserTabsForSessions, returned 0 closed tabs, and spent about 43.9s in the browser maintenance stage locally. Live bot logs around the same daily rollover showed event-loop stalls and first-turn dispatch-to-turn gaps of roughly 112-122s.Why
When browser support is disabled, session reset can still call the browser maintenance facade. That facade may cold-load the bundled browser surface even though there are no browser tabs to clean up, adding avoidable latency and memory pressure to non-browser runtimes.
Validation
node scripts/run-vitest.mjs src/auto-reply/reply/session.test.ts src/gateway/server.sessions.reset-cleanup.test.tsgit diff --check