Skip to content

Commit 1e86297

Browse files
committed
fix(cli): clarify plugin doctor scope
1 parent bd88f37 commit 1e86297

3 files changed

Lines changed: 19 additions & 38 deletions

File tree

‎docs/cli/plugins.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ The `--json` flag outputs a machine-readable report suitable for scripting and a
508508
openclaw plugins doctor
509509
```
510510

511-
`doctor` reports plugin load errors, manifest/discovery diagnostics, compatibility notices, and stale plugin config references such as missing plugin slots. When the install tree and plugin config are clean it prints `Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.` If stale config remains but the install tree is otherwise healthy, the summary says so instead of implying full plugin health.
511+
`doctor` reports plugin load errors, manifest/discovery diagnostics, compatibility notices, and stale plugin config references such as missing plugin slots. It loads plugin modules without activating plugins and does not query the running Gateway. When these local checks pass, it prints `Plugin discovery, module loading, compatibility, and configuration checks passed. Run "openclaw health" to check the running Gateway, including runtime quarantines and fallbacks.` The [health command](/cli/health) reads current runtime quarantine and fallback state from the Gateway. If stale config remains but the install tree is otherwise healthy, the summary says so instead of implying full plugin health.
512512

513513
If a configured plugin is present on disk but blocked by the loader's path-safety checks, config validation keeps the plugin entry and reports it as `present but blocked`. Fix the preceding blocked-plugin diagnostic, such as path ownership or world-writable permissions, instead of removing the `plugins.entries.<id>` or `plugins.allow` config.
514514

‎src/cli/plugins-cli.list.test.ts‎

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ const workshopMocks = vi.hoisted(() => ({
2222
detectToolPolicyDiagnostic: vi.fn(),
2323
}));
2424

25+
const cleanDoctorMessage =
26+
"Plugin discovery, module loading, compatibility, and configuration checks passed. " +
27+
'Run "openclaw health" to check the running Gateway, including runtime quarantines and fallbacks.';
28+
2529
vi.mock("../skills/workshop/tool-policy-diagnostic.js", () => ({
2630
detectSkillWorkshopToolPolicyDiagnostic: workshopMocks.detectToolPolicyDiagnostic,
2731
}));
@@ -93,9 +97,7 @@ describe("plugins cli list", () => {
9397
await runPluginsCommand(["plugins", "doctor"]);
9498

9599
expect(buildPluginDiagnosticsReport).toHaveBeenCalledWith({ config: {}, effectiveOnly: true });
96-
expect(runtimeLogs).toContain(
97-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
98-
);
100+
expect(runtimeLogs).toContain(cleanDoctorMessage);
99101
});
100102

101103
it("reports stale plugin config in doctor output without claiming full plugin health", async () => {
@@ -147,9 +149,7 @@ describe("plugins cli list", () => {
147149
expect(output).toContain(
148150
"No plugin install-tree issues detected; configuration warnings remain.",
149151
);
150-
expect(output).not.toContain(
151-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
152-
);
152+
expect(output).not.toContain(cleanDoctorMessage);
153153
});
154154

155155
it("reports missing configured Codex runtime plugin in doctor output", async () => {
@@ -195,9 +195,7 @@ describe("plugins cli list", () => {
195195
expect(output).toContain(
196196
"No plugin install-tree issues detected; configuration warnings remain.",
197197
);
198-
expect(output).not.toContain(
199-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
200-
);
198+
expect(output).not.toContain(cleanDoctorMessage);
201199
});
202200

203201
it("reports missing configured ACPX runtime plugin in doctor output", async () => {
@@ -219,9 +217,7 @@ describe("plugins cli list", () => {
219217
expect(output).toContain('Configured runtime "acpx" requires the ACPX Runtime plugin');
220218
expect(output).toContain("openclaw doctor --fix");
221219
expect(output).toContain("openclaw plugins install @openclaw/acpx");
222-
expect(output).not.toContain(
223-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
224-
);
220+
expect(output).not.toContain(cleanDoctorMessage);
225221
});
226222

227223
it("reports blocked configured ACPX runtime with ACP-specific guidance", async () => {
@@ -249,9 +245,7 @@ describe("plugins cli list", () => {
249245
expect(output).toContain("disable ACP/acpx in acp config");
250246
expect(output).not.toContain('runtime policy to "openclaw"');
251247
expect(output).not.toContain("openclaw plugins install @openclaw/acpx");
252-
expect(output).not.toContain(
253-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
254-
);
248+
expect(output).not.toContain(cleanDoctorMessage);
255249
});
256250

257251
it("reports disabled configured ACPX runtime with ACP-specific guidance", async () => {
@@ -274,9 +268,7 @@ describe("plugins cli list", () => {
274268
expect(output).toContain("disable ACP/acpx in acp config");
275269
expect(output).not.toContain('runtime policy to "openclaw"');
276270
expect(output).not.toContain("openclaw plugins install @openclaw/acpx");
277-
expect(output).not.toContain(
278-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
279-
);
271+
expect(output).not.toContain(cleanDoctorMessage);
280272
});
281273

282274
it("does not report implicit OpenAI Codex preference as configured runtime", async () => {
@@ -297,9 +289,7 @@ describe("plugins cli list", () => {
297289

298290
const output = runtimeLogs.join("\n");
299291
expect(output).not.toContain('Configured runtime "codex"');
300-
expect(output).toContain(
301-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
302-
);
292+
expect(output).toContain(cleanDoctorMessage);
303293
});
304294

305295
it("does not report configured Codex runtime when the plugin is enabled", async () => {
@@ -322,9 +312,7 @@ describe("plugins cli list", () => {
322312

323313
await runPluginsCommand(["plugins", "doctor"]);
324314

325-
expect(runtimeLogs).toContain(
326-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
327-
);
315+
expect(runtimeLogs).toContain(cleanDoctorMessage);
328316
});
329317

330318
it("reports configured Codex runtime when the plugin record is disabled", async () => {
@@ -352,9 +340,7 @@ describe("plugins cli list", () => {
352340
expect(output).toContain('but "codex" is disabled');
353341
expect(output).toContain('Enable the "codex" plugin');
354342
expect(output).not.toContain("openclaw plugins install @openclaw/codex");
355-
expect(output).not.toContain(
356-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
357-
);
343+
expect(output).not.toContain(cleanDoctorMessage);
358344
});
359345

360346
it("reports blocked configured Codex runtime without install advice", async () => {
@@ -386,9 +372,7 @@ describe("plugins cli list", () => {
386372
expect(output).toContain('Remove "codex" from plugins.deny');
387373
expect(output).not.toContain('Run "openclaw doctor --fix" to install');
388374
expect(output).not.toContain("openclaw plugins install @openclaw/codex");
389-
expect(output).not.toContain(
390-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
391-
);
375+
expect(output).not.toContain(cleanDoctorMessage);
392376
});
393377

394378
it("reports disabled configured Codex runtime entry without install advice", async () => {
@@ -422,9 +406,7 @@ describe("plugins cli list", () => {
422406
expect(output).toContain("Set plugins.entries.codex.enabled=true");
423407
expect(output).not.toContain('Run "openclaw doctor --fix" to install');
424408
expect(output).not.toContain("openclaw plugins install @openclaw/codex");
425-
expect(output).not.toContain(
426-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
427-
);
409+
expect(output).not.toContain(cleanDoctorMessage);
428410
});
429411

430412
it("reports config-selected plugin source shadowing in doctor output", async () => {
@@ -484,9 +466,7 @@ describe("plugins cli list", () => {
484466

485467
await runPluginsCommand(["plugins", "doctor"]);
486468

487-
expect(runtimeLogs).toContain(
488-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
489-
);
469+
expect(runtimeLogs).toContain(cleanDoctorMessage);
490470
});
491471

492472
it("reports persisted plugin registry state without refreshing", async () => {

‎src/cli/plugins-cli.runtime.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ export async function runPluginsDoctorCommand(): Promise<void> {
397397

398398
if (!hasInstallTreeIssues && pluginConfigWarnings.length === 0) {
399399
defaultRuntime.log(
400-
'Static plugin checks passed. Run "openclaw health" to check active runtime quarantine/fallback status.',
400+
"Plugin discovery, module loading, compatibility, and configuration checks passed. " +
401+
'Run "openclaw health" to check the running Gateway, including runtime quarantines and fallbacks.',
401402
);
402403
return;
403404
}

0 commit comments

Comments
 (0)