Skip to content

Commit a4373c8

Browse files
committed
fix(provider): set providerOptions for string-content assistant messages in reasoning fallback
The fallback transform only set reasoning_content in providerOptions for array-content messages. String-content assistant messages (e.g., "It's 4.") were converted to array form but didn't get providerOptions set. Now both content types get reasoning_content: "" injected with the correct SDK key, ensuring DeepSeek's API receives it on all assistant turns.
1 parent b6a7cdb commit a4373c8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/opencode/src/provider/transform.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,17 @@ function normalizeMessages(
246246
}
247247
}
248248
if (typeof msg.content === "string") {
249+
const sdk = sdkKey(model.api.npm) ?? "openaiCompatible"
249250
return {
250251
...msg,
251252
content: [{ type: "text" as const, text: msg.content }, { type: "reasoning" as const, text: "" }],
253+
providerOptions: {
254+
...msg.providerOptions,
255+
[sdk]: {
256+
...msg.providerOptions?.[sdk],
257+
reasoning_content: "",
258+
},
259+
},
252260
}
253261
}
254262
return msg

0 commit comments

Comments
 (0)