Repository navigation
Commit ca443ca
committed
fix(responses): keep untyped assistant messages inside their tool-call turn
ZCode sends assistant text as the Responses message shorthand
({role, content} with no type). isAssistantTurnItem only recognized a typed
message, so the shorthand closed the assistant turn and
backfillBareToolCallTurnReasoning inserted its placeholder after the text
instead of at the head of the turn. DeepSeek's thinking mode rejects that
ordering with "The reasoning_text in the thinking mode must be passed back to
the API", and every continuation of the session fails the same way.
Normalize the item type the way the Responses parser already does, so a
shorthand with role=assistant belongs to the surrounding assistant turn. The
placeholder then precedes the whole turn, matching the typed-message shape
that already passes.1 parent 98bd8c0 commit ca443ca
2 files changed
Lines changed: 27 additions & 4 deletions
File tree
- src/adapters/openai-responses
- tests/providers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
72 | 90 | | |
73 | 91 | | |
0 commit comments