Skip to content

fix(config): enable repaired external plugins whose id matches built-in channel#98975

Closed
yaotukeji wants to merge 3 commits into
openclaw:mainfrom
yaotukeji:fix/mattermost-repair-enable-gateway-startup
Closed

fix(config): enable repaired external plugins whose id matches built-in channel#98975
yaotukeji wants to merge 3 commits into
openclaw:mainfrom
yaotukeji:fix/mattermost-repair-enable-gateway-startup

Conversation

@yaotukeji

@yaotukeji yaotukeji commented Jul 2, 2026

Copy link
Copy Markdown

What Problem This Solves

After Mattermost was externalized in 2026.6.11, running openclaw doctor --fix on an upgraded container installs @openclaw/mattermost but does not enable it for gateway startup. The gateway starts with only 7 plugins and silently omits Mattermost, causing message loss. The root cause is that materializePluginAutoEnableCandidates writes the activation bit to channels.mattermost.enabled because "mattermost" is also a built-in channel id, but gateway startup for non-bundled plugins requires plugins.entries.mattermost.enabled=true.

Changes

  • src/config/plugin-auto-enable.shared.ts: make resolveAutoEnableChannelId return null for configured-plugin-repaired candidates, so activation is written to plugins.entries.<id>.enabled.
  • src/config/plugin-auto-enable.core.test.ts: add regression test covering a repaired external plugin whose id matches a built-in channel id.

Evidence

  • Added a focused regression test that asserts plugins.entries.mattermost.enabled is true and channels.mattermost.enabled is not set for a configured-plugin-repaired candidate.
  • Existing test suites still pass:
    • src/config/plugin-auto-enable.core.test.ts: 52 passed
    • src/commands/doctor/repair-sequencing.test.ts: 15 passed
  • Manual reproduction from the issue matches the observed regression path.

Related

Fixes #98564


This PR was prepared with AI assistance. The contributor has reviewed every change, verified local tests pass, and takes full responsibility for this submission.

…in channel

When doctor --fix repairs a configured external plugin whose pluginId
coincides with a built-in chat channel id (e.g. mattermost),
materializePluginAutoEnableCandidates was writing the activation bit to
channels.<id>.enabled instead of plugins.entries.<id>.enabled. Gateway
startup only honors the plugin entry for non-bundled plugins, so the
repaired plugin was silently omitted.

This change makes resolveAutoEnableChannelId return null for
configured-plugin-repaired candidates, so the activation is materialized
as plugins.entries.<id>.enabled=true.

Fixes openclaw#98564

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 2, 2026
@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close: this PR is superseded by the merged canonical fix in #98608, and current main already has the requested repaired-external-plugin activation behavior with broader coverage.

Root-cause cluster
Relationship: superseded
Canonical: #98608
Summary: This PR and the merged canonical PR target the same Mattermost configured-plugin repair regression; the canonical PR is merged and current main contains same-or-better behavior.

Members:

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

Canonical path: Keep #98608 as the canonical merged fix and close this redundant branch rather than landing a second overlapping activation change.

So I’m closing this here and keeping the remaining discussion on #98608.

Review details

Best possible solution:

Keep #98608 as the canonical merged fix and close this redundant branch rather than landing a second overlapping activation change.

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

Yes for the original shipped regression: the linked issue gives concrete 2026.6.10 to 2026.6.11 Docker logs, and source shows non-bundled gateway startup requires explicit plugin activation. Current main now contains the repaired activation path.

Is this the best way to solve the issue?

Yes, the merged implementation in #98608 is the better current solution because it covers this repaired-plugin case plus same-id external channel and allowlist/fallback invariants. This PR should not land separately.

Security review:

Security review cleared: Cleared: the diff only touches config auto-enable logic and a colocated test, with no new dependency, workflow, secret, or supply-chain surface.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • jacobtomlinson: Authored the merged fix commit for the repaired Mattermost activation path and opened the canonical issue with the Docker upgrade reproduction. (role: canonical fix author and reproduction owner; confidence: high; commits: 48f4a09e1fd8; files: src/config/plugin-auto-enable.shared.ts, src/config/plugin-auto-enable.channels.test.ts)
  • shakkernerd: Committed the follow-up allowlist/fallback coverage in the same merged stack and is the committer on the canonical merge commit. (role: recent adjacent contributor and merger; confidence: high; commits: d2d20b5fed41, c032f9809d78; files: src/config/plugin-auto-enable.shared.ts, src/config/plugin-auto-enable.channels.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 019603d33602; fix evidence: commit 48f4a09e1fd8, main fix timestamp 2026-07-02T17:13:38+01:00.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 2, 2026
The regression test for issue openclaw#98564 used origin: 'npm', but
PluginOrigin only accepts bundled | global | workspace | config.
This caused check-test-types to fail with TS2322.

Use 'global' to represent the externalized Mattermost plugin.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 2, 2026
@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Mattermost repair installs external plugin without enabling gateway startup

1 participant