Commit 3c24fe3
fix(models): generateStream capability-mismatch records the resolved backend name
Caught by Claude review bot on PR #638: `generateStream`'s catch was
hard-coding `undefined` as the backend, so capability-mismatch
failures (registry hit, capability check fail) produced
`backend: 'unknown'` rows even though the backend WAS found —
diverging from `embed` / `generate` which correctly pass the
captured `backend` variable. The F2 fix in commit fabef73 covered
the registry-miss case but missed the capability-mismatch path on
streams specifically.
Change: declare `let backend: ModelBackend | undefined` (matches
embed/generate) and pass `backend` (not `undefined`) into
`#recordFailure`. When `resolveGenerative()` throws (registry miss),
`backend` is still undefined and the row records `backend: 'unknown'`
as before. When `requireCapability()` throws, `backend` is the
resolved instance and the row records its actual name.
Test: new "records capability-mismatch on generateStream with the
resolved backend name" exercises a backend registered with
`stream: false` and asserts `backend: 'no-stream'` (not 'unknown')
+ `error_code: 'capability_unsupported'`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fabef73 commit 3c24fe3
2 files changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
278 | 295 | | |
279 | 296 | | |
0 commit comments