1
0

feat: consolidate file write, move, grep, and delete operations into unified tools and update context compaction heuristics

This commit is contained in:
2026-03-06 01:14:56 +01:00
parent 7a6e9785d6
commit 003345edc0
6 changed files with 230 additions and 261 deletions

View File

@@ -71,10 +71,10 @@ internal sealed partial class ContextCompactor(IChatClient client)
string reason = "";
// Rule 1: Deduplication. If we have already seen this file in a newer message (since we are walking backward), redact this one.
if (filesRead.TryGetValue(filePath, out int count) && count >= 3)
if (filesRead.TryGetValue(filePath, out int count) && count >= 5)
{
shouldRedact = true;
reason = "deduplication — you read this file 3 or more times later";
reason = "deduplication — you read this file 5 or more times later";
}
// Rule 2: TTL. If this was read 2 or more user turns ago, redact it.
else if (userTurnsSeen >= 2)