fix(core): lower failed reasoning to text (#35735)
This commit is contained in:
parent
b6a2912bb1
commit
e3a39b214f
2 changed files with 4 additions and 4 deletions
|
|
@ -120,12 +120,12 @@ const assistant = (message: SessionMessage.Assistant, model: ModelV2.Ref) => {
|
|||
const content = message.content.flatMap((item): ContentPart[] => {
|
||||
if (item.type === "text") return [{ type: "text", text: item.text }]
|
||||
if (item.type === "reasoning")
|
||||
return sameModel
|
||||
return reuseProviderMetadata
|
||||
? [
|
||||
{
|
||||
type: "reasoning",
|
||||
text: item.text,
|
||||
providerMetadata: reuseProviderMetadata ? providerMetadata(model.providerID, item.state) : undefined,
|
||||
providerMetadata: providerMetadata(model.providerID, item.state),
|
||||
},
|
||||
]
|
||||
: item.text.length > 0
|
||||
|
|
|
|||
|
|
@ -461,7 +461,7 @@ Recent work
|
|||
])
|
||||
})
|
||||
|
||||
test("drops provider-native continuation metadata from failed assistant turns", () => {
|
||||
test("lowers failed assistant reasoning to text", () => {
|
||||
const messages = toLLMMessages(
|
||||
[
|
||||
SessionMessage.Assistant.make({
|
||||
|
|
@ -501,7 +501,7 @@ Recent work
|
|||
)
|
||||
|
||||
expect(messages[0]?.content).toEqual([
|
||||
{ type: "reasoning", text: "Partial thought", providerMetadata: undefined },
|
||||
{ type: "text", text: "Partial thought" },
|
||||
{
|
||||
type: "tool-call",
|
||||
id: "hosted-failed",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue