Commit d9e7191
committed
fix(brains): raise on Cohere upstream HTTP error instead of empty stream
A non-2xx response from Cohere's /v2/chat (429 rate limit, 401 bad key,
5xx) returns a JSON error body rather than newline-delimited content-delta
events. The stream loop skipped every non-event line and ended yielding
nothing, so the hub returned a silent empty completion with no diagnostic.
The anthropic and openai-compat adapters already guard this; mirror that
behaviour here and surface the status + body snippet as a RuntimeError.1 parent e06dc03 commit d9e7191
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
94 | 108 | | |
95 | 109 | | |
96 | 110 | | |
| |||
0 commit comments