Commit 2765196
fix: handle unclosed
When the small model hits its token limit mid-generation, `<think>` tags
may not have a closing `</think>`. The previous regex required a closing
tag, which would leak the entire reasoning block into the enhanced prompt.
Now `stripThinkTags()` matches both closed and unclosed think blocks.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com><think> tags from truncated model output1 parent ea70958 commit 2765196
2 files changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
| |||
0 commit comments