ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / copilot / src / platform / endpoint / test / node / chatModelCapabilities.spec.ts 294 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
import { describe, expect, test } from 'vitest' ;
import { ConfigKey, IConfigurationService } from '../../../configuration/common/configurationService' ;
import { DefaultsOnlyConfigurationService } from '../../../configuration/common/defaultsOnlyConfigurationService' ;
import { InMemoryConfigurationService } from '../../../configuration/test/common/inMemoryConfigurationService' ;
import type { IChatEndpoint } from '../../../networking/common/networking' ;
import { getModelCapabilityOverride, isGpt51Family, isGpt53Codex, isGpt54, isGpt55, isGpt56, isKimiFamily, isOpenAIModel modelCanUseApplyPatchExclusively modelCanUseReplaceStringExclusively modelSupportsApplyPatch modelSupportsContextEditing modelSupportsMultiReplaceString modelSupportsPDFDocuments modelSupportsReplaceString modelSupportsToolSearch
family model family
family model IChatEndpoint
test
family modelProvider expected
family modelProvider expected
test
isGpt51Family
isGpt53Codex
isGpt54
isGpt55
isGpt56
family matches
family
models
actual Object Object models name model name
isKimiFamily model
supportsReplaceString model
supportsMultiReplaceString model
canUseReplaceStringExclusively model
supportsApplyPatch model
canUseApplyPatchExclusively model
actual
isKimiFamily
supportsReplaceString
supportsMultiReplaceString
canUseReplaceStringExclusively
supportsApplyPatch
canUseApplyPatchExclusively
isKimiFamily
supportsReplaceString
supportsMultiReplaceString
canUseReplaceStringExclusively
supportsApplyPatch
canUseApplyPatchExclusively
isKimiFamily
supportsReplaceString
supportsMultiReplaceString
canUseReplaceStringExclusively
supportsApplyPatch
canUseApplyPatchExclusively
isKimiFamily
supportsReplaceString
supportsMultiReplaceString
canUseReplaceStringExclusively
supportsApplyPatch
canUseApplyPatchExclusively
isKimiFamily
supportsReplaceString
supportsMultiReplaceString
canUseReplaceStringExclusively
supportsApplyPatch
canUseApplyPatchExclusively
isKimiFamily
supportsReplaceString
supportsMultiReplaceString
canUseReplaceStringExclusively
supportsApplyPatch
canUseApplyPatchExclusively
map Record IConfigurationService
service
service ConfigKey Advanced ModelCapabilityOverrides map
service
config
family
config
family
config
family
config
emptyMap
emptyMap
,
,
,
,
,
,
,
,
}
from
'../../common/chatModelCapabilities'
;
function
fakeModel
(
:
string
,
:
string
=
)
{
return
{
,
}
as
unknown
as
;
}
describe
(
'OpenAI prompt model classification'
,
(
)
=>
{
.
each
(
[
[
'gpt-5.7'
,
'copilot'
,
true
]
,
[
'gpt-6'
,
'Azure'
,
true
]
,
[
'GPT-6'
,
'copilot'
,
true
]
,
[
'OpenAI'
,
'copilot'
,
true
]
,
[
'preview-model'
,
'OpenAI'
,
true
]
,
[
'preview-model'
,
'openai'
,
true
]
,
[
'preview-model'
,
'OpenAI Compatible'
,
false
]
,
[
'OpenAI Compatible'
,
'custom'
,
false
]
,
[
'unknown'
,
'custom'
,
false
]
,
[
'claude-sonnet-4.6'
,
'Anthropic'
,
false
]
,
[
'gemini-3-pro'
,
'Google'
,
false
]
,
]
)
(
'classifies %s from %s as OpenAI: %s'
,
(
,
,
)
=>
{
expect
(
isOpenAIModel
(
{
,
}
)
)
.
toBe
(
)
;
}
)
;
.
each
(
[
[
'gpt-5.1'
,
]
,
[
'gpt-5.3-codex'
,
]
,
[
'gpt-5.4'
,
]
,
[
'gpt-5.5'
,
]
,
[
'gpt-5.6'
,
]
,
]
as
const
)
(
'%s matcher respects version boundaries'
,
(
,
)
=>
{
expect
(
[
matches
(
)
,
matches
(
` ${ family} -mini `
)
,
matches
(
` ${ family} -20260828 `
)
,
matches
(
` ${ family} 0 `
)
,
matches
(
` ${ family} 0-codex `
)
,
matches
(
` ${ family} .1 `
)
,
]
)
.
toEqual
(
[
true
,
true
,
true
,
false
,
false
,
false
]
)
;
}
)
;
}
)
;
describe
(
'modelSupportsPDFDocuments'
,
(
)
=>
{
test
(
'returns true for claude family'
,
(
)
=>
{
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'claude-3.5-sonnet'
)
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'claude-3-opus'
)
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'claude-4-sonnet'
)
)
)
.
toBe
(
true
)
;
}
)
;
test
(
'returns true for Anthropic family'
,
(
)
=>
{
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'Anthropic'
)
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'Anthropic-custom'
)
)
)
.
toBe
(
true
)
;
}
)
;
test
(
'returns true for gpt-5 plus families'
,
(
)
=>
{
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'gpt-5.4'
)
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'gpt-5.4-mini'
)
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'gpt-5.5'
)
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'gpt-5.5-mini'
)
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'gpt-4'
)
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'gpt-5.1'
)
)
)
.
toBe
(
true
)
;
}
)
;
test
(
'returns false for other families'
,
(
)
=>
{
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'gemini-2.0-flash'
)
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsPDFDocuments
(
fakeModel
(
'o4-mini'
)
)
)
.
toBe
(
false
)
;
}
)
;
}
)
;
describe
(
'Kimi edit tool capabilities'
,
(
)
=>
{
test
(
'uses replace-string tools without insert-edit or apply-patch'
,
(
)
=>
{
const
=
{
'kimi-k2.6'
:
fakeModel
(
'kimi-k2.6'
)
,
'kimi-k2.7-code'
:
fakeModel
(
'kimi-k2.7-code'
)
,
'kimi-k3'
:
fakeModel
(
'kimi-k3'
)
,
'moonshot/kimi-k2.7-code'
:
fakeModel
(
'moonshot/kimi-k2.7-code'
)
,
'moonshot/kimi-k2.6'
:
fakeModel
(
'moonshot/kimi-k2.6'
)
,
'unknown-family + kimi model id'
:
fakeModel
(
'unknown-family'
,
'kimi-k2.7-code-preview'
)
,
}
;
const
=
.
fromEntries
(
.
entries
(
)
.
map
(
(
[
,
]
)
=>
[
,
{
:
isKimiFamily
(
)
,
:
modelSupportsReplaceString
(
)
,
:
modelSupportsMultiReplaceString
(
)
,
:
modelCanUseReplaceStringExclusively
(
)
,
:
modelSupportsApplyPatch
(
)
,
:
modelCanUseApplyPatchExclusively
(
)
,
}
]
)
)
;
expect
(
)
.
toEqual
(
{
'kimi-k2.6'
:
{
:
true
,
:
true
,
:
true
,
:
true
,
:
false
,
:
false
,
}
,
'kimi-k2.7-code'
:
{
:
true
,
:
true
,
:
true
,
:
true
,
:
false
,
:
false
,
}
,
'kimi-k3'
:
{
:
true
,
:
true
,
:
true
,
:
true
,
:
false
,
:
false
,
}
,
'moonshot/kimi-k2.7-code'
:
{
:
true
,
:
true
,
:
true
,
:
true
,
:
false
,
:
false
,
}
,
'moonshot/kimi-k2.6'
:
{
:
true
,
:
true
,
:
true
,
:
true
,
:
false
,
:
false
,
}
,
'unknown-family + kimi model id'
:
{
:
true
,
:
true
,
:
true
,
:
true
,
:
false
,
:
false
,
}
,
}
)
;
}
)
;
}
)
;
describe
(
'modelSupportsToolSearch'
,
(
)
=>
{
test
(
'supports Claude Sonnet/Opus 4.5 and up, including new and future families'
,
(
)
=>
{
expect
(
modelSupportsToolSearch
(
'claude-sonnet-4-5'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-sonnet-4.5'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-sonnet-4-5-20250929'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-sonnet-4-6'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-sonnet-4.6'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4-5'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4.5'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4-5-20251101'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4-6'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4.6'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4.7'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4-7@1.0.0'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-sonnet-4-6@1.0.0'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4-8'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-future-version'
)
)
.
toBe
(
true
)
;
}
)
;
test
(
'rejects pre-4.5 models, including date-suffixed ones'
,
(
)
=>
{
expect
(
modelSupportsToolSearch
(
'claude-sonnet-4-20250514'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'claude-sonnet-4'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4-20250514'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4-1'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4.1'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'claude-opus-4-1-20250805'
)
)
.
toBe
(
false
)
;
}
)
;
test
(
'supports Haiku 4.5, the only shipping Haiku'
,
(
)
=>
{
expect
(
modelSupportsToolSearch
(
'claude-haiku-4-5'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-haiku-4.5'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'claude-haiku-4-5-20251001'
)
)
.
toBe
(
true
)
;
}
)
;
test
(
'rejects legacy Claude families'
,
(
)
=>
{
expect
(
modelSupportsToolSearch
(
'claude-3-5-sonnet-20241022'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'claude-3-opus'
)
)
.
toBe
(
false
)
;
}
)
;
test
(
'supports OpenAI gpt-5.4 and gpt-5.5 models'
,
(
)
=>
{
expect
(
modelSupportsToolSearch
(
'gpt-5.4'
)
)
.
toBe
(
true
)
;
expect
(
modelSupportsToolSearch
(
'gpt-5.5'
)
)
.
toBe
(
true
)
;
}
)
;
test
(
'rejects suffixed gpt-5.4/5.5 variants (exact match only)'
,
(
)
=>
{
expect
(
modelSupportsToolSearch
(
'gpt-5.4-mini'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'gpt-5.4-preview'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'gpt-5.5-preview'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'gpt5.5-preview'
)
)
.
toBe
(
false
)
;
}
)
;
test
(
'rejects other non-Claude models'
,
(
)
=>
{
expect
(
modelSupportsToolSearch
(
'gpt-5'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'gemini-2.5-pro'
)
)
.
toBe
(
false
)
;
expect
(
modelSupportsToolSearch
(
'o4-mini'
)
)
.
toBe
(
false
)
;
}
)
;
test
(
'matches via endpoint.family when the model id is unknown'
,
(
)
=>
{
expect
(
{
'preview-id + family=claude-opus-4.7'
:
modelSupportsToolSearch
(
fakeModel
(
'claude-opus-4.7'
,
'preview-anthropic'
)
)
,
'preview-id + family=claude-sonnet-4.6'
:
modelSupportsToolSearch
(
fakeModel
(
'claude-sonnet-4.6'
,
'preview-sonnet-internal'
)
)
,
'preview-id + family=claude-opus-4 (pre-4.5)'
:
modelSupportsToolSearch
(
fakeModel
(
'claude-opus-4'
,
'preview-opus-old'
)
)
,
'known id + family=unknown'
:
modelSupportsToolSearch
(
fakeModel
(
'mystery-family'
,
'claude-opus-4.7'
)
)
,
}
)
.
toEqual
(
{
'preview-id + family=claude-opus-4.7'
:
true
,
'preview-id + family=claude-sonnet-4.6'
:
true
,
'preview-id + family=claude-opus-4 (pre-4.5)'
:
false
,
'known id + family=unknown'
:
true
,
}
)
;
}
)
;
}
)
;
describe
(
'modelSupportsContextEditing'
,
(
)
=>
{
test
(
'matches Claude id strings'
,
(
)
=>
{
expect
(
{
'claude-opus-4.6'
:
modelSupportsContextEditing
(
'claude-opus-4.6'
)
,
'claude-fable-5'
:
modelSupportsContextEditing
(
'claude-fable-5'
)
,
'claude-opus-4.7'
:
modelSupportsContextEditing
(
'claude-opus-4.7'
)
,
'claude-opus-4.8'
:
modelSupportsContextEditing
(
'claude-opus-4.8'
)
,
'claude-opus-4-8-1m'
:
modelSupportsContextEditing
(
'claude-opus-4-8-1m'
)
,
'claude-sonnet-4.5'
:
modelSupportsContextEditing
(
'claude-sonnet-4.5'
)
,
'claude-haiku-4-5'
:
modelSupportsContextEditing
(
'claude-haiku-4-5'
)
,
'claude-opus-4.6-1m'
:
modelSupportsContextEditing
(
'claude-opus-4.6-1m'
)
,
'gpt-5'
:
modelSupportsContextEditing
(
'gpt-5'
)
,
}
)
.
toEqual
(
{
'claude-opus-4.6'
:
true
,
'claude-fable-5'
:
true
,
'claude-opus-4.7'
:
true
,
'claude-opus-4.8'
:
true
,
'claude-opus-4-8-1m'
:
false
,
'claude-sonnet-4.5'
:
true
,
'claude-haiku-4-5'
:
true
,
'claude-opus-4.6-1m'
:
false
,
'gpt-5'
:
false
,
}
)
;
}
)
;
test
(
'matches via endpoint.family when the model id is unknown'
,
(
)
=>
{
expect
(
{
'preview-id + family=claude-opus-4.6'
:
modelSupportsContextEditing
(
fakeModel
(
'claude-opus-4.6'
,
'preview-anthropic'
)
)
,
'preview-id + family=claude-haiku-4-5'
:
modelSupportsContextEditing
(
fakeModel
(
'claude-haiku-4-5'
,
'preview-haiku-internal'
)
)
,
'preview-id + family=mystery'
:
modelSupportsContextEditing
(
fakeModel
(
'mystery-family'
,
'preview-anything'
)
)
,
}
)
.
toEqual
(
{
'preview-id + family=claude-opus-4.6'
:
true
,
'preview-id + family=claude-haiku-4-5'
:
true
,
'preview-id + family=mystery'
:
false
,
}
)
;
}
)
;
}
)
;
describe
(
'getModelCapabilityOverride'
,
(
)
=>
{
function
makeConfig
(
:
<
string
,
unknown
>
)
:
{
const
=
new
InMemoryConfigurationService
(
new
DefaultsOnlyConfigurationService
(
)
)
;
.
setConfig
(
.
.
,
as
never
)
;
return
;
}
test
(
'returns the entry for a known model id'
,
(
)
=>
{
const
=
makeConfig
(
{
'preview-anthropic'
:
{
:
'claude-opus-4.7'
}
,
}
)
;
expect
(
getModelCapabilityOverride
(
'preview-anthropic'
,
)
)
.
toEqual
(
{
:
'claude-opus-4.7'
,
}
)
;
}
)
;
test
(
'returns undefined for unknown model ids and when nothing is configured'
,
(
)
=>
{
const
=
makeConfig
(
{
'preview-anthropic'
:
{
:
'claude-opus-4.7'
}
,
}
)
;
expect
(
{
unknown
:
getModelCapabilityOverride
(
'something-else'
,
)
,
:
getModelCapabilityOverride
(
'preview-anthropic'
,
makeConfig
(
{
}
)
)
,
}
)
.
toEqual
(
{
unknown
:
undefined
,
:
undefined
,
}
)
;
}
)
;
}
)
;