Improved how the AI remembers its earlier tool calls (#1185)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Peer HogeterpandThorsten Sommer authored and GitHub committed 2026-11-12 19:57:28 +01:00
1 parent 0885862150
commit 382db4b8d0
22 files changed
+1323 -24

No files matched your search

@@ -155,10 +155,15 @@ public sealed record ConversationParts
if (string.IsNullOrWhiteSpace(text.Text))
continue;
//
// An earlier answer travels with the note of the tools and sources it rested on, see
// ToolCallHistoryNote.TextForModel, so it is counted with it. The note of an answer does
// not change anymore, so the text stays the same and its count stays in the cache.
//
if (text.IsStreaming)
growing.Add(text.Text);
else
texts.Add(text.Text);
texts.Add(ToolCallHistoryNote.TextForModel(block, text.Text));
Sort(text.FileAttachments, documents, ref images);
}