mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Fix gemini bug adding empty code block at end of text blocks
This commit is contained in:
parent
8974a9ce69
commit
bfed826033
1 changed files with 9 additions and 0 deletions
|
|
@ -934,6 +934,15 @@ export class Cline {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!block.partial) {
|
||||
// gemini models add this artifact to the end of text content:
|
||||
const TOOL_CODE_SUFFIX = "```tool_code"
|
||||
if (content?.trimEnd().endsWith(TOOL_CODE_SUFFIX)) {
|
||||
content = content.trimEnd().slice(0, -TOOL_CODE_SUFFIX.length)
|
||||
}
|
||||
}
|
||||
|
||||
await this.say("text", content, undefined, block.partial)
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue