From a95e38485d2ee690dcb93193a428463f712c2173 Mon Sep 17 00:00:00 2001 From: Dotta Date: Wed, 4 Mar 2026 09:58:30 -0600 Subject: [PATCH] fix: doctor command auto-creates directories and treats LLM as optional Instead of showing alarming warnings on first run when storage, log, and database directories don't exist, the doctor checks now silently create them and report pass. LLM provider is treated as optional rather than a warning when not configured. Co-Authored-By: Claude Opus 4.6 --- cli/src/checks/database-check.ts | 10 +--------- cli/src/checks/llm-check.ts | 12 ++++-------- cli/src/checks/log-check.ts | 10 +--------- cli/src/checks/storage-check.ts | 11 +---------- 4 files changed, 7 insertions(+), 36 deletions(-) diff --git a/cli/src/checks/database-check.ts b/cli/src/checks/database-check.ts index 43aff1d2..4d4ef811 100644 --- a/cli/src/checks/database-check.ts +++ b/cli/src/checks/database-check.ts @@ -39,15 +39,7 @@ export async function databaseCheck(config: PaperclipConfig, configPath?: string const dataDir = resolveRuntimeLikePath(config.database.embeddedPostgresDataDir, configPath); const reportedPath = dataDir; if (!fs.existsSync(dataDir)) { - return { - name: "Database", - status: "warn", - message: `Embedded PostgreSQL data directory does not exist: ${reportedPath}`, - canRepair: true, - repair: () => { - fs.mkdirSync(reportedPath, { recursive: true }); - }, - }; + fs.mkdirSync(reportedPath, { recursive: true }); } return { diff --git a/cli/src/checks/llm-check.ts b/cli/src/checks/llm-check.ts index 3a4dd0c7..5bb5b14e 100644 --- a/cli/src/checks/llm-check.ts +++ b/cli/src/checks/llm-check.ts @@ -5,20 +5,16 @@ export async function llmCheck(config: PaperclipConfig): Promise { if (!config.llm) { return { name: "LLM provider", - status: "warn", - message: "No LLM provider configured", - canRepair: false, - repairHint: "Run `paperclipai configure --section llm` to set one up", + status: "pass", + message: "No LLM provider configured (optional)", }; } if (!config.llm.apiKey) { return { name: "LLM provider", - status: "warn", - message: `${config.llm.provider} configured but no API key set`, - canRepair: false, - repairHint: "Run `paperclipai configure --section llm`", + status: "pass", + message: `${config.llm.provider} configured but no API key set (optional)`, }; } diff --git a/cli/src/checks/log-check.ts b/cli/src/checks/log-check.ts index 0d68b5cf..7599d752 100644 --- a/cli/src/checks/log-check.ts +++ b/cli/src/checks/log-check.ts @@ -8,15 +8,7 @@ export function logCheck(config: PaperclipConfig, configPath?: string): CheckRes const reportedDir = logDir; if (!fs.existsSync(logDir)) { - return { - name: "Log directory", - status: "warn", - message: `Log directory does not exist: ${reportedDir}`, - canRepair: true, - repair: () => { - fs.mkdirSync(reportedDir, { recursive: true }); - }, - }; + fs.mkdirSync(reportedDir, { recursive: true }); } try { diff --git a/cli/src/checks/storage-check.ts b/cli/src/checks/storage-check.ts index aff69b36..7cb95a4b 100644 --- a/cli/src/checks/storage-check.ts +++ b/cli/src/checks/storage-check.ts @@ -7,16 +7,7 @@ export function storageCheck(config: PaperclipConfig, configPath?: string): Chec if (config.storage.provider === "local_disk") { const baseDir = resolveRuntimeLikePath(config.storage.localDisk.baseDir, configPath); if (!fs.existsSync(baseDir)) { - return { - name: "Storage", - status: "warn", - message: `Local storage directory does not exist: ${baseDir}`, - canRepair: true, - repair: () => { - fs.mkdirSync(baseDir, { recursive: true }); - }, - repairHint: "Run with --repair to create local storage directory", - }; + fs.mkdirSync(baseDir, { recursive: true }); } try {