ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / copilot / src / extension / prompts / node / agent / test / agentPrompt.spec.tsx 476 строк · изменён 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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
import { afterAll, beforeAll, beforeEach, expect, suite, test } from 'vitest' ;
import { IChatMLFetcher } from '../../../../../platform/chat/common/chatMLFetcher' ;
import { ChatLocation } from '../../../../../platform/chat/common/commonTypes' ;
import { StaticChatMLFetcher } from '../../../../../platform/chat/test/common/staticChatMLFetcher' ;
import { CodeGenerationTextInstruction , ConfigKey , IConfigurationService } from '../../../../../platform/configuration/common/configurationService'
testFamilies
testFamilies family
accessor
chatResponse
fileTsUri
name
conversation
testDoc fileTsUri
services
services
testDoc
chatResponse
services chatResponse
accessor services
accessor
text
satisfies
turn type message
conversation turn
accessor
accessor promptContext otherProps includeMemoryTool
instaService accessor
endpoint family
instaService
instaService family
isMessagesApi family
promptContext
promptContext promptContext conversation
includeMemoryTool promptContext availableTools t t
memoryTool accessor t t
memoryTool
promptContext
promptContext
tools
toolInvocationToken promptContext toolInvocationToken
toolReferences promptContext toolReferences
availableTools promptContext availableTools memoryTool
customizations instaService endpoint
baseProps
priority
endpoint
promptContext
otherProps
customizations
props baseProps
renderer instaService endpoint props
r renderer
isMessagesApi
r
r
m m
idx
id
name
arguments
filePath fileTsUri code
idxs
result
idx idxs
result
result
accessor
chatVariables
history
query
family
promptContext
chatVariables
history
query
topLevelVoicePrompt accessor
promptContext
request isVoiceModeInput
subagentVoicePrompt accessor
promptContext
request isVoiceModeInput subAgentInvocationId
typedPrompt accessor promptContext
topLevelVoice topLevelVoicePrompt
subagentVoice subagentVoicePrompt
typed typedPrompt
topLevelVoice
subagentVoice
typed
toolsService accessor
accessor
chatVariables
history
query
tools
availableTools toolsService
toolInvocationToken
toolReferences
toolsService accessor
editTools
accessor
chatVariables
history
query
tools
availableTools toolsService t editTools t
toolInvocationToken
toolReferences
toolsService accessor
rendered accessor
chatVariables
history
query
tools
availableTools toolsService t t
toolInvocationToken
toolReferences
rendered
rendered
rendered
rendered
accessor
chatVariables id name value fileTsUri
history
query
tools
availableTools
toolInvocationToken
toolReferences
accessor
chatVariables id name value fileTsUri
history
query
toolCallRounds
toolCallResults
tools
accessor
chatVariables id name value fileTsUri
history
query
enableSummarization
enableCacheBreakpoints
toolIdx
previousTurn type message
previousTurnResult
metadata
toolCallRounds
toolIdx
toolIdx
toolIdx
toolIdx
toolCallResults
previousTurn type message previousTurnResult
accessor
chatVariables
history previousTurn
query
toolCallRounds
toolIdx
toolIdx
toolIdx
toolIdx
toolCallResults
tools
enableSummarization
enableCacheBreakpoints
accessor
chatVariables id name value fileTsUri
history
query
enableSummarization
enableCacheBreakpoints
accessor
accessor
chatVariables
history
query
modeInstructions name content
accessor
accessor
chatVariables
history
query
otherUri
accessor
chatVariables
history
query
editedFileEvents
eventKind uri fileTsUri
eventKind uri otherUri
eventKind uri fileTsUri
accessor
services
services
services
accessor services
accessor
family includeToolSpecificTools
instaService accessor
endpoint instaService family
toolsService accessor
turn type message
conversation turn
customizations instaService endpoint
syntheticTool name
name
description
inputSchema
tags
source
availableTools includeToolSpecificTools
toolsService
toolsService t t t
props
priority
endpoint
promptContext
chatVariables
history
query
conversation
tools
availableTools
toolInvocationToken
toolReferences
customizations
renderer instaService endpoint props
r renderer
r m m
rendered expected readAst toolBatching searchPrecision
readAst rendered
toolBatching rendered
searchPrecision rendered
expected
accessor
readAst toolBatching searchPrecision
accessor
readAst toolBatching searchPrecision
accessor
readAst toolBatching searchPrecision
accessor
readAst toolBatching searchPrecision
accessor
readAst toolBatching searchPrecision
;
import
{ MockEndpoint }
from
'../../../../../platform/endpoint/test/node/mockEndpoint'
;
import
{ messageToMarkdown }
from
'../../../../../platform/log/common/messageStringify'
;
import
{ IResponseDelta }
from
'../../../../../platform/networking/common/fetch'
;
import
{ ITestingServicesAccessor }
from
'../../../../../platform/test/node/services'
;
import
{ TestWorkspaceService }
from
'../../../../../platform/test/node/testWorkspaceService'
;
import
{ IWorkspaceService }
from
'../../../../../platform/workspace/common/workspaceService'
;
import
{ createTextDocumentData }
from
'../../../../../util/common/test/shims/textDocument'
;
import
{
URI
}
from
'../../../../../util/vs/base/common/uri'
;
import
{ SyncDescriptor }
from
'../../../../../util/vs/platform/instantiation/common/descriptors'
;
import
{ IInstantiationService }
from
'../../../../../util/vs/platform/instantiation/common/instantiation'
;
import
type
{
LanguageModelToolInformation
}
from
'vscode'
;
import
{ ChatRequestEditedFileEventKind , LanguageModelTextPart , LanguageModelToolResult }
from
'../../../../../vscodeTypes'
;
import
{ addCacheBreakpoints }
from
'../../../../intents/node/cacheBreakpoints'
;
import
{ ChatVariablesCollection }
from
'../../../../prompt/common/chatVariablesCollection'
;
import
{ Conversation , ICopilotChatResultIn , Turn , TurnStatus }
from
'../../../../prompt/common/conversation'
;
import
{ IBuildPromptContext , IToolCall }
from
'../../../../prompt/common/intents'
;
import
{ ToolCallRound }
from
'../../../../prompt/common/toolCallRound'
;
import
{ createExtensionUnitTestingServices }
from
'../../../../test/node/services'
;
import
{ ToolName }
from
'../../../../tools/common/toolNames'
;
import
{ IToolsService }
from
'../../../../tools/common/toolsService'
;
import
{ PromptRenderer }
from
'../../base/promptRenderer'
;
import
{ AgentPrompt , AgentPromptProps }
from
'../agentPrompt'
;
import
{ PromptRegistry }
from
'../promptRegistry'
;
const
=
[
'default'
,
'gpt-4.1'
,
'gpt-5'
,
'gpt-5-mini'
,
'gpt-5-codex'
,
'gpt-5.1'
,
'gpt-5.1-codex'
,
'gpt-5.1-codex-mini'
,
'claude-haiku-4.5'
,
'claude-sonnet-4.5'
,
'claude-opus-4.5'
,
'claude-sonnet-4.6'
,
'claude-opus-4.6'
,
'gemini-2.0-flash'
,
'grok-code-fast-1'
]
;
.
forEach
(
=>
{
suite
(
` AgentPrompt - ${ family} `
,
(
)
=>
{
let
:
ITestingServicesAccessor
;
let
:
(
string
|
IResponseDelta
[
]
)
[
]
=
[
]
;
const
=
URI
.
file
(
'/workspace/file.ts'
)
;
function
getSnapshotFile
(
:
string
)
:
string
{
return
` ./__snapshots__/agentPrompts- ${ family} / ${ name} .spec.snap `
;
}
let
:
Conversation
;
beforeAll
(
(
)
=>
{
const
=
createTextDocumentData
(
,
'line 1\nline 2\n\nline 4\nline 5'
,
'ts'
)
.
document
;
const
=
createExtensionUnitTestingServices
(
)
;
.
define
(
IWorkspaceService
,
new
SyncDescriptor
(
TestWorkspaceService
,
[
[
URI
.
file
(
'/workspace'
)
]
,
[
]
]
)
)
;
=
[
]
;
.
define
(
IChatMLFetcher
,
new
StaticChatMLFetcher
(
)
)
;
=
.
createTestingAccessor
(
)
;
.
get
(
IConfigurationService
)
.
setConfig
(
ConfigKey
.
CodeGenerationInstructions
,
[
{
:
'This is a test custom instruction file'
,
}
CodeGenerationTextInstruction
]
)
;
}
)
;
beforeEach
(
(
)
=>
{
const
=
new
Turn
(
'turnId'
,
{
:
'user'
,
:
'hello'
}
)
;
=
new
Conversation
(
'sessionId'
,
[
]
)
;
}
)
;
afterAll
(
(
)
=>
{
.
dispose
(
)
;
}
)
;
async
function
agentPromptToString
(
:
ITestingServicesAccessor
,
:
IBuildPromptContext
,
?
:
Partial
<
AgentPromptProps
>
,
=
true
)
:
Promise
<
string
>
{
const
=
.
get
(
IInstantiationService
)
;
const
=
===
'default'
?
.
createInstance
(
MockEndpoint
,
undefined
)
:
.
createInstance
(
MockEndpoint
,
)
;
const
=
.
startsWith
(
'claude-'
)
;
if
(
!
.
conversation
)
{
=
{
...
,
}
;
}
if
(
&&
!
.
tools
?.
.
some
(
=>
.
name
===
ToolName
.
Memory
)
)
{
const
=
.
get
(
IToolsService
)
.
tools
.
find
(
=>
.
name
===
ToolName
.
Memory
)
;
if
(
)
{
=
{
...
,
:
{
:
.
tools
?.
??
(
null
as
never
)
,
:
.
tools
?.
??
[
]
,
:
[
...
(
.
tools
?.
??
[
]
)
,
]
,
}
}
;
}
}
const
=
await
PromptRegistry
.
resolveAllCustomizations
(
,
)
;
const
=
{
:
1
,
,
location
:
ChatLocation
.
Panel
,
,
...
,
}
;
const
:
AgentPromptProps
=
;
const
=
PromptRenderer
.
create
(
,
,
AgentPrompt
,
)
;
const
=
await
.
render
(
)
;
if
(
!
)
{
addCacheBreakpoints
(
.
messages
,
'chatCompletions'
)
;
}
return
.
messages
.
map
(
=>
messageToMarkdown
(
)
)
.
join
(
'\n\n'
)
.
replace
(
/ \\ + / g
,
'/'
)
.
replace
(
/ The current date is. * / g
,
'(Date removed from snapshot)'
)
;
}
function
createEditFileToolCall
(
:
number
)
:
IToolCall
{
return
{
:
` tooluse_ ${ idx} `
,
:
ToolName
.
EditFile
,
:
JSON
.
stringify
(
{
:
.
fsPath
,
:
` // existing code...\nconsole.log('hi') `
}
)
}
;
}
function
createEditFileToolResult
(
...
:
number
[
]
)
:
Record
<
string
,
LanguageModelToolResult
>
{
const
:
Record
<
string
,
LanguageModelToolResult
>
=
{
}
;
for
(
const
of
)
{
[
` tooluse_ ${ idx} `
]
=
new
LanguageModelToolResult
(
[
new
LanguageModelTextPart
(
'success'
)
]
)
;
}
return
;
}
test
(
'simple case'
,
async
(
)
=>
{
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
}
,
undefined
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'simple_case'
)
)
;
}
)
;
if
(
===
'default'
)
{
test
(
'voice progress guidance appears only for top-level voice requests'
,
async
(
)
=>
{
const
=
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
}
;
const
=
await
agentPromptToString
(
,
{
...
,
:
{
:
true
}
as
IBuildPromptContext
[
'request'
]
,
}
)
;
const
=
await
agentPromptToString
(
,
{
...
,
:
{
:
true
,
:
'subagent'
}
as
IBuildPromptContext
[
'request'
]
,
}
)
;
const
=
await
agentPromptToString
(
,
)
;
expect
(
{
:
.
includes
(
'You MUST call the report_voice_progress tool in the same response as your first real work tool calls'
)
,
:
.
includes
(
'You MUST call the report_voice_progress tool in the same response as your first real work tool calls'
)
,
:
.
includes
(
'You MUST call the report_voice_progress tool in the same response as your first real work tool calls'
)
,
}
)
.
toEqual
(
{
:
true
,
:
false
,
:
false
,
}
)
;
}
)
;
}
test
(
'all tools'
,
async
(
)
=>
{
const
=
.
get
(
IToolsService
)
;
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
:
{
:
.
tools
,
:
null
as
never
,
:
[
]
,
}
}
,
undefined
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'all_tools'
)
)
;
}
)
;
test
(
'all non-edit tools'
,
async
(
)
=>
{
const
=
.
get
(
IToolsService
)
;
const
:
Set
<
string
>
=
new
Set
(
[
ToolName
.
ApplyPatch
,
ToolName
.
EditFile
,
ToolName
.
ReplaceString
,
ToolName
.
MultiReplaceString
]
)
;
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
:
{
:
.
tools
.
filter
(
=>
!
.
has
(
.
name
)
)
,
:
null
as
never
,
:
[
]
,
}
}
,
undefined
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'all_non_edit_tools'
)
)
;
}
)
;
test
(
'memory tool disabled omits memory instructions and context'
,
async
(
)
=>
{
const
=
.
get
(
IToolsService
)
;
const
=
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
:
{
:
.
tools
.
filter
(
=>
.
name
!==
ToolName
.
Memory
)
,
:
null
as
never
,
:
[
]
,
}
}
,
undefined
,
false
)
;
expect
(
)
.
not
.
toContain
(
'memoryInstructions'
)
;
expect
(
)
.
not
.
toContain
(
'userMemory'
)
;
expect
(
)
.
not
.
toContain
(
'sessionMemory'
)
;
expect
(
)
.
not
.
toContain
(
'repoMemory'
)
;
}
)
;
test
(
'one attachment'
,
async
(
)
=>
{
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
[
{
:
'vscode.file'
,
:
'file'
,
:
}
]
)
,
:
[
]
,
:
'hello'
,
}
,
undefined
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'one_attachment'
)
)
;
}
)
;
const
:
IBuildPromptContext
[
'tools'
]
=
{
:
[
]
,
:
null
as
never
,
:
[
]
,
}
;
test
(
'tool use'
,
async
(
)
=>
{
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
[
{
:
'vscode.file'
,
:
'file'
,
:
}
]
)
,
:
[
]
,
:
'edit this file'
,
:
[
new
ToolCallRound
(
'ok'
,
[
createEditFileToolCall
(
1
)
]
)
,
]
,
:
createEditFileToolResult
(
1
)
,
,
}
,
undefined
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'tool_use'
)
)
;
}
)
;
test
(
'cache BPs'
,
async
(
)
=>
{
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
[
{
:
'vscode.file'
,
:
'file'
,
:
}
]
)
,
:
[
]
,
:
'edit this file'
,
}
,
{
:
true
,
:
true
,
}
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'cache_BPs'
)
)
;
}
)
;
test
(
'cache BPs with multi tool call rounds'
,
async
(
)
=>
{
let
=
0
;
const
=
new
Turn
(
'id'
,
{
:
'user'
,
:
'previous turn'
}
)
;
const
:
ICopilotChatResultIn
=
{
:
{
:
[
new
ToolCallRound
(
'response'
,
[
createEditFileToolCall
(
++
)
,
createEditFileToolCall
(
++
)
,
]
,
undefined
,
'toolCallRoundId1'
)
,
new
ToolCallRound
(
'response 2'
,
[
createEditFileToolCall
(
++
)
,
createEditFileToolCall
(
++
)
,
]
,
undefined
,
'toolCallRoundId1'
)
,
]
,
:
createEditFileToolResult
(
0
,
1
,
2
,
3
)
,
}
}
;
.
setResponse
(
TurnStatus
.
Success
,
{
:
'user'
,
:
'response'
}
,
'responseId'
,
)
;
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
[
]
)
,
:
[
]
,
:
'edit this file'
,
:
[
new
ToolCallRound
(
'ok'
,
[
createEditFileToolCall
(
++
)
,
createEditFileToolCall
(
++
)
,
]
)
,
new
ToolCallRound
(
'ok'
,
[
createEditFileToolCall
(
++
)
,
createEditFileToolCall
(
++
)
,
]
)
,
]
,
:
createEditFileToolResult
(
4
,
5
,
6
,
7
)
,
,
}
,
{
:
true
,
:
true
,
}
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'cache_BPs_multi_round'
)
)
;
}
)
;
test
(
'summarization without cache breakpoints (Messages API config)'
,
async
(
)
=>
{
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
[
{
:
'vscode.file'
,
:
'file'
,
:
}
]
)
,
:
[
]
,
:
'edit this file'
,
}
,
{
:
true
,
:
false
,
}
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'summarization_no_cache_bps'
)
)
;
}
)
;
test
(
'custom instructions not in system message'
,
async
(
)
=>
{
.
get
(
IConfigurationService
)
.
setConfig
(
ConfigKey
.
CustomInstructionsInSystemMessage
,
false
)
;
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
:
{
:
'Plan'
,
:
'custom mode instructions'
}
,
}
,
undefined
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'custom_instructions_not_in_system_message'
)
)
;
}
)
;
test
(
'omit base agent instructions'
,
async
(
)
=>
{
.
get
(
IConfigurationService
)
.
setConfig
(
ConfigKey
.
Advanced
.
OmitBaseAgentInstructions
,
true
)
;
await
expect
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
}
,
undefined
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'omit_base_agent_instructions'
)
)
;
}
)
;
test
(
'edited file events are grouped by kind'
,
async
(
)
=>
{
const
=
URI
.
file
(
'/workspace/other.ts'
)
;
await
expect
(
(
await
agentPromptToString
(
,
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
:
[
{
:
ChatRequestEditedFileEventKind
.
Undo
,
:
}
,
{
:
ChatRequestEditedFileEventKind
.
UserModification
,
:
}
,
{
:
ChatRequestEditedFileEventKind
.
Undo
,
:
}
,
]
,
}
,
undefined
)
)
)
.
toMatchFileSnapshot
(
getSnapshotFile
(
'edited_file_events_grouped_by_kind'
)
)
;
}
)
;
}
)
;
}
)
;
suite
(
'AgentPrompt - Gemini Flash prompt additions experiment'
,
(
)
=>
{
let
:
ITestingServicesAccessor
;
beforeAll
(
(
)
=>
{
const
=
createExtensionUnitTestingServices
(
)
;
.
define
(
IWorkspaceService
,
new
SyncDescriptor
(
TestWorkspaceService
,
[
[
URI
.
file
(
'/workspace'
)
]
]
)
)
;
.
define
(
IChatMLFetcher
,
new
StaticChatMLFetcher
(
[
]
)
)
;
=
.
createTestingAccessor
(
)
;
}
)
;
afterAll
(
(
)
=>
{
.
dispose
(
)
;
}
)
;
async
function
renderForFamily
(
:
string
,
=
true
)
:
Promise
<
string
>
{
const
=
.
get
(
IInstantiationService
)
;
const
=
.
createInstance
(
MockEndpoint
,
)
;
const
=
.
get
(
IToolsService
)
;
const
=
new
Turn
(
'turnId'
,
{
:
'user'
,
:
'hello'
}
)
;
const
=
new
Conversation
(
'sessionId'
,
[
]
)
;
const
=
await
PromptRegistry
.
resolveAllCustomizations
(
,
)
;
const
=
(
:
ToolName
)
:
LanguageModelToolInformation
=>
(
{
,
:
''
,
:
undefined
,
:
[
]
,
:
undefined
,
}
)
;
const
=
?
[
...
.
tools
,
syntheticTool
(
ToolName
.
CoreRunInTerminal
)
,
syntheticTool
(
ToolName
.
FindTextInFiles
)
]
:
.
tools
.
filter
(
=>
.
name
!==
ToolName
.
CoreRunInTerminal
&&
.
name
!==
ToolName
.
FindTextInFiles
)
;
const
:
AgentPromptProps
=
{
:
1
,
,
location
:
ChatLocation
.
Panel
,
:
{
:
new
ChatVariablesCollection
(
)
,
:
[
]
,
:
'hello'
,
,
:
{
,
:
null
as
never
,
:
[
]
,
}
,
}
,
,
}
;
const
=
PromptRenderer
.
create
(
,
,
AgentPrompt
,
)
;
const
=
await
.
render
(
)
;
return
.
messages
.
map
(
=>
messageToMarkdown
(
)
)
.
join
(
'\n\n'
)
;
}
function
assertAdditions
(
:
string
,
:
{
:
boolean
;
:
boolean
;
:
boolean
}
)
{
expect
(
{
:
.
includes
(
'Read ast/definitions first'
)
,
:
.
includes
(
'**Tool Batching**'
)
,
:
.
includes
(
'**Search Precision**'
)
,
}
)
.
toEqual
(
)
;
}
test
(
'additions appear for Gemini Flash 3.6 when experiment is enabled'
,
async
(
)
=>
{
.
get
(
IConfigurationService
)
.
setConfig
(
ConfigKey
.
EnableGeminiFlashPromptAdditions
,
true
)
;
assertAdditions
(
await
renderForFamily
(
'gemini-3.6-flash'
)
,
{
:
true
,
:
true
,
:
true
}
)
;
}
)
;
test
(
'additions appear for Gemini Flash 3.7 when experiment is enabled'
,
async
(
)
=>
{
.
get
(
IConfigurationService
)
.
setConfig
(
ConfigKey
.
EnableGeminiFlashPromptAdditions
,
true
)
;
assertAdditions
(
await
renderForFamily
(
'gemini-3.7-flash'
)
,
{
:
true
,
:
true
,
:
true
}
)
;
}
)
;
test
(
'tool-specific additions are gated on tool availability'
,
async
(
)
=>
{
.
get
(
IConfigurationService
)
.
setConfig
(
ConfigKey
.
EnableGeminiFlashPromptAdditions
,
true
)
;
assertAdditions
(
await
renderForFamily
(
'gemini-3.6-flash'
,
false
)
,
{
:
true
,
:
false
,
:
false
}
)
;
}
)
;
test
(
'additions are omitted for Gemini Flash 3.6 when experiment is disabled'
,
async
(
)
=>
{
.
get
(
IConfigurationService
)
.
setConfig
(
ConfigKey
.
EnableGeminiFlashPromptAdditions
,
false
)
;
assertAdditions
(
await
renderForFamily
(
'gemini-3.6-flash'
)
,
{
:
false
,
:
false
,
:
false
}
)
;
}
)
;
test
(
'additions are omitted for other Gemini families even when experiment is enabled'
,
async
(
)
=>
{
.
get
(
IConfigurationService
)
.
setConfig
(
ConfigKey
.
EnableGeminiFlashPromptAdditions
,
true
)
;
assertAdditions
(
await
renderForFamily
(
'gemini-2.0-flash'
)
,
{
:
false
,
:
false
,
:
false
}
)
;
}
)
;
}
)
;