diff --git a/CHANGELOG.md b/CHANGELOG.md index 279284fbc..d350d3a63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Docs: https://docs.clawd.bot - Signal: add typing indicators and DM read receipts via signal-cli. ### Fixes +- Config: avoid stack traces for invalid configs and log the config path. - Doctor: warn when gateway.mode is unset with configure/config guidance. - macOS: include Textual syntax highlighting resources in packaged app to prevent chat crashes. (#1362) - UI: refresh debug panel on route-driven tab changes. (#1373) Thanks @yazinsai. diff --git a/src/config/io.ts b/src/config/io.ts index d275d3185..6994e4485 100644 --- a/src/config/io.ts +++ b/src/config/io.ts @@ -247,7 +247,7 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) { .join("\n"); if (!loggedInvalidConfigs.has(configPath)) { loggedInvalidConfigs.add(configPath); - deps.logger.error(`Invalid config:\\n${details}`); + deps.logger.error(`Invalid config at ${configPath}:\\n${details}`); } const error = new Error("Invalid config"); (error as { code?: string; details?: string }).code = "INVALID_CONFIG"; @@ -299,6 +299,10 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) { deps.logger.error(err.message); throw err; } + const error = err as { code?: string }; + if (error?.code === "INVALID_CONFIG") { + return {}; + } deps.logger.error(`Failed to read config at ${configPath}`, err); return {}; }