Commit 502b4ac
a.dmitriev
fix(mcp): match language model by provider+model, fall back when displayName absent
The MCP tool schema for ask_codebase omits displayName from the request
shape (@sourcebot/mcp uses .omit({ displayName: true })). When an LLM
agent selects a model it can only pass {provider, model}, so the previous
getLanguageModelKey-based match (which includes displayName) always
produced a key like 'anthropic-claude-opus-4-7-undefined' vs the
configured 'anthropic-claude-opus-4-7-Claude Opus 4.7', causing a 400
for any explicit model selection.
New logic: match on provider + model always; honour displayName only when
the caller actually provides it, preserving disambiguation between two
models that share the same provider/model but differ in displayName
(e.g. two opus-4-7 entries with different reasoningEffort).
Fixes #11371 parent 105ddf4 commit 502b4ac
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
0 commit comments