diff --git a/src/commands/doctor-plugin-manifests.test.ts b/src/commands/doctor-plugin-manifests.test.ts index 8989535bd45..510f3ab6896 100644 --- a/src/commands/doctor-plugin-manifests.test.ts +++ b/src/commands/doctor-plugin-manifests.test.ts @@ -123,6 +123,7 @@ describe("doctor plugin manifest legacy contract repair", () => { }, runtime: createRuntime(), prompter: createPrompter(), + note: vi.fn(), }); const next = JSON.parse(fs.readFileSync(path.join(root, "openclaw.plugin.json"), "utf-8")) as { diff --git a/src/commands/doctor-plugin-manifests.ts b/src/commands/doctor-plugin-manifests.ts index bacb61f843a..f86d8e3ccb7 100644 --- a/src/commands/doctor-plugin-manifests.ts +++ b/src/commands/doctor-plugin-manifests.ts @@ -113,6 +113,7 @@ export async function maybeRepairLegacyPluginManifestContracts(params: { env?: NodeJS.ProcessEnv; runtime: RuntimeEnv; prompter: DoctorPrompter; + note?: typeof note; }): Promise { const migrations = collectLegacyPluginManifestContractMigrations( params.env ? { env: params.env } : undefined, @@ -121,7 +122,8 @@ export async function maybeRepairLegacyPluginManifestContracts(params: { return; } - note( + const emitNote = params.note ?? note; + emitNote( [ "Legacy plugin manifest capability keys detected.", ...migrations.flatMap((migration) => migration.changeLines), @@ -156,6 +158,6 @@ export async function maybeRepairLegacyPluginManifestContracts(params: { } if (applied.length > 0) { - note(applied.join("\n"), "Doctor changes"); + emitNote(applied.join("\n"), "Doctor changes"); } }