Commit b79eb71
committed
fix(anthropic): treat a blank tool_use id as absent, not as an id
`block.id ?? synthesizeToolUseId()` only synthesizes when the field is
missing. An Anthropic-compatible relay that sends "" or " " satisfies
the nullish check, so the call went out carrying a blank id and the
client had nothing to echo back — the next turn cannot pair the result
with its call.
usableToolUseId() treats blank as absent. Both the streaming
content_block_start path and the non-stream block path use it.
Last item of #765's tool-id half. Ablated: restoring the ?? form fails
the new blank-id test for both "" and " ".1 parent ebd4cdf commit b79eb71
2 files changed
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
269 | 279 | | |
270 | 280 | | |
271 | 281 | | |
| |||
824 | 834 | | |
825 | 835 | | |
826 | 836 | | |
827 | | - | |
| 837 | + | |
828 | 838 | | |
829 | 839 | | |
830 | 840 | | |
| |||
938 | 948 | | |
939 | 949 | | |
940 | 950 | | |
941 | | - | |
| 951 | + | |
942 | 952 | | |
943 | 953 | | |
944 | 954 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
70 | 92 | | |
71 | 93 | | |
72 | 94 | | |
| |||
0 commit comments