Pass fromHook to appendCompaction for both manual and auto compaction

This commit is contained in:
Mario Zechner 2025-12-29 23:18:03 +01:00
parent f118cdc67b
commit d4dc07ab20
2 changed files with 10 additions and 3 deletions

View file

@ -965,7 +965,7 @@ export class AgentSession {
throw new Error("Compaction cancelled");
}
this.sessionManager.appendCompaction(summary, firstKeptEntryId, tokensBefore, details);
this.sessionManager.appendCompaction(summary, firstKeptEntryId, tokensBefore, details, fromHook);
const newEntries = this.sessionManager.getEntries();
const sessionContext = this.sessionManager.buildSessionContext();
this.agent.replaceMessages(sessionContext.messages);
@ -1139,7 +1139,7 @@ export class AgentSession {
return;
}
this.sessionManager.appendCompaction(summary, firstKeptEntryId, tokensBefore, details);
this.sessionManager.appendCompaction(summary, firstKeptEntryId, tokensBefore, details, fromHook);
const newEntries = this.sessionManager.getEntries();
const sessionContext = this.sessionManager.buildSessionContext();
this.agent.replaceMessages(sessionContext.messages);