Summary
In src/auto-reply/usage-bar/template.ts, the module-level fileCache Map holds a live fs.watch watcher for each cached template file path. The cache grows without bound — entries are never evicted, and watchers are only closed in clearUsageBarTemplateCacheForTest().
Reproduction
Source inspection: cacheTemplateFile() at line 146 inserts without checking cache size. Each new file path creates a persistent watcher.
Expected
Add a max size limit and evict the oldest entry (closing its watcher) before inserting new ones.
Scope
src/auto-reply/usage-bar/template.ts — 1 file, ~8 LoC change.
Summary
In
src/auto-reply/usage-bar/template.ts, the module-levelfileCacheMap holds a livefs.watchwatcher for each cached template file path. The cache grows without bound — entries are never evicted, and watchers are only closed inclearUsageBarTemplateCacheForTest().Reproduction
Source inspection:
cacheTemplateFile()at line 146 inserts without checking cache size. Each new file path creates a persistent watcher.Expected
Add a max size limit and evict the oldest entry (closing its watcher) before inserting new ones.
Scope
src/auto-reply/usage-bar/template.ts— 1 file, ~8 LoC change.