Commit 6cdad69
committed
fix(opencode): ensure reasoning_content for DeepSeek models, add thinking: enabled
DeepSeek requires reasoning_content in providerOptions.openaiCompatible for
all assistant messages, even when empty (the API rejects requests without it).
The generic interleaved handling only runs when capabilities.interleaved is
set to an object with a field, which may not always be the case for DeepSeek
models depending on models.dev data.
- Merge the reasoning part padding into a single DeepSeek‑specific block that
extracts reasoning parts to providerOptions.openaiCompatible.reasoning_content
and strips them from content (with return, skipping generic interleaved)
- Add result["thinking"] = { type: "enabled" } in options() so DeepSeek
reasoning models return reasoning_content in the first place1 parent d03e6ce commit 6cdad69
1 file changed
Lines changed: 28 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
| 179 | + | |
179 | 180 | | |
180 | | - | |
| 181 | + | |
181 | 182 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
186 | 191 | | |
187 | 192 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
192 | 201 | | |
193 | 202 | | |
194 | 203 | | |
| |||
907 | 916 | | |
908 | 917 | | |
909 | 918 | | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
910 | 928 | | |
911 | 929 | | |
912 | 930 | | |
| |||
0 commit comments