#11746: fix: treat meta config paths as no-op to prevent unnecessary gateway restarts
gateway
stale
Cluster:
Gateway Hot-Reload Improvements
## 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
#8473: fix(gateway): prevent spurious restarts on meta.lastTouchedAt changes
by adam-smeth · 2026-02-04
91.0%
#11280: fix(gateway): add meta prefix to reload rules to prevent double SIG...
by cheenu1092-oss · 2026-02-07
90.7%
#13408: fix(gateway): skip SIGUSR1 restart in config.patch for noop reload ...
by rwmjhb · 2026-02-10
82.9%
#5823: fix(config): exit cleanly on invalid config instead of high CPU loop
by gavinbmoore · 2026-02-01
77.1%
#22720: fix: notify sessions on invalid config during hot-reload
by jayleekr · 2026-02-21
76.3%
#4108: gateway: hot-reload heartbeat when agents.list changes
by jifanchn · 2026-01-29
75.1%
#7747: Gateway: add zero-latency hot-reload for agent bindings
by NikolasP98 · 2026-02-03
75.0%
#12953: fix: defer gateway restart until all replies are sent
by zoskebutler · 2026-02-10
74.5%
#20355: fix(gateway): enforce commands.restart guard for config.apply and c...
by Clawborn · 2026-02-18
74.1%
#12048: fix: deduplicate config warnings to log once instead of on every re...
by mcaxtr · 2026-02-08
73.8%