Repository navigation
fix(browser): explain disabled control without restart loops - #154091
Conversation
Preserve plugin policy refusal reasons and recorded runtime failures in browser control diagnostics. Give the matching enablement or Doctor recovery instead of suggesting an unconditional Gateway restart. Related: #154066. Thanks @mmkerrigan for reporting the restart loop. The reported allowlist rewrite remains unidentified.
|
🦞👀 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: needs maintainer review before merge. Reviewed September 20, 2026, 6:38 PM ET / 22:38 UTC (Revision 2). ClawSweeper reviewWhat this changesBrowser control errors now explain recorded disablement causes and give matching recovery guidance instead of unconditional Gateway restart advice. Merge readiness✅ Ready for maintainer review Keep open: the diagnostic fix remains useful on current main, and the reviewed patch has no actionable correctness or security findings. The broader activation and configuration-rewrite report remains separate. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s browser plugin handles browser requests from agents, Gateway clients, node proxies, and the extension relay. When control cannot start, it translates existing plugin policy and runtime records into recovery guidance returned to callers. flowchart TD
A[Browser request] --> B[Browser control startup]
C[Existing plugin policy] --> B
B --> D{Control available?}
D -->|Yes| E[Browser operation]
D -->|No| F[Shared recovery message]
G[Recorded plugin failure] --> F
F --> H[Caller receives actionable error]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +45, Tests +141, Docs +6. Total +192 across 13 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep recovery guidance centralized in the browser owner while investigating activation and configuration persistence independently. Do we have a high-confidence way to reproduce the issue? Yes, from source: a refused local browser startup throws the generic disabled error on current main, and the client appends restart advice despite policy refusal. This review did not execute that path. Is this the best way to solve the issue? Yes. Reusing the existing policy resolver and sharing diagnostic formatting across callers is a focused repair that preserves enablement decisions and saved settings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 962908d074db. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…w#154091) Browser control failures could suggest restarting the Gateway when plugin policy still blocked browser control. Preserve the existing policy refusal reason and request-scoped runtime failure details in one browser-owned diagnostic, shared by local dispatch, Gateway requests, node proxies, and the extension relay. Give cause-specific recovery for allowlist exclusions, global/plugin/browser disablement, denylist refusal, and plugin failures. Unknown availability and generic local transport errors point to browser diagnostics or Doctor instead of an unconditional restart. This changes no enablement policy or stored configuration. Related: openclaw#154066. Thanks @mmkerrigan for reporting the restart loop. The reported allowlist rewrite remains unidentified and outside this diagnostic fix. Evidence: seven assertions failed on the original code; 188 focused browser tests passed across six files. Changed-file checks and the canary-proven extension-lint substitute passed; exact-head CI was green. Codex autoreview was scoped-clean and ClawSweeper found no actionable findings.
…#154255) Related: #154066 ## What Problem This Solves Gateway startup can activate the browser plugin in memory while preserving the authored configuration. Cold browser-control startup then incorrectly checks the authored allowlist again and reports the activated plugin disabled. This repairs that runtime/control mismatch. It does not claim to fix external rewriting or ordering of `plugins.allow`; the diagnostics from #154091 remain intact. ## User Impact A browser that the Gateway has activated can initialize its in-process control service and eager HTTP control server without requiring an extra source-allowlist edit. Effective plugin disablement, deny rules, disabled plugin entries, and a fresh `browser.enabled=false` still prevent cold startup. Browser options continue to use the existing source-backed refresh owner, and startup does not rewrite the authored allowlist. ## Why This Change Was Made Both existing cold-start owners now evaluate plugin enablement using the activated runtime config. Their browser-option resolver, authentication, shared control state, and shutdown owners are unchanged. No new configuration, dependency, schema, permission policy, or public SDK surface is introduced. ## Evidence - **Actual supported Gateway startup:** on main `894fb140a22246bc1574d5b29fe61e10f77036de`, both the registered `browser.request` path and eager HTTP startup reproduce the false allowlist refusal. The Gateway records browser auto-activation, the source allowlist remains unchanged, and explicitly allowlisting browser restores the baseline positive control. - **Candidate runtime:** the same real CLI/Gateway, authenticated WebSocket client, and HTTP routes pass **28 scenarios**. These cover both cold entrypoints, source-option refresh, all four disable/restart/recovery paths, unchanged authored config during reads/startup, and absent/bad HTTP-token rejection. Only the downstream CDP-discovery endpoint is synthetic and returns 503; no Chrome process is launched. - **Discriminating regressions:** six newly added assertions fail against the original startup owners; the fresh-source browser-disable preservation case passes. Four focused browser suites pass **86 tests**. After removing the fixture's retired color field, its 11 tests and scoped lint pass again; unchanged sibling results are retained. - **Source and checks:** baseline and candidate runtime builds pass; scoped type-aware lint, formatting, whitespace, and both structural ratchets pass. The prepared contributor-preserving branch has the exact same complete tracked tree as the runtime-tested candidate. - **Settlement:** the normal Gateway lifecycle closes owned servers and process groups without forced retirement. Source-helper compiler services are observed separately after their driver exits; all **256 observed child processes** are gone before synthetic state is removed. The Node fence admits no external request and records two blocked catalog-prewarm attempts separately. The baseline's explicit-allowlist rescue setup also exposed an eager hot-disable counterexample; that failed observation is retained, not presented as a passing baseline suite. The candidate's auto-activated configuration passes its complete live disable/restart/recovery sequence. Earlier fixture setup failures are also retained rather than counted as product failures or successful runs. Limits: this is real Gateway/control-startup and configuration-lifecycle proof on Node 24.21/macOS, not Chrome navigation, native-app, visual UI, Windows, packet-capture, or full update-migration proof. No live provider, paid model call, operator state, or operator Gateway was used. Hosted exact-head CI and final review remain required before landing. Co-authored-by: Ayaan Zaidi <[email protected]>
…openclaw#154255) Related: openclaw#154066 ## What Problem This Solves Gateway startup can activate the browser plugin in memory while preserving the authored configuration. Cold browser-control startup then incorrectly checks the authored allowlist again and reports the activated plugin disabled. This repairs that runtime/control mismatch. It does not claim to fix external rewriting or ordering of `plugins.allow`; the diagnostics from openclaw#154091 remain intact. ## User Impact A browser that the Gateway has activated can initialize its in-process control service and eager HTTP control server without requiring an extra source-allowlist edit. Effective plugin disablement, deny rules, disabled plugin entries, and a fresh `browser.enabled=false` still prevent cold startup. Browser options continue to use the existing source-backed refresh owner, and startup does not rewrite the authored allowlist. ## Why This Change Was Made Both existing cold-start owners now evaluate plugin enablement using the activated runtime config. Their browser-option resolver, authentication, shared control state, and shutdown owners are unchanged. No new configuration, dependency, schema, permission policy, or public SDK surface is introduced. ## Evidence - **Actual supported Gateway startup:** on main `2fa98f7d9f5d42651e301f1460652508571be217`, both the registered `browser.request` path and eager HTTP startup reproduce the false allowlist refusal. The Gateway records browser auto-activation, the source allowlist remains unchanged, and explicitly allowlisting browser restores the baseline positive control. - **Candidate runtime:** the same real CLI/Gateway, authenticated WebSocket client, and HTTP routes pass **28 scenarios**. These cover both cold entrypoints, source-option refresh, all four disable/restart/recovery paths, unchanged authored config during reads/startup, and absent/bad HTTP-token rejection. Only the downstream CDP-discovery endpoint is synthetic and returns 503; no Chrome process is launched. - **Discriminating regressions:** six newly added assertions fail against the original startup owners; the fresh-source browser-disable preservation case passes. Four focused browser suites pass **86 tests**. After removing the fixture's retired color field, its 11 tests and scoped lint pass again; unchanged sibling results are retained. - **Source and checks:** baseline and candidate runtime builds pass; scoped type-aware lint, formatting, whitespace, and both structural ratchets pass. The prepared contributor-preserving branch has the exact same complete tracked tree as the runtime-tested candidate. - **Settlement:** the normal Gateway lifecycle closes owned servers and process groups without forced retirement. Source-helper compiler services are observed separately after their driver exits; all **256 observed child processes** are gone before synthetic state is removed. The Node fence admits no external request and records two blocked catalog-prewarm attempts separately. The baseline's explicit-allowlist rescue setup also exposed an eager hot-disable counterexample; that failed observation is retained, not presented as a passing baseline suite. The candidate's auto-activated configuration passes its complete live disable/restart/recovery sequence. Earlier fixture setup failures are also retained rather than counted as product failures or successful runs. Limits: this is real Gateway/control-startup and configuration-lifecycle proof on Node 24.21/macOS, not Chrome navigation, native-app, visual UI, Windows, packet-capture, or full update-migration proof. No live provider, paid model call, operator state, or operator Gateway was used. Hosted exact-head CI and final review remain required before landing. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #154066. Thanks @mmkerrigan for the report.
What Problem This Solves
Browser control failures could tell operators to restart the Gateway even when plugin policy blocked the browser, sending them back into the same failure.
User Impact
Errors now identify the recorded allowlist exclusion, global/plugin/browser disablement, denylist refusal, or plugin failure and give the matching recovery step. An allowlist exclusion tells the operator to add
browserto the existing list before runningopenclaw plugins enable browser.Why This Change Was Made
The browser owner retains the existing enablement resolver's reason and uses request-scoped plugin records for failure details. Local dispatch, Gateway requests, node proxies, and the extension relay share the diagnostic. Unknown availability points to Doctor; a missing registry record does not establish that a plugin is uninstalled or awaiting restart. Generic local transport errors now suggest browser diagnostics instead of an unconditional Gateway restart.
The reported allowlist rewrite remains an unidentified possible external writer; this PR addresses the misleading recovery text.
Evidence
node scripts/run-vitest.mjs ... --maxWorkers=1), 53.29 s wall / 48.96 s Vitest duration. The final run covers the real local client/dispatch boundary plus Gateway, node proxy, and service siblings. The 11-case availability file separately passed in 91.89 s wall / 77.10 s Vitest duration on a cold transform cache; test bodies totaled 651 ms.node scripts/check-changed.mjs: all reached gates passed except the documented nested-checkout extension-lint host artifact (Declaration input escapes checkoutvia ancestornode_modules). Both extension typechecks passed. The approved substitute,node_modules/.bin/oxlint --tsconfig test/tsconfig/tsconfig.extensions.test.json <changed extension files>, passed with exit 0 after a deliberatevarcanary failed witheslint(no-var)/eslint(no-unused-vars)and exit 1; the exact original source bytes were restored. All four post-lint guards also passed when run separately: database-first legacy stores, media download helpers, runtime sidecar loaders, and import cycles.plugins.allow,plugins.deny, and entries; enabling browser survived restart with byte-identical saved config. This diagnostic change adds no config writes or migration.Review disposition
ClawSweeper reviewed head
bd1e037a46c3b4b949f3704d025e2fa04dba1292at 2026-09-20 21:53 UTC and reported no actionable findings and no before-merge requirements. There are no Rank-up moves to apply or skip. The separate activation/config-rewrite report remains outside this diagnostic fix.