Commit 68d6b94
fix(routing): undefined model guard, codex regex, capabilities type narrowing (#5)
- getModelMode: return "chat" early when modelId is falsy — prevents
TypeError crash on requests missing the model field
- isResponsesOnlyModel: anchor codex check with word boundaries
(/(?:^|-)codex(?:-|$)/) to avoid false-positives on future codex-mini
- ModelCapabilities.type: narrow to "chat"|"responses"|(string & {})
so routing logic is type-checked against known upstream values
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 394203a commit 68d6b94
2 files changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
0 commit comments