← Back to PRs

#20822: fix(config): deduplicate config warnings to prevent log spam

by marcodelpin open 2026-02-19 10:08 View on GitHub →
size: XS
## Summary - Deduplicate config warning logs so each unique warning is emitted once per gateway session - Applies the same pattern already used for config errors (`loggedInvalidConfigs`) - Prevents event loop saturation from repeated warning generation every ~10-15s ## Problem When a plugin manifest ID doesn't match its config entry key, the mismatch warning is re-generated and re-logged on every config reload cycle (~10-15 seconds). This causes: - **Message latency**: 34-317 seconds to process messages - **Memory**: +500MB RSS from repeated validation - **WebSocket drops**: Event loop starvation The same problem affects **all** config warnings, including "plugin disabled but config is present" warnings (#12005). ## Changes `src/config/io.ts`: Added `loggedConfigWarnings` Set that tracks already-emitted warning strings. Both warning log sites (loadConfig and readConfigFileSnapshot) now check this set before logging. **+7 lines changed, minimal and safe.** ## Test plan - [ ] Start gateway with a plugin ID mismatch (manifest `id: "foo"`, config entry `openclaw-plugin-foo`) - [ ] Verify warning appears once at startup - [ ] Verify warning does NOT repeat on subsequent config reload cycles - [ ] Verify a *new* warning (different message) still appears after config change - [ ] Disable a plugin with config present, verify "disabled but config present" warning appears once only Fixes #19428 Fixes #12005 --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) Testing: fully tested (automated + manual verification) I understand and can explain all changes in this PR.

Most Similar PRs