This commit is contained in:
2026-07-12 17:26:59 -04:00
parent 60663b8d4a
commit ba1bef8ff9
25 changed files with 158880 additions and 1529 deletions
+7
View File
@@ -138,6 +138,13 @@ class OllamaProvider {
content: rawContent
});
// Cap history — unbounded growth eventually overflows num_ctx,
// which silently truncates the system prompt (memories, tool docs)
const maxHistory = this.config.maxHistory || 30;
if (this.messages.length > maxHistory) {
this.messages.splice(0, this.messages.length - maxHistory);
}
// The text() closure strips markdown code fences so consumers
// (processResponse, getToolCalls) get clean content.
const result = {