Skip to content

Commit 26f7ba0

Browse files
committed
Pass clean conversation history to API for Anthropic
1 parent 468799e commit 26f7ba0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/stupid-pears-help.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Hotfix

src/core/Cline.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,9 @@ export class Cline {
807807
}
808808
}
809809

810-
const stream = this.api.createMessage(systemPrompt, this.apiConversationHistory)
810+
// Convert to Anthropic.MessageParam by spreading only the API-required properties
811+
const cleanConversationHistory = this.apiConversationHistory.map(({ role, content }) => ({ role, content }))
812+
const stream = this.api.createMessage(systemPrompt, cleanConversationHistory)
811813
const iterator = stream[Symbol.asyncIterator]()
812814

813815
try {

0 commit comments

Comments
 (0)