Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/** Skip the second message/assertion (e.g. while a known flake is being investigated). */
readonly
?
:
boolean
;
}
const
SESSIONS
:
readonly
[
]
=
[
{
:
'Copilot CLI'
,
:
'smoketest.openCopilotCliChat'
,
:
'editor'
,
:
'smoke-chat-sessions-copilot-cli'
,
:
'MOCKED_CHAT_SESSIONS_COPILOT_CLI_RESPONSE'
,
:
'smoke-chat-sessions-copilot-cli-2'
,
:
'MOCKED_CHAT_SESSIONS_COPILOT_CLI_RESPONSE_2'
}
,
{
:
'Local'
,
:
'smoketest.openLocalChat'
,
:
'view'
,
:
'smoke-chat-sessions-local'
,
:
'MOCKED_CHAT_SESSIONS_LOCAL_RESPONSE'
,
:
'smoke-chat-sessions-local-2'
,
:
'MOCKED_CHAT_SESSIONS_LOCAL_RESPONSE_2'
}
,
]
;
/**
* Per-session shell-tool scenarios. Each session triggers a shell tool call
* on the first prompt and verifies the echoed marker appears in the chat
* (which proves both that the command ran and that the reply was rendered).
* Copilot CLI advertises `bash`/`pwsh`/`powershell`; the Local chat agent
* advertises `run_in_terminal`.
*/
interface
ShellSessionConfig
{
readonly
:
string
;
readonly
:
string
;
readonly
:
'editor'
|
'view'
;
readonly
:
string
;
readonly
:
string
;
readonly
scenarioFactory
:
(
:
string
)
=>
unknown
;
}
const
SHELL_SESSIONS
:
readonly
[
]
=
[
{
:
'Copilot CLI'
,
:
'smoketest.openCopilotCliChat'
,
:
'editor'
,
:
'smoke-chat-sessions-copilot-cli-shell'
,
:
'MOCKED_CHAT_SESSIONS_COPILOT_CLI_SHELL_RESPONSE'
,
:
}
,
{
:
'Local'
,
:
'smoketest.openLocalChat'
,
:
'view'
,
:
'smoke-chat-sessions-local-terminal'
,
:
'MOCKED_CHAT_SESSIONS_LOCAL_TERMINAL_RESPONSE'
,
:
}
,
]
;
/**
* Write all activation-sensitive settings before VS Code starts. Pre-seeding
* only the enablement migration can activate Copilot Chat before its mock
* endpoints are configured.
*/
async
function
preseedChatSessionProfile
(
:
string
|
undefined
,
:
string
)
:
Promise
<
void
>
{
if
(
!
)
{
throw
new
Error
(
'Cannot pre-seed Chat Sessions profile without a user data directory'
)
;
}
const
=
.
join
(
,
'User'
,
'settings.json'
)
;
.
mkdirSync
(
.
dirname
(
)
,
{
:
true
}
)
;
.
writeFileSync
(
,
JSON
.
stringify
(
{
'github.copilot.advanced.debug.overrideProxyUrl'
:
,
'github.copilot.advanced.debug.overrideCapiUrl'
:
,
'github.copilot.advanced.debug.overrideAuthType'
:
'token'
,
'chat.allowAnonymousAccess'
:
true
,
'github.copilot.chat.githubMcpServer.enabled'
:
false
,
'chat.mcp.discovery.enabled'
:
false
,
'chat.mcp.enabled'
:
false
,
'chat.disableAIFeatures'
:
false
,
'chat.agentHost.claudeAgent.enabled'
:
true
,
'github.copilot.chat.backgroundAgent.enabled'
:
true
,
'chat.tools.riskAssessment.enabled'
:
false
,
}
,
undefined
,
'\t'
)
)
;
await
preseedChatExtensionEnablement
(
)
;
}
async
function
openSession
(
:
,
:
{
readonly
:
string
;
readonly
:
'editor'
|
'view'
}
)
:
Promise
<
void
>
{
await
.
.
.
runCommand
(
.
)
;
if
(
.
===
'editor'
)
{
await
.
.
.
waitForChatEditor
(
600
)
;
}
else
{
await
.
.
.
waitForChatView
(
)
;
}
}
async
function
sendAndWaitForReply
(
:
,
:
,
:
string
,
:
string
)
:
Promise
<
string
>
{
if
(
.
===
'editor'
)
{
await
.
sendEditorMessage
(
)
;
// Poll for the actual reply text rather than just waiting for a
// completed response bubble. Copilot CLI keeps the
// `chat-response-loading` class on the bubble even after streaming
// finishes, which would otherwise cause the follow-up assertion to
// time out. Each scenario emits a unique reply so a single text
// match unambiguously identifies the current response.
return
(
await
.
waitForEditorResponseText
(
,
120_000
)
)
.
trim
(
)
;
}
await
.
sendMessage
(
)
;
return
(
await
.
waitForResponseText
(
,
120_000
)
)
.
trim
(
)
;
}
export
function
setup
(
:
)
{
describe
(
'Chat Sessions'
,
function
(
)
{
this
.
timeout
(
5
*
60
*
1000
)
;
this
.
retries
(
0
)
;
let
:
;
// Start the mock server BEFORE installAllHandlers' `before` runs so
// the mock URL is available when we configure the app's env vars via
// `optionsTransform`.
before
(
async
function
(
)
{
const
{
,
,
}
=
require
(
getMockLlmServerPath
(
)
)
;
// Fallback for ancillary requests (title/branch) that don't carry a [scenario:...] tag.
registerScenario
(
'text-only'
,
new
ScenarioBuilder
(
)
.
emit
(
'OK'
)
.
build
(
)
)
;
// One scenario per session type, each emitting a distinct reply
// so the assertion is unambiguous. A second scenario per session
// covers the follow-up message in the same chat surface.
for
(
const
of
SESSIONS
)
{
registerScenario
(
.
,
new
ScenarioBuilder
(
)
.
emit
(
.
)
.
build
(
)
)
;
registerScenario
(
.
,
new
ScenarioBuilder
(
)
.
emit
(
.
)
.
build
(
)
)
;
}
// Shell-tool scenarios. `echo` is in the default
// `chat.tools.terminal.autoApprove` list, so no extra settings
// are required to auto-approve the command — these tests
// deliberately exercise the non-sandbox shell-tool path.
for
(
const
of
SHELL_SESSIONS
)
{
registerScenario
(
.
,
.
scenarioFactory
(
.
)
)
;
}
=
await
startServer
(
0
,
{
logger
:
(
:
string
)
=>
.
log
(
`[mock-llm] ${msg}`
)
}
)
;
.
log
(
`[Chat Sessions] mock LLM server started at ${mockServer.url} (platform=${process.platform}, arch=${process.arch}, node=${process.version})`
`Expected ${session.name} response 2 to include mocked scenario response "${session.reply2}".\n\nResponse:\n${responseText2}`
)
;
}
else
{
.
log
(
`[Chat Sessions/${session.name}] skipping second reply assertion (skipReply2=true)`
)
;
}
.
ok
(
.
requestCount
(
)
>
,
`expected the mock LLM server to have received a new request from the ${session.name} session (before=${requestsBefore}, after=${mockServer.requestCount()})`
`Expected ${shellSession.name} shell response to include the echoed marker "${shellSession.reply}" inside a JSON tool result string.\n\nResponse:\n${responseText}`
)
;
.
ok
(
.
requestCount
(
)
>
,
`expected the mock LLM server to have received a new request from the ${shellSession.name} shell session (before=${requestsBefore}, after=${mockServer.requestCount()})`