Skip to content

fix(plugins): honor enabledByDefault in config validation warnings - #122804

Closed
felirami wants to merge 1 commit into
openclaw:mainfrom
felirami:cursor/honor-enabled-by-default-validation-4c2d
Closed

felirami wants to merge 1 commit into
openclaw:mainfrom
felirami:cursor/honor-enabled-by-default-validation-4c2d

Conversation

@felirami

Copy link
Copy Markdown
Contributor

Closes #122746

What Problem This Solves

Fixes an issue where operators who configure plugins.entries.canvas with a config block and no top-level enabled: true would see openclaw plugins list report Canvas as enabled, while openclaw status and openclaw doctor warned that the plugin was disabled: plugins.entries.canvas: plugin disabled (bundled (disabled by default)) but config is present.

Why This Change Was Made

Plugin inventory already passes manifest default enablement into the shared activation resolver. Config validation called the same resolver without that argument, so default-on bundled plugins were classified as bundled-disabled-by-default whenever config was present without an explicit enable flag.

The fix is one pass-through on the validation owner: enabledByDefault: isPluginEnabledByDefaultForPlatform(record), matching plugins list / runtime. No Canvas special case, no config-shape change, and no doctor/status warning rewrite.

User Impact

Config-only entries for default-on bundled plugins such as Canvas no longer produce a false disabled warning. plugins list and doctor/status now agree. Config-only entries for default-off bundled plugins still warn, so unused config on opt-in plugins remains visible.

Evidence

Production LOC: +4 / -0 (net +4: import, invariant comment, one activation argument) | Tests: +47 / -0

The +4 production delta is the missing activation argument plus the import and a short cross-path comment. A net-zero rewrite would omit the comment or skip enabledByDefaultOnPlatforms; list/runtime already use isPluginEnabledByDefaultForPlatform.

Real behavior proof

Built and run from this PR branch. Packaged CLI dist/ was not present in this checkout, so proof uses the real doctor/status producer: validateConfigObjectWithPlugins → validateExplicitPluginConfig. That is the path that emits plugin disabled (...) but config is present.

Proof script imported src/config/validation.ts with a temp HOME and OPENCLAW_BUNDLED_PLUGINS_DIR=extensions, then validated:

plugins: {
  entries: {
    canvas: { config: { host: { enabled: true } } },
    // and separately:
    workboard: { config: {} },
  },
}

Before (parent main, no fix):

  • SHA: b4ffa3106f205a2beef985c9b43887d7c2a6091f
  • Command: node --import tsx /tmp/canvas-enabled-by-default-proof.mjs before-fix
{
  "label": "before-fix",
  "sha": "b4ffa3106f205a2beef985c9b43887d7c2a6091f",
  "cases": [
    {
      "name": "default-on canvas config-only",
      "pluginId": "canvas",
      "ok": true,
      "warningCount": 1,
      "warnings": [
        {
          "path": "plugins.entries.canvas",
          "message": "plugin disabled (bundled (disabled by default)) but config is present"
        }
      ]
    },
    {
      "name": "default-off workboard config-only",
      "pluginId": "workboard",
      "ok": true,
      "warningCount": 1,
      "warnings": [
        {
          "path": "plugins.entries.workboard",
          "message": "plugin disabled (bundled (disabled by default)) but config is present"
        }
      ]
    }
  ]
}

After (this PR head):

  • SHA: 2a603ba0572c55c6a0732e63f4f156b78b694f84
  • Command: node --import tsx /tmp/canvas-enabled-by-default-proof.mjs after-fix
{
  "label": "after-fix",
  "sha": "2a603ba0572c55c6a0732e63f4f156b78b694f84",
  "cases": [
    {
      "name": "default-on canvas config-only",
      "pluginId": "canvas",
      "ok": true,
      "warningCount": 0,
      "warnings": []
    },
    {
      "name": "default-off workboard config-only",
      "pluginId": "workboard",
      "ok": true,
      "warningCount": 1,
      "warnings": [
        {
          "path": "plugins.entries.workboard",
          "message": "plugin disabled (bundled (disabled by default)) but config is present"
        }
      ]
    }
  ]
}

List/runtime already pass enabledByDefault (src/plugins/loader-cli-registry.ts). After this change, validation uses the same fact, so doctor/status no longer contradict plugins list for config-only Canvas.

Focused tests

Regression test failed on pre-fix main for the intended reason (Canvas config-only still warned), then passed on this head:

# pre-fix (expected fail)
node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts -t "honors bundled default enablement"
FAIL honors bundled default enablement for config-only 'canvas' entries
AssertionError: expected true to be false

# post-fix
node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts -t "honors bundled default enablement"
Tests  2 passed | 82 skipped (84)

node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts src/plugins/config-state.test.ts
Tests  84 passed (config.plugin-validation)
Tests  51 passed (config-state)

Follow-up (not in this PR)

src/plugins/bundle-commands.ts also omits enabledByDefault when resolving activation. That path loads Claude bundle commands, not doctor/status warnings, so it is a sibling follow-up rather than this warning invariant. src/commands/channel-setup/trusted-catalog.ts uses the activation result only for workspace source === "auto" trust, not bundled default-on doctor warnings.

Testing

  • node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts
  • node scripts/run-vitest.mjs src/plugins/config-state.test.ts
  • Real validation-path before/after script above (SHAs b4ffa3106f205a2beef985c9b43887d7c2a6091f → 2a603ba0572c55c6a0732e63f4f156b78b694f84)

Doctor/status treated config-only default-on bundled plugins as disabled
because validation omitted the manifest default that plugins list already
passes. Pass enabledByDefault through the shared activation resolver.

Closes openclaw#122746
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@felirami
felirami marked this pull request as ready for review August 12, 2026 20:42
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 4:57 PM ET / 20:57 UTC.

ClawSweeper review

What this changes

This PR makes configuration validation honor each bundled plugin manifest’s default enablement, preventing false disabled warnings for config-only default-on plugins.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking code findings: the PR fixes a real current-main inconsistency by giving validation the same manifest default-enablement fact used by plugin inventory and startup. It remains necessary; rebase or refresh the branch and obtain green exact-head checks before merge.

Priority: P2
Reviewed head: 2a603ba0572c55c6a0732e63f4f156b78b694f84

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused owner-boundary repair and direct before/after evidence are strong; exact-head CI still needs refresh before merge.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body includes a before/after run through the real validation producer, showing the Canvas warning disappears while the default-off Workboard warning remains.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body includes a before/after run through the real validation producer, showing the Canvas warning disappears while the default-off Workboard warning remains.
Evidence reviewed 5 items Current-main defect: Current validation resolves activation without passing the manifest default-enablement fact, so a config-only default-on bundled plugin is treated as disabled for this warning path.
Sibling-path alignment: Current plugin inventory and gateway startup already pass platform-aware manifest default enablement into the same activation resolver; the PR aligns validation with those paths.
Focused repair and regression coverage: The PR adds the missing resolver argument and tests both a default-on Canvas config-only entry and a default-off Workboard control case.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts -t "honors bundled default enablement"

Result: FAIL (failed) — execution before step 1 run: live-proof package manager pnpm is unavailable after its official installer (curl -fsSL https://get.pnpm.io/install.sh | sh -): command failed without output

live-proof package manager pnpm is unavailable after its official installer (curl -fsSL https://get.pnpm.io/install.sh | sh -): command failed without output

Assertions:

  • FAIL expect_output: honors bundled default enablement

How this fits together

Plugin manifests supply default-enablement metadata to plugin inventory and runtime startup. Configuration validation consumes the same manifest registry to produce warnings surfaced by doctor and status.

flowchart LR
  A[Plugin manifest] --> B[Manifest registry]
  C[Operator plugin config] --> D[Configuration validation]
  B --> D
  D --> E[Activation decision]
  E --> F[Doctor and status warnings]
  B --> G[Plugin inventory]
  G --> H[Plugin list output]
Loading

Before merge

  • Complete next step (P2) - Refresh the stale branch and rerun required checks on its exact head; no discrete automated repair is indicated.
Agent review details

Security

None.

PR surface

Source +4, Tests +47. Total +51 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 0 +4
Tests 1 47 0 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 51 0 +51

Review metrics

Metric Value Why it matters
Production versus test LOC production +4, tests +47 The small production increase is the import, invariant comment, and missing activation argument; the table-driven regression coverage protects both default-on and default-off behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #122746
Summary: This PR is the focused candidate fix for the linked Canvas status-warning inconsistency.

Members:

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

Merge-risk options

  • The branch is behind current main and its compact CI check plus aggregate gate are failing, so merge readiness requires a refreshed exact head with green required checks.

Maintainer options:

  1. Decide the mitigation before merge
    Keep manifest default enablement as the single activation input across validation, inventory, and startup, then land this focused alignment once the refreshed branch proves clean.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep manifest default enablement as the single activation input across validation, inventory, and startup, then land this focused alignment once the refreshed branch proves clean.

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

Yes. Current main omits default enablement at the validation resolver call, while the PR body supplies a before/after run through that producer and a default-off control case.

Is this the best way to solve the issue?

Yes. Passing the existing manifest fact into the shared activation resolver repairs the owner boundary without adding config, plugin-specific policy, or a second decision path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8032e6c75e01.

Labels

Label justifications:

  • P2: This is a bounded operator-facing diagnostic inconsistency in plugin configuration validation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes a before/after run through the real validation producer, showing the Canvas warning disappears while the default-off Workboard warning remains.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes a before/after run through the real validation producer, showing the Canvas warning disappears while the default-off Workboard warning remains.

Evidence

What I checked:

  • Current-main defect: Current validation resolves activation without passing the manifest default-enablement fact, so a config-only default-on bundled plugin is treated as disabled for this warning path. (src/config/validation-plugin-config.ts:363, 8032e6c75e01)
  • Sibling-path alignment: Current plugin inventory and gateway startup already pass platform-aware manifest default enablement into the same activation resolver; the PR aligns validation with those paths. (src/plugins/loader-cli-registry.ts:122, 8032e6c75e01)
  • Focused repair and regression coverage: The PR adds the missing resolver argument and tests both a default-on Canvas config-only entry and a default-off Workboard control case. (src/config/validation-plugin-config.ts:371, 2a603ba0572c)
  • History and ownership: The current-main validation loop is blamed to the recent source commit; its omission remains present on main, while the PR head supplies the narrowly missing input. (src/config/validation-plugin-config.ts:363, d204ebe6a4df)
  • Release status: The PR head is not contained by a release tag; the current latest release predates this open PR. (2a603ba0572c)

Likely related people:

  • Peter Steinberger: Current-main blame covers the validation loop and its activation-policy siblings, and recent history includes plugin-registry refactors. (role: recent source and plugin-architecture contributor; confidence: medium; commits: d204ebe6a4df, e4d1b7e0d38c, c41f033b8754; files: src/config/validation-plugin-config.ts, src/plugins/loader-cli-registry.ts, src/plugins/gateway-startup-plugin-activation.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase or otherwise refresh against current main and obtain green exact-head required checks.

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 (2 earlier review cycles)
  • reviewed 2026-08-12T21:11:53.659Z sha 2a603ba :: needs maintainer review before merge. :: none
  • reviewed August 15, 2026, 11:43 PM ET / August 16, 2026, 03:43 UTC sha unknown :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member

Closing as already fixed and superseded by #126030, merged as ae55a40.

Current main contains the same owner-boundary repair: plugin-config validation passes the manifest-derived enabledByDefault value into the shared activation resolver used by inventory and startup. Its regression coverage checks both a config-only default-on Canvas plugin and a default-off bundled control, so legitimate disabled-plugin warnings remain intact.

No unique executable behavior or regression gap remains in this branch. Thanks @felirami for independently identifying the root cause and supplying focused two-sided regression and before/after proof.

The latest published release v2026.7.1-2 predates this fix; it is fixed on current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

close:already-fixed claw-marshal label P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

[Bug]: canvas plugin status is contradictory — plugins list shows enabled while status/doctor warn it is disabled

2 participants