Commit bb8241a
committed
Validate context window against model capabilities in resolveApiModelId
resolveApiModelId now accepts optional ModelCapabilities and uses
resolveContextWindow to validate context window values before appending
the [1m] suffix. This prevents invalid model IDs (e.g. claude-haiku-4-5[1m])
when a stale contextWindow option carries over from a model that supports
1M context to one that doesn't.
All three callers (ClaudeAdapter session start, ClaudeAdapter sendTurn,
ClaudeTextGeneration) now pass capabilities to resolveApiModelId.1 parent 83a889f commit bb8241a
File tree
4 files changed
+48
-7
lines changed- apps/server/src
- git/Layers
- provider/Layers
4 files changed
+48
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | | - | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2732 | 2732 | | |
2733 | 2733 | | |
2734 | 2734 | | |
2735 | | - | |
2736 | | - | |
2737 | 2735 | | |
| 2736 | + | |
| 2737 | + | |
2738 | 2738 | | |
2739 | 2739 | | |
2740 | 2740 | | |
| |||
2899 | 2899 | | |
2900 | 2900 | | |
2901 | 2901 | | |
2902 | | - | |
| 2902 | + | |
| 2903 | + | |
2903 | 2904 | | |
2904 | 2905 | | |
2905 | 2906 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
182 | 215 | | |
183 | 216 | | |
184 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | | - | |
| 139 | + | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
0 commit comments