fix: reduce invalid config log noise

This commit is contained in:
Peter Steinberger
2026-01-22 02:47:42 +00:00
parent f1aa260b0e
commit 9d22646120
2 changed files with 6 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ Docs: https://docs.clawd.bot
- Signal: add typing indicators and DM read receipts via signal-cli. - Signal: add typing indicators and DM read receipts via signal-cli.
### Fixes ### Fixes
- Config: avoid stack traces for invalid configs and log the config path.
- Doctor: warn when gateway.mode is unset with configure/config guidance. - 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) - 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. - UI: refresh debug panel on route-driven tab changes. (#1373) Thanks @yazinsai.

View File

@@ -247,7 +247,7 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) {
.join("\n"); .join("\n");
if (!loggedInvalidConfigs.has(configPath)) { if (!loggedInvalidConfigs.has(configPath)) {
loggedInvalidConfigs.add(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"); const error = new Error("Invalid config");
(error as { code?: string; details?: string }).code = "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); deps.logger.error(err.message);
throw err; throw err;
} }
const error = err as { code?: string };
if (error?.code === "INVALID_CONFIG") {
return {};
}
deps.logger.error(`Failed to read config at ${configPath}`, err); deps.logger.error(`Failed to read config at ${configPath}`, err);
return {}; return {};
} }