Multiple sources of unbounded memory growth caused V8 to OOM after ~50 minutes of auto-mode operation: 1. activity-log.ts: saveActivityLog serialized ALL session entries into a single string for SHA1 dedup, allocating hundreds of MB per unit cycle. Now uses streaming writes (writeSync per entry) and a lightweight fingerprint (entry count + last 3 entries hash) instead of full-content hashing. 2. activity-log.ts: activityLogState Map was never cleared between sessions, accumulating lastSnapshotKeyByUnit entries indefinitely. Added clearActivityLogState() export, called from stopAuto(). 3. auto.ts: completedUnits array grew unbounded for dashboard display. Now capped at 200 entries and cleared on stopAuto(). 4. paths.ts: dirEntryCache and dirListCache Maps grew without bounds between clearPathCache() calls. Added DIR_CACHE_MAX (200) eviction — when cache exceeds limit, it's cleared before adding new entries. Closes #611 |
||
|---|---|---|
| .. | ||
| agents | ||
| extensions | ||
| skills | ||
| GSD-WORKFLOW.md | ||