Skip to content

fix(browser): explain disabled control without restart loops - #154091

Merged
steipete merged 1 commit into
mainfrom
upd/plugins-allow-regeneration
Sep 20, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/plugins-allow-regeneration

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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 browser to the existing list before running openclaw 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

  • Seven new assertions failed on the original code for missing recovery guidance or incorrect restart advice.
  • Focused browser tests: 188 passed across six files (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 checkout via ancestor node_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 deliberate var canary failed with eslint(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.
  • P1 Codex autoreview: scoped-clean, no accepted/actionable findings.
  • Earlier isolated start/stop/start proof preserved plugins.allow, plugins.deny, and entries; enabling browser survived restart with byte-identical saved config. This diagnostic change adds no config writes or migration.
  • Production: +58/-13 (net +45); tests and test support: +158/-17 (net +141); docs: +6. Growth supplies one shared cause-to-recovery formatter across existing refusal paths; no new availability state, options, schema, dependencies, or SDK exports.

Review disposition

ClawSweeper reviewed head bd1e037a46c3b4b949f3704d025e2fa04dba1292 at 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.

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.
@clawsweeper

clawsweeper Bot commented Sep 20, 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 extensions: browser size: M maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 21:24
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 6:38 PM ET / 22:38 UTC (Revision 2).

ClawSweeper review

What this changes

Browser 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
Reviewed head: bd1e037a46c3b4b949f3704d025e2fa04dba1292

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable diagnostic repair with meaningful regression coverage and no identified merge-blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this verified maintainer-authored PR, and no material authority change triggers an exception. Supplied tests cover the changed diagnostic boundary; the earlier restart/config-preservation report does not itself demonstrate the new messages.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this verified maintainer-authored PR, and no material authority change triggers an exception. Supplied tests cover the changed diagnostic boundary; the earlier restart/config-preservation report does not itself demonstrate the new messages.
Evidence reviewed 9 items Reviewed introduction: Reviewed the complete pinned merge-base-to-head diff. The changes are confined to browser diagnostics, their callers, regression coverage, and setup documentation; endpoint drift was not attributed to this PR.
Existing policy owner preserved: The formatter retains the existing enablement resolver’s reason and reads request-scoped plugin records only for diagnostics. Service and server startup still consume the same enabled result; the patch adds no configuration writes, migrations, public SDK exports, or authorization changes.
Client error propagation: Local startup refusal now returns a 503 error payload. The existing client converts it into BrowserServiceError, preserving cause-specific guidance and the persistent-failure no-retry hint without appending generic transport recovery advice.
Findings None None.
Security None None.

How this fits together

OpenClaw’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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +45, Tests +141, Docs +6. Total +192 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 8 58 13 +45
Tests 4 158 17 +141
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 222 30 +192

Review metrics

Metric Value Why it matters
Growth by purpose Production net +45 lines; tests net +141 lines Production growth supplies one shared recovery formatter used across four refusal paths, with boundary-level regression coverage.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This bounded diagnostic fix helps operators recover from disabled browser control without repeated ineffective restarts.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this verified maintainer-authored PR, and no material authority change triggers an exception. Supplied tests cover the changed diagnostic boundary; the earlier restart/config-preservation report does not itself demonstrate the new messages.

Evidence

What I checked:

  • Reviewed introduction: Reviewed the complete pinned merge-base-to-head diff. The changes are confined to browser diagnostics, their callers, regression coverage, and setup documentation; endpoint drift was not attributed to this PR. (bd1e037a46c3)
  • Existing policy owner preserved: The formatter retains the existing enablement resolver’s reason and reads request-scoped plugin records only for diagnostics. Service and server startup still consume the same enabled result; the patch adds no configuration writes, migrations, public SDK exports, or authorization changes. (extensions/browser/src/plugin-enabled.ts:20, bd1e037a46c3)
  • Client error propagation: Local startup refusal now returns a 503 error payload. The existing client converts it into BrowserServiceError, preserving cause-specific guidance and the persistent-failure no-retry hint without appending generic transport recovery advice. (extensions/browser/src/browser/local-dispatch.runtime.ts:24, bd1e037a46c3)
  • Current main still needs the fix: Fetched main retains the bare browser-control-disabled exception and unconditional local Gateway restart advice. Comparing the central diagnostic files between the pinned merge base and fetched main showed no intervening change. (extensions/browser/src/browser/client-fetch.ts:198, 962908d074db)
  • Latest release still contains restart advice: The latest release endpoint identifies v2026.9.5. Reading its supplied release commit through the GitHub contents API confirms that the local transport hint still recommends restarting the Gateway. (extensions/browser/src/browser/client-fetch.ts:195, ec9c1a13db89)
  • Regression coverage and supplied validation: The new 11-case availability suite exercises the real client/local-dispatch error boundary with mocked startup and registry inputs, including source-versus-runtime policy and recorded failures. The captured PR body reports seven pre-fix assertion failures and 188 passing tests across six files, with measured durations and a documented substitute for the extension-lint host artifact. These are contributor-reported executions; this read-only review ran no tests. The read-only diff whitespace check passed. (extensions/browser/src/browser/client-fetch.unavailable.test.ts:59, bd1e037a46c3)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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 (1 earlier review cycle)
  • reviewed September 20, 2026, 5:53 PM ET / 21:53 UTC sha unknown :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 1dc0b5d into main Sep 20, 2026
166 checks passed
@steipete
steipete deleted the upd/plugins-allow-regeneration branch September 20, 2026 23:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
…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.
obviyus added a commit that referenced this pull request Sep 21, 2026
…#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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
…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]>
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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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