Skip to content

fix(config): disabled mixed-case plugins are re-enabled by auto-enable and doctor --fix - #188846

Merged
steipete merged 1 commit into
openclaw:mainfrom
masatohoshino:fix/auto-enable-mixed-case-disable
Oct 31, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
masatohoshino:fix/auto-enable-mixed-case-disable

Conversation

@masatohoshino

@masatohoshino masatohoshino commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #188845

What Problem This Solves

Fixes: a plugin whose manifest id has uppercase letters (for example MyProv) is enabled again by plugin auto-enable, and persisted by openclaw doctor --fix, after the user ran openclaw plugins disable MyProv.

User Impact

User impact: openclaw plugins disable, openclaw plugins enable and plugins.deny hold for plugins with mixed-case manifest ids; auto-enable and doctor --fix no longer undo a disable, add a second raw-case entry, or report an auto-enable that did not happen. Lowercase ids behave as before.

A config this bug already rewrote keeps its extra MyProv entry; running openclaw plugins disable MyProv (or enable) once more collapses both spellings onto the canonical key. This PR adds no Doctor repair: the mixed-case key is a valid shape, and Doctor cannot tell a true the user wrote from one this bug wrote. On the latest stable (2026.10.9) the same steps make doctor --fix drop the myprov entry altogether; this change cannot restore a disable that was already lost there, so affected users disable the plugin again once.

Why This Change Was Made

#180789 moved install persistence onto the canonical plugin id, the lowercase id that plugins enable/disable, config validation and the loader use (#180071). Plugin auto-enable still read and wrote policy under the raw manifest spelling: it missed plugins.entries.myprov.enabled: false, appended plugins.entries.MyProv.enabled: true, and that later key won when the entries folded onto myprov.

All policy reads and writes in src/config/plugin-auto-enable.materialize.ts now go through normalizePluginId and the normalized plugin config, the same owners the loader uses: the explicit-disable, deny, allowlist and already-enabled checks, the explicit-selection check that guards the preferred-over path, and the entry and allowlist writes. Raw entries are still read where the normalized view drops fields (apiKey, env).

Size: production +28/-18 lines in one file; one 21-line regression test; one test-line allocation record. No config, state or SDK surface changes.

Follow-ups, not in this PR: candidate detection in src/config/plugin-auto-enable.shared.ts and src/plugin-sdk/provider-enable-config.ts still compare raw plugin ids.

Evidence

Tested at 543dd536de5 (base upstream/main 24e37a12ddc).

The built CLI (pnpm openclaw) on Ubuntu 22.04 with Node 24.22.1, with fresh isolated state, config and home directories for every run. The plugin is a synthetic local provider plugin with manifest id MyProv, provider myprov and autoEnableWhenConfiguredProviders: ["myprov"]; it is never called, and no network or credentials are involved. Same steps on both sides, with one policy step each:

openclaw plugins install --force --accept-capabilities ./myprov
openclaw config set models.providers.myprov '{"baseUrl":"http://127.0.0.1:9/v1","api":"openai-completions","models":[{"id":"m1","name":"m1"}]}' --strict-json
<policy step: plugins disable MyProv | config set plugins.deny '["myprov"]' --strict-json | plugins enable MyProv>
openclaw doctor --fix --non-interactive
openclaw plugins list --json

Before (base 24e37a12ddc), plugins.entries without the two unrelated bundled entries:

== plugins disable MyProv
before doctor: {"myprov":{"enabled":false}}
doctor:        myprov auth configured, enabled automatically.
after doctor:  {"myprov":{"enabled":false},"MyProv":{"enabled":true}}
plugins list:  MyProv: loaded

== config set plugins.deny ["myprov"]
before doctor: {"myprov":{"enabled":true}}
doctor:        myprov auth configured, enabled automatically.
after doctor:  {"myprov":{"enabled":true},"MyProv":{"enabled":true}}
plugins list:  MyProv: disabled

== plugins enable MyProv
before doctor: {"myprov":{"enabled":true}}
doctor:        myprov auth configured, enabled automatically.
after doctor:  {"myprov":{"enabled":true},"MyProv":{"enabled":true}}
plugins list:  MyProv: loaded

After (this PR):

== plugins disable MyProv
before doctor: {"myprov":{"enabled":false}}
doctor:        (no auto-enable line)
after doctor:  {"myprov":{"enabled":false}}
plugins list:  MyProv: disabled

== config set plugins.deny ["myprov"]
before doctor: {"myprov":{"enabled":true}}
doctor:        (no auto-enable line)
after doctor:  {"myprov":{"enabled":true}}
plugins list:  MyProv: disabled

== plugins enable MyProv
before doctor: {"myprov":{"enabled":true}}
doctor:        (no auto-enable line)
after doctor:  {"myprov":{"enabled":true}}
plugins list:  MyProv: loaded

Observed result: before, doctor --fix re-enabled the disabled plugin (plugins list shows it loaded) and, in all three cases, saved a second MyProv entry and reported an auto-enable; after, plugins.entries is unchanged and nothing is reported.

Upgrade from the latest stable

Settings written by the latest stable, then carried to this branch in the same state directory. Fresh isolated home, env -i, unshare -rn (no network), three synthetic provider plugins with mixed-case manifest ids MyProv, OtherProv and OnProv, no credentials.

On [email protected] from npm:

openclaw plugins install --force --accept-capabilities ./myprov        # and ./otherprov, ./onprov
openclaw config set models.providers.<id> '{"baseUrl":"http://127.0.0.1:9/v1",...}' --strict-json   # each of the three
openclaw config set gateway.port 18999 --strict-json
openclaw config set agents.defaults.workspace <home>/workspace
openclaw plugins disable MyProv
openclaw config set plugins.deny '["otherprov"]' --strict-json
openclaw plugins enable OnProv
openclaw plugins list --json

Then, in the same home, this branch's CLI ran openclaw doctor --fix --non-interactive and openclaw plugins list --json. For comparison, this branch rebuilt with the base plugin-auto-enable.materialize.ts (the PR's only production file) ran the same two commands in a second home set up the same way. entries below are shown without the two unrelated bundled entries:

stable wrote:        entries {"otherprov":{"enabled":true},"myprov":{"enabled":false},"onprov":{"enabled":true}}, deny ["otherprov"]
stable plugins list: MyProv disabled, OtherProv disabled, OnProv loaded

base materializer (24e37a12ddc), after doctor --fix
  doctor:            myprov, onprov and otherprov "auth configured, enabled automatically."
  entries:           the three above plus "MyProv":{"enabled":true}, "OnProv":{"enabled":true}, "OtherProv":{"enabled":true}
  plugins list:      MyProv loaded, OtherProv disabled, OnProv loaded

this PR, after doctor --fix
  doctor:            (no auto-enable line)
  plugins section:   identical to what stable wrote (entries and deny)
  plugins list:      MyProv disabled, OtherProv disabled, OnProv loaded

Everything else Doctor changed is the same on the base and on this PR, so none of it comes from this change: the state database migrations (schema 20 to 36, with a pre-migration backup), the meta.migrations.webhookListeners marker, the agents.entries.main roster entry, the wizard run record, and the skills.entries Doctor disabled. models and gateway are unchanged on both sides. The three plugins installed by the stable release are still discovered from their stable install records, and their extension files are unchanged. Existing data needs no migration: this change adds no config, state or schema shape, and it reads plugins.entries and plugins.deny through the same id normalization the loader and config validation use, so any key stable accepted is read the same way.

Regression test, failing on the base and passing with the fix: "reads mixed-case plugin policy under the canonical lowercase key" in plugin-auto-enable.materialize.test.ts feeds MyProv, OtherProv and OnProv candidates against lowercase entries.myprov.enabled: false, deny: ["otherprov"] and entries.onprov.enabled: true, and expects no config change and no reported change.

Checks: the touched test (pnpm test <file> --maxWorkers=1, wall time below); the auto-enable suites plugin-auto-enable.core.test.ts, plugin-auto-enable.channels.test.ts, plugin-auto-enable.providers.test.ts and plugin-auto-enable.materialize.test.ts (66 tests); seven consumer suites of auto-enable (79 tests): src/commands/doctor-legacy-config.migrations.test.ts, src/commands/doctor/shared/release-configured-plugin-installs.test.ts, src/commands/channel-setup/plugin-install.test.ts, src/commands/channels.list.inventory.test.ts, src/gateway/server-startup-config.recovery.test.ts, src/gateway/plugin-activation-runtime-config.test.ts and src/config/official-external-channel-secret-schema.test.ts; node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.config-cli.json; oxlint and oxfmt --check on the changed files; the broad suites run in this PR's CI.

Test file --maxWorkers=1 wall CI seconds
src/config/plugin-auto-enable.materialize.test.ts 35.1 s (4 tests; the new test runs in under 1 ms, the rest is module transform on a cold cache) 3.69 s (checks-node-changed-1; 5.71 s for its shard)

Test lines: the allocation in config/test-lines-allocations/auto-enable-mixed-case-disable.txt is 22, exactly the regression test's 21 lines plus its separating blank line, the PR's whole net test-line delta. The test-line ratchet passes in this PR's CI (checks-fast-baseline-ratchets: 6,315,943 lines, ceiling 6,347,938).

Not covered: the proof uses a provider-triggered auto-enable; channel, tool and model-reference candidates go through the same checks and writes. The preferred-over path was checked by direct calls in review, with no committed test. A hand-written mixed-case entry with config (plugins.entries.MyProv: {config: …}) that auto-enable enables gets the canonical myprov: {enabled: true} beside it instead of being folded in, as the base did; the merged result is correct, and plugins enable or disable folds it. Folding it here through the enable helper would also rewrite plugins.allow and deny aliases on every doctor --fix, so it was left out.

@clawsweeper

clawsweeper Bot commented Oct 30, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Plugin auto-enable reads and writes mixed-case plugin policy using the existing canonical lowercase identity.

Example: Disable MyProv, then run openclaw doctor --fix.

  • Before: Doctor appends MyProv.enabled=true beside myprov.enabled=false, and MyProv loads.
  • After: Doctor preserves myprov.enabled=false, reports no auto-enable, and MyProv stays disabled.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, useful repair with shipped-CLI and existing-state upgrade evidence, successful exact-head checks, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Contributor output exercises the changed materializer through the built CLI on isolated Ubuntu state at the reviewed head: install, configure, disable/deny/enable, Doctor, persisted configuration, and plugin status. The added same-directory v2026.10.9 upgrade preserves plugin preferences, provider settings, and installation discovery, resolving the previous review's requested transition.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A plugin explicitly disabled by the user becomes loaded again when Doctor processes its mixed-case manifest ID.
Reason: The patch restores documented plugin identity and disablement behavior without new settings, defaults, or speculative migration.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current plugin-policy bug with no actionable findings; the added stable-to-head evidence resolves the previous upgrade-proof hold.

Priority: P2
Reviewed head: 543dd536de577721de25a54e8cf540127fd6b0f1

Before merge

None.

Findings

None.

Agent review details

How this fits together

The auto-enable materializer combines configuration candidates, plugin manifests, and operator policy into effective configuration and notices consumed by Doctor and plugin activation.

flowchart LR
 A[Configured providers and channels] --> B[Candidate detection]
 C[Plugin manifests] --> B
 B --> D[Auto-enable materializer]
 E[Canonical plugin policy] --> D
 D --> F[Doctor persistence]
 D --> G[Plugin activation]
Loading

Technical review

Best possible solution:

Merge the focused canonical-policy repair while retaining explicit recovery for previously ambiguous duplicate entries.

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

Source establishes the lowercase-disable lookup miss, raw-case enable write, and subsequent normalized override; contributor CLI output demonstrates the failure without this review executing target code.

Is this the best way to solve the issue?

This is the smallest complete repair: reuse existing identity normalization throughout the materializer, preserve authored payloads, and add one regression covering disable, deny, and already-enabled policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1bf930c8e40a.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e79d004 adds src/config/plugin-auto-enable.materialize.ts:408 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e79d0044c2a6; files: src/config/plugin-auto-enable.materialize.ts)

PR surface

Source +10, Tests +22, Other +2. Total +34 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 28 18 +10
Tests 1 22 0 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 3 52 18 +34

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #188845
Summary: This PR repairs the linked auto-enable report; the earlier installation fix addresses an adjacent writer.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Auto-enable can silently undo explicit disablement, with impact limited to plugins using mixed-case manifest IDs.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-31T00:05:43.503Z sha 543dd53 :: needs real behavior proof before merge. :: none

Reviewed October 30, 2026, 10:30 PM ET / October 31, 2026, 02:30 UTC (Revision 2).

@masatohoshino

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 31, 2026
@steipete
steipete merged commit 88b56ee into openclaw:main Oct 31, 2026
151 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
tideclaw-bot added a commit that referenced this pull request Nov 5, 2026
Backport accepted fixes onto 2026.11.5-beta.2.

Base: bc061f9
Canonical source tree before commit: e6c0c39

These are adapted/squashed backports; do not claim each is an exact Git cherry-pick.
Source provenance (selected verified commits; other cohorts use their frozen patch/adoption manifests):

runtime-B:
b20a0cc fix(macos): connect with configured credentials despite stale app environment (#191468)
c4c0942 fix(update): failed updates from 10.7–10.9 crash in automatic migration recovery (#189713)
6aae408 fix(update): preserve recovery errors and async triage callbacks (#191495)
8910654 fix(macos): prevent first-launch Gateway failures after upgrades (#191436)
00b2ff4 fix: parent sessions miss child approvals with a custom session store (#189827)
c6142a8 fix: avoid copying managed plugin binaries during Gateway startup (#187865)
e72b356 fix(anthropic): avoid token profile collisions (#187875)
807075d fix(anthropic): set API workspace at login (#186976)
bafe92f fix(exec): preserve no-timeout results from macOS app nodes (#190729)
9b05a64 fix(imessage): use a PostgreSQL-safe recovery cursor key (#184919)
6ba197f fix: session search on PostgreSQL scans every transcript row instead of using the text index (#187909)
4f49aa5 fix(sessions): PostgreSQL session search scans every transcript row again after the 5th search on a connection (#188979)
de3936c fix(macos): Mac tab shows a blank or stale page when a load fails (#185432)
e977080 fix(macos): prevent duplicate voice sends and false sent feedback (#186271)

provider-compaction:
1b43c2e fix(compaction): preserve active request provenance (#180214)
7b0cfe3 fix(google): restore tool calls with Python keyword parameters (#191561)
9039ceb fix(ci): keep compaction attribution helpers internal
d6a1327 feat(google): use the Interactions API for Gemini Flash models (#189395)
fe0f8d1 fix(google): Gemini models ignore configured topP (#190695)

history:
c51d733 fix(sessions): stop expanding archive reads from exhausting memory (#190690)
3c8bd4d fix(sessions): page oversized earlier history instead of failing at 8 MiB (#188450)
b195f61 fix(sessions): page oversized transcript history in both directions (#188483)
b65482e fix(gateway): preserve older history across hidden message gaps (#188557)
3d4fc94 fix(sessions): avoid oversized listing and imported-history reads (#189284)
33e7baf fix(sessions): bound active accounting without blocking writers (#190182)
682ade7 fix: preserve chat history continuation metadata (#188612)

runtime-C:
7e005b0 fix(macos): keep secrets when a Gateway config save fails (#187734)
15cf738 fix(macos): keep Gateway auth when Tailscale exposure is turned off (#187664)
b53a06b perf(update): read candidate state inventory without copying the shared database (#187921)
970fc4e fix: restore CLI message sends with agent tool policies (#188058)
73ad731 fix: stop model fallback when session capability metadata changes (#179312)
32305db fix: subagent turns fail after session metadata changes (#183501)
d13bd0f fix(codex): include relay conversation instructions in trajectory (#189005)
e375530 fix: replies after a plugin reload from Control UI go to the session's last external chat (#190982)
9346376 fix: reasoning-only retry is refused by Anthropic as reasoning_extraction (#184434)

direct-auth-state:
1b15408 fix(models): keep the model list when one plugin-owned provider lacks a credential (#189014)
7d8dc60 fix: recover startup migration with retained worker index (#189023)

capacity:
41772e3 fix(worktrees): settle completed disk debt on refused postchecks (#188727)

command-once-189369:
8269137 fix(plugins): plugin commands that continue the agent run three times on native command turns (#189369)

pg-board-189564:
7232a8d fix(boards): publish widgets with PostgreSQL storage (#189564)

queued-edit-189869:
92b32ca fix: hold queued messages through inline edits (#189869)

Preserve source attribution from original commits. For a genuinely exact individual pick only, use the conventional (cherry picked from commit <sha>) line.
Full file-level provenance: coverage-manifest.json; reviewed patch hashes: artifact-registry.json.
No held136/native82 content adopted by this work. No release or full-candidate qualification claim.

Additional original-source identities (exact adapted hunk scope is in frozen artifacts):
release-guides-185258: 39c37e6 docs(release): define ledger-first hotfix routing (#185258)
UI-history: 10a6e4f fix(ui): scope provider-add discovery warning to its own provider (#188541), 3d7b4c4 fix(ui): never fail loading earlier chat history without a boundary (#188372)
obsolete-cache-188203: 90d82c2 fix: preserve completed reasoning and refill chat snapshots (#188203)
webhook-169778: b1f643f fix(startup): keep webhook decisions startup recorded for channels Doctor left pending (#169778)
schema-lease-188391: ba6cfcd fix(state): keep lease renewal independent of parent admission (#188391)
backfill-188976: c75a8a8 fix(gateway): stop session row backfill once the Gateway is closing (#188976)
canonical-disable-188846: 88b56ee fix(config): auto-enable reads and writes mixed-case plugin policy under the canonical id (#188846)
matrix-177272: 5a6d22c fix(matrix): stop seeding new thread sessions from the room transcript (#177272)
provider-hook-189059: 0588f51 fix(models): isolate every per-provider catalog failure (#189059)
unicode-189868: 87396e7 fix(oc-path): avoid reading and editing a different Unicode key (#189868)
replay-cohort: 2031044 fix(sessions): acknowledge committed input retries without duplicate turns (#188527), 9114431 fix: resume configured fallback after interrupted attempts (#188672)

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

doctor --fix re-enables a plugin with a mixed-case id after openclaw plugins disable

2 participants