Commit 7dc3633
committed
fix: disable tools for deepseek-reasoner and strip <think> tags from text parts
DeepSeek R1 (deepseek-reasoner) does not honour the tools parameter on the
standard api.deepseek.com endpoint despite models.dev reporting tool_call: true.
When tools are sent, R1 ignores them and writes the invocation as markdown text,
causing tool calls to appear as plain text instead of being executed.
- llm.ts: disable canTool for deepseek-reasoner so tools are never sent to it,
avoiding the markdown-text fallback entirely
- processor.ts: strip <think>...</think> blocks from text parts for reasoning
models that emit chain-of-thought inline rather than as dedicated reasoning
events, preventing raw thinking tokens from appearing in the UI1 parent 4bf976e commit 7dc3633
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
197 | 205 | | |
198 | 206 | | |
199 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
445 | 452 | | |
446 | 453 | | |
447 | 454 | | |
| |||
0 commit comments