Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* The mock server handle plus the request-capture accessor the perf/smoke
* harness exposes (see `scripts/chat-simulation/common/mock-llm-server.ts`).
*/
interface
MockServerWithRequests
extends
MockLlmServer
{
getRequests
(
)
:
[
]
;
}
/**
* Display name of the dedicated mock model that advertises both a Thinking
* Effort and a Context Size picker (see `mock-config-model` in the mock server).
*/
const
MODEL_NAME
=
'Mock Config Model'
;
/**
* Model id the mock server advertises for {@link MODEL_NAME}. Used to single out
* the main agent `/responses` request from ancillary requests (e.g. title
* generation) that may also carry the conversation history.
*/
const
MODEL_ID
=
'mock-config-model'
;
/**
* Combinations of model-configuration picker selections to exercise. Each case
* selects a Context Size (and, unless it is verifying the untouched default, a
* Thinking Effort) in the model-picker UI, sends a tagged prompt, and verifies
* the values the mock server received in the `/responses` request body:
* - reasoning effort → `body.reasoning.effort`
* - context size → `body.context_management[0].compact_threshold`
*
* Numbers mirror a GPT-5.5-class model. The compaction threshold is
* `floor(maxPromptTokens * 0.9)`. The default tier exposes a 272000 prompt
* window (→ 244800). The long tier is the full window minus the 128000 output
* reserve — `1050000 - 128000 = 922000` (→ 829800); note `formatTokenCount`
* renders 922000 as "1M" (its `>900K → 1M` branch). The context-usage gauge
* total is `maxInputTokens(tier) + maxOutputTokens`, i.e. `272000 + 128000 =
* 400000` ("400K") and `922000 + 128000 = 1050000` ("1M").
*/
interface
ConfigCase
{
readonly
:
string
;
/**
* Thinking Effort label to select, or `undefined` to leave the picker
* untouched and verify its schema default (`medium`) is forwarded. A case
* that relies on the default must run before any case selects an effort (the
* per-editor config is sticky), so it is listed first.
*/
readonly
?
:
string
;
readonly
:
string
;
readonly
:
string
;
readonly
:
number
;
/** The combined label the model-config button should show after selection (e.g. "High 1M"). */
readonly
:
string
;
/** The context-window denominator the context-usage gauge details popup should show. */
readonly
:
string
;
readonly
:
string
;
readonly
:
string
;
}
const
CONFIG_CASES
:
readonly
[
]
=
[
// Listed first so the Thinking Effort picker is still at its schema default
// (`medium`): this case leaves the effort untouched and only selects the
// context size, verifying that an unmodified picker forwards its default.
{
:
'Default effort (untouched), full context'
,
:
'medium'
,
:
'1M'
,
:
829_800
,
:
'Medium 1M'
,
:
'1M'
,
:
'smoke-model-config-default-long'
,
:
'MOCKED_MODEL_CONFIG_DEFAULT_LONG'
}
,
{
:
'High effort, full context'
,
:
'High'
,
:
'high'
,
:
'1M'
,
:
829_800
,
:
'High 1M'
,
:
'1M'
,
:
'smoke-model-config-high-long'
,
:
'MOCKED_MODEL_CONFIG_HIGH_LONG'
}
,
{
:
'Medium effort, default context'
,
:
'Medium'
,
:
'medium'
,
:
'272K'
,
:
244_800
,
:
'Medium 272K'
,
:
'400K'
,
:
'smoke-model-config-medium-default'
,
:
'MOCKED_MODEL_CONFIG_MEDIUM_DEFAULT'
}
,
]
;
/**
* Find the latest `/responses` request (at or after `fromIndex`) sent for the
* mock model whose *current* user turn carries the given scenario tag.
*
* The Responses API request replays the whole conversation in its `input`
* array, so an earlier turn's `[scenario:...]` tag lingers in the history of
* later requests — and ancillary requests (e.g. title generation) can replay
* that same history. Matching the serialized body anywhere would therefore pick
* the wrong request, so we check only the latest `user` input item (the prompt
* just sent for this turn), mirroring how the mock server resolves the active
* scenario.
*/
function
findResponsesRequest
(
:
[
]
,
:
number
,
:
string
)
:
any
|
undefined
{
for
(
let
=
.
-
1
;
>=
;
--
)
{
const
=
[
]
;
if
(
.
!==
'/responses'
||
.
?.
!==
MODEL_ID
)
{
continue
;
}
if
(
latestUserInputCarriesTag
(
.
,
)
)
{
return
.
;
}
}
return
undefined
;
}
/**
* Whether the latest `user` item in a Responses API request's `input` array
* contains `scenarioTag`. The item's `content` is either a plain string or an
* array of `{ text }` parts (matching the mock server's own scenario parsing).
*/
function
latestUserInputCarriesTag
(
:
any
,
:
string
)
:
boolean
{
const
=
Array
.
isArray
(
?.
)
?
.
:
[
]
;
for
(
let
=
.
-
1
;
>=
0
;
--
)
{
const
=
[
]
;
if
(
?.
!==
'user'
)
{
continue
;
}
const
=
typeof
.
===
'string'
?
.
:
Array
.
isArray
(
.
)
?
.
.
map
(
(
:
any
)
=>
?.
??
''
)
.
join
(
''
)
:
''
;
return
.
includes
(
)
;
}
return
false
;
}
/**
* Sends the warm-up message and waits for the model's reply, retrying until the
* panel is actually usable. In a from-source build the panel's first send can
* route to the (failing) chat-setup install path until the anonymous
* entitlement resolves, so a single send is not reliable — each retry gives the
* entitlement service more time to settle and, once it has, the send reaches the
* copilot chat participant which activates the extension and replies.
*/
async
function
sendWarmUpUntilReady
(
:
,
:
)
:
Promise
<
void
>
{
const
=
'[scenario:smoke-model-config-warmup]'
;
const
=
.
now
(
)
+
180_000
;
let
=
0
;
let
:
unknown
;
while
(
.
now
(
)
<
)
{
++
;
try
{
await
.
sendMessage
(
`warm up ${tag}`
)
;
await
.
waitForResponseText
(
'MOCKED_WARMUP'
,
25_000
)
;
.
log
(
`[Chat Model Config] warm-up succeeded on attempt ${attempt}`
)
;
return
;
}
catch
(
)
{
=
;
.
log
(
`[Chat Model Config] warm-up attempt ${attempt} not ready yet; retrying`
)
;
}
}
throw
new
Error
(
`Chat did not become ready for warm-up within timeout. Last error: ${lastError instanceofError? lastError.message :String(lastError)}`
)
;
}
export
function
setup
(
:
)
{
describe
(
'Chat Model Configuration'
,
function
(
)
{
this
.
timeout
(
5
*
60
*
1000
)
;
this
.
retries
(
0
)
;
let
:
;
before
(
async
function
(
)
{
const
{
,
,
}
=
require
(
getMockLlmServerPath
(
)
)
;
// Fallback for ancillary requests (title generation etc.) that don't
// carry a [scenario:...] tag.
registerScenario
(
'text-only'
,
new
ScenarioBuilder
(
)
.
emit
(
'OK'
)
.
build
(
)
)
;
// Warm-up scenario: the first message activates the Copilot extension
// and registers the models, which populates the model picker.
registerScenario
(
'smoke-model-config-warmup'
,
new
ScenarioBuilder
(
)
.
emit
(
'MOCKED_WARMUP'
)
.
build
(
)
)
;
// One scenario per case, each emitting a distinct reply so the
// response-text assertion unambiguously identifies the current turn.
for
(
const
of
CONFIG_CASES
)
{
registerScenario
(
.
,
new
ScenarioBuilder
(
)
.
emit
(
.
)
.
build
(
)
)
;
}
=
await
startServer
(
0
,
{
logger
:
(
:
string
)
=>
.
log
(
`[mock-llm] ${msg}`
)
,
:
true
}
)
;
.
log
(
`[Chat Model Config] mock LLM server started at ${mockServer.url}`
)
;
}
)
;
installAllHandlers
(
,
=>
{
const
=
getCopilotSmokeTestEnv
(
,
{
:
.
}
)
;
return
{
...
,
:
[
...
(
.
??
[
]
)
,
'--log=trace'
]
,
:
{
...
(
.
??
{
}
)
,
...
,
}
,
}
;
}
,
async
=>
{
// Seed the migration storage key so the from-source built-in
// copilot-chat stays enabled on the fresh per-run profile. Without
// this, BuiltinChatExtensionEnablementMigration disables it (chat
// setup is never "completed" in automation) and the first send fails
// through chat-setup's install path before the warm-up retry recovers.
await
preseedChatExtensionEnablement
(
.
)
;
}
)
;
before
(
async
function
(
)
{
const
=
this
.
as
;
.
log
(
`[Chat Model Config] writing user settings (mock URL=${mockServer.url})`
)
;
await
.
.
.
addUserSettings
(
[
[
'github.copilot.advanced.debug.overrideProxyUrl'
,
JSON
.
stringify
(
.
)
]
,
[
'github.copilot.advanced.debug.overrideCapiUrl'
,
JSON
.
stringify
(
.
)
]
,
[
'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'
]
,
// Show the context-usage gauge so the test can verify the denominator
// (context window) reflects the selected Context Size.
[
'chat.contextUsage.enabled'
,
'true'
]
,
// Enable Responses-API context management so the chosen Context Size
// is forwarded as a `compact_threshold`. This is an experiment-based
// setting (default off); set it explicitly for a deterministic run.
`[Chat Model Config] case '${testCase.name}' verified: reasoning.effort='${requestBody.reasoning?.effort}', compact_threshold=${compactThreshold}, contextWindow='${contextWindowLabel}'`
)
;
}
}
catch
(
)
{
.
log
(
`[Chat Model Config] FAILURE: ${error instanceofError? error.stack ?? error.message :String(error)}`