fix: repair doctor config cleanup

This commit is contained in:
Peter Steinberger
2026-01-20 01:30:33 +00:00
parent 3036c38144
commit 8e33bd8610
4 changed files with 116 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
import fs from "node:fs";
import { intro as clackIntro, outro as clackOutro } from "@clack/prompts";
import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agents/agent-scope.js";
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";
@@ -251,6 +253,10 @@ export async function doctorCommand(
cfg = applyWizardMetadata(cfg, { command: "doctor", mode: resolveMode(cfg) });
await writeConfigFile(cfg);
runtime.log(`Updated ${CONFIG_PATH_CLAWDBOT}`);
const backupPath = `${CONFIG_PATH_CLAWDBOT}.bak`;
if (fs.existsSync(backupPath)) {
runtime.log(`Backup: ${backupPath}`);
}
} else {
runtime.log('Run "clawdbot doctor --fix" to apply changes.');
}