← Back to PRs

#11746: fix: treat meta config paths as no-op to prevent unnecessary gateway restarts

by QDenka open 2026-02-08 07:52 View on GitHub →
gateway stale
## Summary `meta.lastTouchedAt` is updated on every config write but was not listed in `BASE_RELOAD_RULES`. Since `matchRule()` returns `null` for unknown paths, every config save triggered a full gateway restart via SIGUSR1. This caused: - ~50+ unnecessary gateway restarts per day - WebSocket disconnects (code 1012) - Webchat event gap errors (`expected seq X, got Y`) ## Fix Add `{ prefix: "meta", kind: "none" }` to `BASE_RELOAD_RULES` so all `meta.*` paths are classified as no-ops. ## Testing - Added unit test for `meta.lastTouchedAt` no-op behavior - All existing tests pass (`vitest run src/gateway/config-reload.test.ts` — 9/9 ✓) ## AI Disclosure This PR was AI-assisted (Claude). The fix was reviewed and understood — it's a one-line rule addition with a corresponding test. Fixes #11744 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a reload classification rule marking all `meta.*` config paths as no-ops (`{ prefix: "meta", kind: "none" }`) in `src/gateway/config-reload.ts`, and introduces a unit test ensuring `meta.lastTouchedAt` no longer triggers a gateway restart. This fits into the existing gateway config reload planning flow where changed config paths are matched against ordered reload rules; previously, unmatched paths defaulted to a full restart. By explicitly classifying `meta.*` as `none`, routine metadata writes (like `meta.lastTouchedAt`) won’t cause SIGUSR1 restarts and associated disconnects. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - Change is narrowly scoped (one additional reload rule + one focused unit test) and aligns with the documented behavior where unknown paths previously triggered restarts. Repository search shows no other conflicting `meta` reload rules, so the new prefix won’t shadow a more specific rule. - No files require special attention <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs