Skip to content

Commit 86a37aa

Browse files
authored
fix(core): reset pendingFeedbackMessage in ConversationHistory.reset() (#2055)
The reset() method was not clearing pendingFeedbackMessage, causing stale "The previous action has been executed" context to leak into the first planning turn of subsequent MCP tool calls. This made the planning model incorrectly conclude the task was already completed without performing any action.
1 parent 9c232c0 commit 86a37aa

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/core/src/ai-model/conversation-history.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export class ConversationHistory {
4242
this.memories.length = 0;
4343
this.subGoals.length = 0;
4444
this.historicalLogs.length = 0;
45+
this.pendingFeedbackMessage = '';
4546
}
4647

4748
/**

packages/core/tests/unit-test/conversation-history.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ describe('ConversationHistory', () => {
5454
history.appendHistoricalLog('Step 1');
5555
history.appendHistoricalLog('Step 2');
5656

57+
history.pendingFeedbackMessage = 'Current time: 2026-03-02T16:04:00';
58+
5759
history.reset();
5860

5961
expect(history.length).toBe(0);
@@ -62,6 +64,7 @@ describe('ConversationHistory', () => {
6264
expect(history.memoriesToText()).toBe('');
6365
expect(history.subGoalsToText()).toBe('');
6466
expect(history.historicalLogsToText()).toBe('');
67+
expect(history.pendingFeedbackMessage).toBe('');
6568
});
6669

6770
it('clears pending feedback message only when set', () => {

0 commit comments

Comments
 (0)