Skip to content

Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.

fix: improve warning messages when config files can't be parsed

0xk3vin0015c658faa4
diff --git a/src/install.ts b/src/install.ts
index ed6d1dc..782f2e5 100644
--- a/src/install.ts
+++ b/src/install.ts
@@ -276,7 +276,8 @@ async function setupOpencodeMcpConfig(runtime: CommandRuntime): Promise<void> {
} catch {
const backup = `${OPENCODE_CONFIG_PATH}.bak`;
fs.copyFileSync(OPENCODE_CONFIG_PATH, backup);
- info(`Backed up malformed config to ${pc.dim(backup)}`);
+ warn(`Could not parse ${pc.dim(OPENCODE_CONFIG_PATH)}; backed it up to ${pc.dim(backup)}.`);
+ warn("Created a fresh config with only the megamemory entry. Merge your old settings from the backup if needed.");
config = {};
}
}
@@ -318,7 +319,8 @@ async function setupClaudeConfig(runtime: CommandRuntime): Promise<void> {
} catch (err) {
const backup = `${CLAUDE_CONFIG_PATH}.bak`;
fs.copyFileSync(CLAUDE_CONFIG_PATH, backup);
- warn(`Malformed ${pc.dim(CLAUDE_CONFIG_PATH)} detected; backed it up to ${pc.dim(backup)}`);
+ warn(`Could not parse ${pc.dim(CLAUDE_CONFIG_PATH)}; backed it up to ${pc.dim(backup)}.`);
+ warn("Created a fresh config with only the megamemory entry. Merge your old settings from the backup if needed.");
throw new Error(
err instanceof Error
? `Could not parse ${CLAUDE_CONFIG_PATH}: ${err.message}`
@@ -357,7 +359,8 @@ async function setupAntigravityConfig(runtime: CommandRuntime): Promise<void> {
} catch {
const backup = `${ANTIGRAVITY_CONFIG_PATH}.bak`;
fs.copyFileSync(ANTIGRAVITY_CONFIG_PATH, backup);
- warn(`Malformed ${pc.dim(ANTIGRAVITY_CONFIG_PATH)} detected; backed it up to ${pc.dim(backup)}`);
+ warn(`Could not parse ${pc.dim(ANTIGRAVITY_CONFIG_PATH)}; backed it up to ${pc.dim(backup)}.`);
+ warn("Created a fresh config with only the megamemory entry. Merge your old settings from the backup if needed.");
config = {};
}
}