fix(doctor/plugins): skip unused Matrix inspector loads and honor enabledByDefault startup plugins (#57931)

Merged via squash.

Prepared head SHA: 634794b954
Co-authored-by: dinakars777 <250428393+dinakars777@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Dinakar Sarbada 2026-03-30 14:06:04 -07:00 committed by GitHub
parent 9a94578d47
commit 62d6cfedee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 61 additions and 6 deletions

View File

@ -110,6 +110,7 @@ Docs: https://docs.openclaw.ai
- Agents/subagents: fix interim subagent runtime display so `/subagents list` and `/subagents info` stop inflating short runtimes and show second-level durations correctly. (#57739) Thanks @samzong.
- Diffs/config: preserve schema-shaped plugin config parsing from `diffsPluginConfigSchema.safeParse()`, so direct callers keep `defaults` and `security` sections instead of receiving flattened tool defaults. (#57904) Thanks @gumadeiras.
- Diffs: fall back to plain text when `lang` hints are invalid during diff render and viewer hydration, so bad or stale language values no longer break the diff viewer. (#57902) Thanks @gumadeiras.
- Doctor/plugins: skip false Matrix legacy-helper warnings when no migration plans exist, and keep bundled `enabledByDefault` plugins in the gateway startup set. (#57931) Thanks @dinakars777.
## 2026.3.28

View File

@ -176,6 +176,33 @@ describe("matrix legacy encrypted-state migration", () => {
);
});
it("skips inspector loading when no legacy Matrix plans exist", async () => {
await withTempHome(
async () => {
const matrixHelperModule = await import("./matrix-plugin-helper.js");
const loadInspectorSpy = vi.spyOn(matrixHelperModule, "loadMatrixLegacyCryptoInspector");
const result = await autoPrepareLegacyMatrixCrypto({
cfg: createDefaultMatrixConfig(),
env: process.env,
});
expect(result).toEqual({
migrated: false,
changes: [],
warnings: [],
});
expect(result.warnings).not.toContain(MATRIX_LEGACY_CRYPTO_INSPECTOR_UNAVAILABLE_MESSAGE);
expect(loadInspectorSpy).not.toHaveBeenCalled();
},
{
env: {
OPENCLAW_BUNDLED_PLUGINS_DIR: (home) => path.join(home, "empty-bundled"),
},
},
);
});
it("warns when legacy local-only room keys cannot be recovered automatically", async () => {
await withTempHome(async (home) => {
const { cfg, rootDir } = writeDefaultLegacyCryptoFixture(home);

View File

@ -328,9 +328,22 @@ export async function autoPrepareLegacyMatrixCrypto(params: {
: detectLegacyMatrixCrypto({ cfg: params.cfg, env });
const warnings = [...detection.warnings];
const changes: string[] = [];
let inspectLegacyStore = params.deps?.inspectLegacyStore;
const writeJsonFileAtomically =
params.deps?.writeJsonFileAtomically ?? writeJsonFileAtomicallyImpl;
if (detection.plans.length === 0) {
if (warnings.length > 0) {
params.log?.warn?.(
`matrix: legacy encrypted-state warnings:\n${warnings.map((entry) => `- ${entry}`).join("\n")}`,
);
}
return {
migrated: false,
changes,
warnings,
};
}
let inspectLegacyStore = params.deps?.inspectLegacyStore;
if (!inspectLegacyStore) {
try {
inspectLegacyStore = await loadMatrixLegacyCryptoInspector({
@ -354,6 +367,13 @@ export async function autoPrepareLegacyMatrixCrypto(params: {
};
}
}
if (!inspectLegacyStore) {
return {
migrated: false,
changes,
warnings,
};
}
for (const plan of detection.plans) {
const existingState = loadLegacyCryptoMigrationState(plan.statePath);

View File

@ -138,19 +138,25 @@ describe("resolveGatewayStartupPluginIds", () => {
enabledPluginIds: ["demo-bundled-sidecar"],
modelId: "demo-cli/demo-model",
}),
["demo-channel", "demo-provider-plugin", "demo-bundled-sidecar", "demo-global-sidecar"],
[
"demo-channel",
"demo-default-on-sidecar",
"demo-provider-plugin",
"demo-bundled-sidecar",
"demo-global-sidecar",
],
],
[
"does not pull default-on bundled non-channel plugins into startup",
"includes bundled plugins with enabledByDefault: true",
{} as OpenClawConfig,
["demo-channel", "demo-global-sidecar"],
["demo-channel", "demo-default-on-sidecar", "demo-global-sidecar"],
],
[
"auto-loads bundled plugins referenced by configured provider ids",
createStartupConfig({
providerIds: ["demo-provider"],
}),
["demo-channel", "demo-provider-plugin", "demo-global-sidecar"],
["demo-channel", "demo-default-on-sidecar", "demo-provider-plugin", "demo-global-sidecar"],
],
] as const)("%s", (_name, config, expected) => {
expectStartupPluginIdsCase({ config, expected });

View File

@ -337,7 +337,8 @@ export function resolveGatewayStartupPluginIds(params: {
return (
pluginsConfig.allow.includes(plugin.id) ||
pluginsConfig.entries[plugin.id]?.enabled === true ||
pluginsConfig.slots.memory === plugin.id
pluginsConfig.slots.memory === plugin.id ||
plugin.enabledByDefault === true
);
})
.map((plugin) => plugin.id);