Commit 64a0ecf
committed
fix: return synthetic empty text on Anthropic empty content response
Anthropic returns an empty content array (stop_reason=end_turn) after
side-effect-only tool calls like react or skip — the model has nothing
further to say but the response is valid.
Previously this was treated as an error, exhausting retries and falling
through to the next model in the fallback chain, which then failed for
unrelated reasons (e.g. deepseek-reasoner expecting reasoning_content).
Return a synthetic empty Text response instead so the agentic loop
terminates gracefully.1 parent 931105c commit 64a0ecf
1 file changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
1256 | | - | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1257 | 1262 | | |
1258 | | - | |
| 1263 | + | |
1259 | 1264 | | |
1260 | | - | |
1261 | | - | |
| 1265 | + | |
1262 | 1266 | | |
1263 | | - | |
1264 | | - | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1265 | 1271 | | |
1266 | 1272 | | |
1267 | 1273 | | |
| |||
0 commit comments