mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(doctor): suppress clean-state repair trailer (#103233)
Co-authored-by: Ke Wang <ke@pika.art>
This commit is contained in:
co-authored by
Ke Wang
parent
b752384586
commit
0fa49ad4dd
@@ -3213,6 +3213,26 @@ describe("doctor health contributions", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("does not suggest --fix after a clean doctor run", async () => {
|
||||
const cfg = {};
|
||||
const runtime = { log: vi.fn(), error: vi.fn(), exit: vi.fn() };
|
||||
|
||||
await requireDoctorContribution("doctor:write-config").run({
|
||||
cfg,
|
||||
cfgForPersistence: cfg,
|
||||
configResult: { cfg, shouldWriteConfig: false },
|
||||
configPath: "/tmp/fake-openclaw.json",
|
||||
sourceConfigValid: true,
|
||||
prompter: buildDoctorPrompter(false),
|
||||
runtime,
|
||||
options: {},
|
||||
env: {},
|
||||
} as DoctorContributionRunContext);
|
||||
|
||||
expect(mocks.replaceConfigFile).not.toHaveBeenCalled();
|
||||
expect(runtime.log).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("config size drops during update", () => {
|
||||
beforeEach(() => {
|
||||
mocks.replaceConfigFile.mockReset();
|
||||
|
||||
@@ -1268,7 +1268,6 @@ async function runGatewayDaemonHealth(ctx: DoctorHealthFlowContext): Promise<voi
|
||||
}
|
||||
|
||||
async function runWriteConfigHealth(ctx: DoctorHealthFlowContext): Promise<void> {
|
||||
const { formatCliCommand } = await loadCommandFormatModule();
|
||||
const { applyWizardMetadata } = await loadOnboardHelpersModule();
|
||||
const { replaceConfigFile } = await loadConfigModule();
|
||||
const { logConfigUpdated } = await import("../config/logging.js");
|
||||
@@ -1312,10 +1311,6 @@ async function runWriteConfigHealth(ctx: DoctorHealthFlowContext): Promise<void>
|
||||
if (fs.existsSync(backupPath)) {
|
||||
ctx.runtime.log(`Backup: ${shortenHomePath(backupPath)}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!ctx.prompter.shouldRepair) {
|
||||
ctx.runtime.log(`Run "${formatCliCommand("openclaw doctor --fix")}" to apply changes.`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user