Commit 54ed3cb
a.dmitriev
fix(mcp): detect ambiguous model selection and return actionable 400
When displayName is absent and multiple configs share the same
provider+model, return a 400 that lists candidate displayNames instead
of silently picking the first match.
Matching logic:
- filter by provider+model to collect candidates
- if displayName provided: exact match on displayName within candidates
- if displayName absent and exactly one candidate: use it
- if displayName absent and multiple candidates: 400 with disambiguation hint1 parent 502b4ac commit 54ed3cb
1 file changed
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
65 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
70 | | - | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| |||
0 commit comments