fix: bedrock reasoning issue (#25303)

This commit is contained in:
Aiden Cline 2026-05-01 11:15:17 -05:00 committed by GitHub
commit 29ec07700c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View file

@ -938,10 +938,18 @@ export const toModelMessagesEffect = Effect.fnUntraced(function* (
})
}
if (part.type === "reasoning") {
if (differentModel) {
if (part.text.trim().length > 0)
assistantMessage.parts.push({
type: "text",
text: part.text,
})
continue
}
assistantMessage.parts.push({
type: "reasoning",
text: part.text,
...(differentModel ? {} : { providerMetadata: part.metadata }),
providerMetadata: part.metadata,
})
}
}