← Back to PRs

#12048: fix: deduplicate config warnings to log once instead of on every reload

by mcaxtr open 2026-02-08 19:28 View on GitHub →
size: S trusted-contributor experienced-contributor
## Summary Fixes #12005 - Config warnings (e.g., "plugin disabled but config is present") were logged on **every** `loadConfig()` call, producing thousands of duplicate entries in the error log over time - Added a module-level `loggedConfigWarnings` Set that tracks already-logged warning content, mirroring the existing `loggedInvalidConfigs` dedup pattern for error messages - Warnings are keyed by `configPath:details` so changed warnings (e.g., different plugin disabled) still get logged ## Test plan - [x] New test: repeated `loadConfig()` calls produce exactly 1 warning log (fails before fix, passes after) - [x] New test: changed config produces a new warning log (ensures dedup doesn't over-suppress) - [x] Full CI gate: `pnpm build && pnpm check && pnpm test` — all 249 tests pass - [x] Codex review: clean, no issues found <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates config loading to avoid repeatedly logging the same config warning on every `loadConfig()` call, and adds/adjusts tests to verify warnings are logged once per warning-content change. The changes fit into the existing config validation/logging flow in `src/config/io.ts`, extending the prior invalid-config dedup behavior to warning-level logs so long-running processes don’t spam logs during frequent reloads. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - The change is narrow (log deduplication), includes targeted tests for both repeated and changed-warning scenarios, and avoids unbounded memory growth by using a single last-warning key. - No files require special attention. <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs