Repository navigation
Commit 29195ec
authored
fix: match vendor-prefixed gateway model ids such as OpenRouter's (#731)
### Summary
Fixes [IJAI-5619](https://youtrack.jetbrains.com/issue/IJAI-5619): a
Codex session set up through `providers/set` with an OpenRouter key
showed no models, so the client hid the model picker.
Since #627, `providers/set` fetches the gateway's `GET {baseUrl}/models`
and keeps only the Codex models it lists. Ids were compared without case
or date suffix, but OpenRouter lists models as `vendor/model`
(`openai/gpt-6.1-sol`). No Codex model matched, so `session/new` and
`session/resume` returned `availableModels: []` and no `model` config
option. The reporter's log shows exactly this after the switch to the
OpenRouter proxy.
- `normalizeModelId` now also drops a `vendor/` prefix, so
`openai/gpt-5.4` matches `gpt-5.4`. The narrowing and the "listed thread
model is kept" check both go through it.
- `readme-dev.md` describes the new matching rule.1 parent caf2e87 commit 29195ec
3 files changed
Lines changed: 14 additions & 5 deletions
File tree
- src
- __tests__/CodexACPAgent
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
0 commit comments