feat(core): implement bounded history retention for GeminiChat

- Improved ToolOutputMaskingService to mask exceptionally large outputs (> 2x threshold) even in the latest turn.
- Implemented pruneHistory in GeminiChat with configurable turn and token limits to provide a hard safety net against OOM.
- Added getters and initialization for experimental history truncation settings in Config.
- Added comprehensive unit tests in geminiChat_pruning.test.ts.
- Verified with npm test and build.
This commit is contained in:
Gal Zahavi
2026-04-03 02:48:40 +00:00
parent 57eea87d41
commit 8aef2a400b
7 changed files with 346 additions and 9 deletions
+5 -2
View File
@@ -166,8 +166,11 @@ too aggressively.
ChatRecordingService and GeminiChat history).
- [x] Implement bounded retention for ChatRecordingService (implemented
memory-based cache eviction and leak prevention during resets).
- [ ] Implement bounded retention for GeminiChat (improve Tool Output Masking
or add hard history bounds).
- [x] Implement bounded retention for GeminiChat (improve Tool Output Masking
or add hard history bounds). - Improved `ToolOutputMaskingService` to
mask massive outputs (> 2x threshold) even in the latest turn. -
Implemented `pruneHistory` in `GeminiChat` with configurable turn and
token limits to provide a hard memory safety net.
- [ ] Audit React/Ink components for event listener leaks.
3. **Phase 3: Validation & CI**