diff options
| author | Aiden Cline <[email protected]> | 2026-01-19 12:18:17 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2026-01-19 12:18:17 -0600 |
| commit | 3fd0043d1907b0e565cee73fff0f4725f7c8c0d5 (patch) | |
| tree | 60b6442017e5d746d2e9d719dbb9d80d3ea1fa42 | |
| parent | 092428633fe05b33c26a94549d6e65d2235da514 (diff) | |
| download | opencode-3fd0043d1907b0e565cee73fff0f4725f7c8c0d5.tar.gz opencode-3fd0043d1907b0e565cee73fff0f4725f7c8c0d5.zip | |
chore: handle fields other than reasoning_content in interleaved block
| -rw-r--r-- | packages/opencode/src/provider/transform.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index f6b7ec8cb..c983bf32c 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -123,11 +123,8 @@ export namespace ProviderTransform { return result } - if ( - model.capabilities.interleaved && - typeof model.capabilities.interleaved === "object" && - model.capabilities.interleaved.field === "reasoning_content" - ) { + if (typeof model.capabilities.interleaved === "object" && model.capabilities.interleaved.field) { + const field = model.capabilities.interleaved.field return msgs.map((msg) => { if (msg.role === "assistant" && Array.isArray(msg.content)) { const reasoningParts = msg.content.filter((part: any) => part.type === "reasoning") @@ -136,7 +133,7 @@ export namespace ProviderTransform { // Filter out reasoning parts from content const filteredContent = msg.content.filter((part: any) => part.type !== "reasoning") - // Include reasoning_content directly on the message for all assistant messages + // Include reasoning_content | reasoning_details directly on the message for all assistant messages if (reasoningText) { return { ...msg, @@ -145,7 +142,7 @@ export namespace ProviderTransform { ...msg.providerOptions, openaiCompatible: { ...(msg.providerOptions as any)?.openaiCompatible, - reasoning_content: reasoningText, + [field]: reasoningText, }, }, } |
