Summary
Add a config option to protect the most recent N tool calls from being pruned by AI analysis, while still allowing deduplication.
Proposed Config
Rationale
Recent tool outputs are more likely to be contextually relevant. This provides a safeguard independent of semantic analysis, while still allowing deduplication to remove obvious duplicates.
Implementation Notes
- Apply filter in
janitor.ts after deduplication phase, before AI analysis
- Deduplication should still be allowed to prune within the last N tools
- Should work alongside existing
protectedTools array
{ "protectRecentTools": 5 // Last 5 tool calls protected from AI pruning }