From da1abc5f0639162d9ae9660bf8ac3e84fc5be83e Mon Sep 17 00:00:00 2001 From: octo-patch Date: Mon, 20 Apr 2026 11:38:35 +0800 Subject: [PATCH] fix: pass MAX_MESSAGE_PAIRS_PER_AGENT to streaming conversation save (fixes #365) The processStreamInBackground method was calling saveConversationExchange without the maxHistorySize parameter, causing conversation history to grow unbounded when using streaming responses regardless of MAX_MESSAGE_PAIRS_PER_AGENT config. This aligns the streaming code path with the non-streaming path. --- typescript/src/orchestrator.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/typescript/src/orchestrator.ts b/typescript/src/orchestrator.ts index a14718de..aa71912c 100644 --- a/typescript/src/orchestrator.ts +++ b/typescript/src/orchestrator.ts @@ -536,7 +536,8 @@ export class AgentSquad { this.storage, userId, sessionId, - agent.id + agent.id, + this.config.MAX_MESSAGE_PAIRS_PER_AGENT ); } } else {