mirror of
https://github.com/thedotmack/claude-mem
synced 2026-04-25 17:15:04 +02:00
fix: restore assistant replies to conversationHistory in OpenRouterAgent
The extracted helper methods (handleInitResponse, processObservationMessage, processSummaryMessage) lost the conversationHistory.push calls for assistant replies, breaking multi-turn context for queryOpenRouterMultiTurn. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -178,6 +178,7 @@ export class OpenRouterAgent {
|
||||
model: string
|
||||
): Promise<void> {
|
||||
if (initResponse.content) {
|
||||
session.conversationHistory.push({ role: 'assistant', content: initResponse.content });
|
||||
const tokensUsed = initResponse.tokensUsed || 0;
|
||||
session.cumulativeInputTokens += Math.floor(tokensUsed * 0.7);
|
||||
session.cumulativeOutputTokens += Math.floor(tokensUsed * 0.3);
|
||||
@@ -268,6 +269,7 @@ export class OpenRouterAgent {
|
||||
|
||||
let tokensUsed = 0;
|
||||
if (obsResponse.content) {
|
||||
session.conversationHistory.push({ role: 'assistant', content: obsResponse.content });
|
||||
tokensUsed = obsResponse.tokensUsed || 0;
|
||||
session.cumulativeInputTokens += Math.floor(tokensUsed * 0.7);
|
||||
session.cumulativeOutputTokens += Math.floor(tokensUsed * 0.3);
|
||||
@@ -312,6 +314,7 @@ export class OpenRouterAgent {
|
||||
|
||||
let tokensUsed = 0;
|
||||
if (summaryResponse.content) {
|
||||
session.conversationHistory.push({ role: 'assistant', content: summaryResponse.content });
|
||||
tokensUsed = summaryResponse.tokensUsed || 0;
|
||||
session.cumulativeInputTokens += Math.floor(tokensUsed * 0.7);
|
||||
session.cumulativeOutputTokens += Math.floor(tokensUsed * 0.3);
|
||||
|
||||
Reference in New Issue
Block a user