fixing parsing v2 thanks to @cte (#3520)

* fixing parsing v2 thanks to @cte

* fixing parsing v2 thanks to @cte

* cleaner PR

---------

Co-authored-by: Cline Evaluation <cline@example.com>
This commit is contained in:
pashpashpash 2025-05-13 15:58:29 -07:00 committed by GitHub
parent 7937530c74
commit c617d2550e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -346,9 +346,8 @@ export function parseAssistantMessageV2(assistantMessage: string): AssistantMess
// (e.g., if content is empty or parsing logic prioritizes tool close)
const contentParamName: ToolParamName = "content"
if (
(currentToolUse.name === "write_to_file" || currentToolUse.name === "new_rule") &&
!(contentParamName in currentToolUse.params) && // Only if not already parsed
toolContentSlice.includes(`<${contentParamName}>`) // Check if tag exists
currentToolUse.name === "write_to_file" /* || currentToolUse.name === "new_rule" */ &&
toolContentSlice.includes(`<${contentParamName}>`)
) {
const contentStartTag = `<${contentParamName}>`
const contentEndTag = `</${contentParamName}>`