Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/// @ts-check/**
* Chat memory leak checker — state-based approach.
*
* The idea: if you return to the same state you started from, memory should
* return to roughly the same level. Any residual growth is a potential leak.
*
* Each iteration:
* 1. Open a fresh chat (baseline state)
* 2. Measure heap + DOM nodes
* 3. Cycle through ALL registered perf scenarios (text, code blocks,
* tool calls, thinking, multi-turn, etc.)
* 4. Open a new chat (return to baseline state — clears previous session)
* 5. Measure heap + DOM nodes again
* 6. The delta is the "leaked" memory for that iteration
*
* Multiple iterations let us detect consistent leaks vs. one-time caching.
*
* Usage:
* npm run perf:chat-leak # defaults from config
* npm run perf:chat-leak -- --iterations 5 # more iterations
* npm run perf:chat-leak -- --threshold 5 # 5MB steady-state threshold
* npm run perf:chat-leak -- --build 1.115.0 # test a specific build
*/const fs =require('fs');const path =require('path');const{DATA_DIR, loadConfig,
resolveBuild, buildEnv, buildArgs, prepareRunDir,
launchVSCode,}=require(
getUserTurns getModelTurnCount
args process
opts
i i args i
argsi
opts argsi
opts argsi
opts
opts
opts argsi
opts argsi
kv argsi
eq kv
eq process
key kv eq
raw kveq
val raw raw raw raw raw
optskey val
process
opts
cdp
r
cdp
r
heapInfo cdp
heapMB heapInfo
domNodes page
heapMB domNodes
newChatShortcut process
pagenewChatShortcut
r
page
page
sel el
r
page
r
inputSel page
ed editorSel
ed
ed editorSel editorSel
hasDriver page
globalThistypeInEditor
hasDriver
page
globalThisselector t
inputSel text
pageinputSel
r
pageinputSeltext
compBefore mockServer
page
mockServercompBefore modelTurns
responseSelector
page
responses sel
responses
responsesresponses
responseSelector
r
userTurns scenarioId
totalModelTurns scenarioId
userTurns
page mockServer totalModelTurns
modelTurnsSoFar
firstUserAfter userTurns
turnsBeforeFirstUser firstUserAfter modelTurnsSoFar
page mockServer turnsBeforeFirstUser
modelTurnsSoFar firstUserAfter
u u userTurns u
nextModelStop u userTurns
userTurnsu
totalModelTurns
turnsUntilNext nextModelStop modelTurnsSoFar
page mockServer userTurnsu turnsUntilNext
modelTurnsSoFar nextModelStop
iterations verbose opts
userDataDir extDir logsDir mockServer opts
isDevBuild electronPath
vscode
electronPath
userDataDir extDir logsDir isDevBuild
mockServer isDevBuild
verbose
page vscode
page
cdp pagepage
cdp
chatShortcut process
pagechatShortcut
page
page
sel el
reqsBefore mockServer
mockServerreqsBefore
r
scenarioIds
baseline cdp page
verbose
iterationResults
iter iter iterations iter
before cdp page
verbose
m m scenarioIds m
sid scenarioIdsm
page mockServer sid
verbose
page
r
after cdp page
deltaHeapMB after before
deltaDomNodes after before
iterationResults
before
after
deltaHeapMB
before
after
deltaDomNodes
verbose
final cdp page
totalResidualMB final baseline
totalResidualNodes final baseline
warmupBaselineMB iterationResults
iterationResults
baseline
steadyResidualMB final warmupBaselineMB
baseline
final final
totalResidualMB
totalResidualNodes
steadyResidualMB
iterationResults
vscode
opts
electronPath opts
fselectronPath
process
startServer
registerPerfScenarios
mockServer
result electronPath mockServer opts
i i result i
it resulti
jsonPath path
fsjsonPath
opts
opts
result
leaked result opts
leaked
opts
summary result opts
summaryPath path
fssummaryPath summary
mockServer
processleaked
leaked result opts
verdict leaked
lines
lines
lines
lines
lines
lines
lines
lines
lines
lines
lines
lines
lines
i i result i
it resulti
sign it
domSign it
note i
lines
lines
lines
steadySign result
sign result
domSign result
lines
lines
lines
lines
lines
err process
' --iterations <n> Number of open→work→reset cycles (default: 3)'
,
' --messages <n> Messages to send per iteration (default: 5)'
,
' --ci CI mode: write Markdown summary to ci-summary.md'
,
' --build <path|ver> Path to VS Code build or version to download'
,
' --threshold <MB> Max total residual heap growth in MB (default: 5)'
,
' --setting <k=v> Set a VS Code setting override (repeatable)'
,
' --verbose Print per-step details'
,
]
.
join
(
'\n'
)
)
;
.
exit
(
0
)
;
}
}
return
;
}
// -- Scenario list -----------------------------------------------------------
/**
* Build a flat list of scenario IDs to cycle through during leak testing.
* Includes all scenario types: content-only, tool-call, and multi-turn.
*
* Content scenarios exercise varied rendering (code blocks, markdown, etc.).
* Tool-call scenarios exercise the agent loop (model → tool → model → ...).
* Multi-turn scenarios exercise user follow-ups and thinking blocks.
*/
/**
* Measure heap (MB) and DOM node count after forced GC.
* @param{any}cdp
* @param{import('playwright').Page}page
*/
async
function
measure
(
cdp, page
)
{
await
.
send
(
'HeapProfiler.collectGarbage'
)
;
await
new
Promise
(
r
=>
setTimeout
(
,
500
)
)
;
await
.
send
(
'HeapProfiler.collectGarbage'
)
;
await
new
Promise
(
r
=>
setTimeout
(
,
300
)
)
;
const
=
/** @type{any} */
(
await
.
send
(
'Runtime.getHeapUsage'
)
)
;
const
=
Math
.
round
(
.
usedSize
/
1024
/
1024
*
100
)
/
100
;
const
=
await
.
evaluate
(
(
)
=>
document
.
querySelectorAll
(
'*'
)
.
length
)
;
return
{
,
}
;
}
/**
* Open a new chat session via the command palette.
* @param{import('playwright').Page}page
*/
async
function
openNewChat
(
page
)
{
// Use keyboard shortcut to open a new chat (clears previous session)
const
=
.
platform
===
'darwin'
?
'Meta+KeyL'
:
'Control+KeyL'
;
await
.
keyboard
.
press
(
)
;
await
new
Promise
(
r
=>
setTimeout
(
,
1000
)
)
;
// Verify the chat view is visible and ready
await
.
waitForSelector
(
CHAT_VIEW
,
{
timeout
:
15_000
}
)
;
await
.
waitForFunction
(
(
sel
)
=>
Array
.
from
(
document
.
querySelectorAll
(
)
)
.
some
(
el
=>
.
getBoundingClientRect
(
)
.
width
>
0
)
,
CHAT_EDITOR_SEL
,
{
timeout
:
15_000
}
,
)
;
await
new
Promise
(
r
=>
setTimeout
(
,
500
)
)
;
}
/**
* Send a single message and wait for the response to complete.
* For multi-turn scenarios where the model makes multiple tool-call rounds
* before producing content, `modelTurns` controls how many completions to
* wait for.
* @param{import('playwright').Page}page
* @param{{ completionCount:()=> number, waitForCompletion:(n: number, ms: number)=> Promise<void>}}mockServer
* @param{string}text
* @param{number}[modelTurns=1] - number of model completions to wait for
*/
/**
* Run a full scenario: send the initial message, then handle any user
* follow-up turns for multi-turn scenarios.
*
* - Content-only scenarios: single message, 1 model turn.
* - Tool-call scenarios (no user turns): single message, N model turns
* (the extension automatically relays tool results back to the model).
* - Multi-turn with user turns: send initial message, wait for response,
* then for each user turn send the follow-up message and wait again.
*
* @param{import('playwright').Page}page
* @param{{ completionCount:()=> number, waitForCompletion:(n: number, ms: number)=> Promise<void>}}mockServer
* @param{string}scenarioId
* @param{string}label - prefix for the message (e.g. "Warmup" or "Iteration 2")
*/
async
function
runScenario
(
page, mockServer, scenarioId, label
)
{
const
=
getUserTurns
(
)
;
const
=
getModelTurnCount
(
)
;
if
(
.
length
===
0
)
{
// Content-only or tool-call scenario: one message, wait for all model turns
await
sendMessage
(
,
,
`[scenario:${scenarioId}] ${label}`
,
)
;
}
else
{
// Multi-turn with user follow-ups: send initial message and wait for
// the model turns before the first user turn, then alternate.