Anthropic's tool search compatibility table lists Haiku 4.5 as supported,
but the capability gate denied all Haiku. Sonnet 5 and Mythos 5 were also
missing from the tool's model picker list.
Flip the defaults for two settings that have been validated behind an
opt-in flag:
- `chat.agentHost.copilot.toolSearch.enabled`
- `github.copilot.chat.preferLongContext.enabled`
Both settings are defined in more than one place, so each pair is
updated together:
- Tool search: the workbench setting registration in
`chat.shared.contribution.ts` and the agent-host schema default in
`copilotCliConfig.ts` that the renderer forwards into.
- Prefer long context: the contributed default in the Copilot extension's
`package.json` and `ConfigKey.PreferLongContext`, which throws a
`BugIndicatingError` at load if the two drift, plus the forwarded
`preferLongContextEnabled` root-config default in `agentHostSchema.ts`.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: wrap module script content in block scope to isolate variables (#229357)
When multiple <script> tags exist in an HTML file, the HTML language
server concatenates their content into a single virtual JavaScript
document for validation. This causes false "Cannot redeclare
block-scoped variable" errors when <script type="module"> tags declare
variables with the same name as regular <script> tags, since module
scripts should have their own scope per the HTML spec.
Fix by wrapping <script type="module"> content in block scope delimiters
({ ... }) in the virtual document, preventing variable name collisions
between module scripts and regular scripts.
* fix: validate HTML module scripts separately
* test: cover HTML module script isolation
---------
Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
nes: fix: preserve ghost-text state for speculative reuse
Keep speculative next-edit results linked to their stable cache entry so suggestions shown as ghost text remain suppressible when reused in another view kind. Add coverage for speculative reuse, rebasing, and cache replacement.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93fb295d-2415-4079-b354-784417ad06f7
* Coalesce content exclusion fetches to stop exhausting the GitHub API rate limit
Every caller that discovered a new repository triggered a refresh of the
content exclusion rules for *every* known repository, so request volume grew
quadratically with repository count. In a workspace with many git repos (an
AOSP checkout, in the reported case) this produced ~16k requests to
api.github.com in 30 minutes, exhausting the account's 5k/hour REST budget and
starving everything sharing it, including Copilot token refresh.
The endpoint is https://api.github.com/copilot_internal/content_exclusion, so
it draws on the user's ordinary REST quota rather than a CAPI budget.
- Coalesce per repository using shared DeferredPromises, a short batching
window and a bounded-concurrency Limiter, so each repo is fetched at most
once per TTL and each caller only waits on the repos it asked for. A
regression test measures 75 requests -> 3 for 26 repositories.
- Only cache rules on a successful response. Empty placeholder rules were
written on discovery and left in place on failure, making a failed fetch
indistinguishable from "this repo has no exclusions" and preventing a retry
for 30 minutes, so exclusions silently stopped applying while rate limited.
- Only memoise a negative verdict once the relevant rules actually loaded,
which otherwise left files checked during an outage permanently allowed.
- Add a shared rateLimitBackoffMiddleware covering 429 and quota-exhausted 403
responses, honouring Retry-After and x-ratelimit-reset, and move both
RemoteContentExclusion and CloudSessionApiClient onto it. This replaces a
third hand-rolled copy of the same backoff logic.
- Precompile glob patterns, track the regex rule count directly, and only
invalidate memoised results when rules that could change an outcome arrive.
Fixes#322275
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 32f94728-158b-4639-b789-a5dd483f043f
* Address review feedback on cache invalidation and request lifecycle
Five correctness issues raised in review, each with a test that fails against
the previous implementation.
- rateLimitBackoffMiddleware: a response that was already in flight could clear
a block established by a concurrent rate-limited request, letting later calls
reach the server during the window the server asked us to wait out. The
backoff is now only reset once the active block has elapsed.
- isIgnored returned a memoised verdict before reaching the staleness check, so
a URI that had been evaluated once never triggered a refresh and could miss
newly added exclusions indefinitely. Verdicts are now tagged with a rule
generation and are only trusted while the rules behind them are unchanged and
unexpired.
- applyRules only invalidated verdicts when the incoming rules were non-empty,
so a refresh that removed the last rule left files excluded permanently.
Incoming rules are now compared against the previous set, which also avoids
invalidating on an unchanged refresh.
- drainPendingRepos cleared the pending map before its batches completed, so a
lookup arriving while a request was slow queued a duplicate fetch every
batching window. Entries now stay registered until their request settles, and
are removed only if still owned by that attempt.
- dispose only settled repos still queued. Limiter.dispose drops queued
factories without running them, so with more than five batches the callers
awaiting them never resolved. Pending entries are now settled before the
limiter is disposed, and enqueues after disposal resolve immediately.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 32f94728-158b-4639-b789-a5dd483f043f
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 32f94728-158b-4639-b789-a5dd483f043f
* markdown: fix: route undo and redo to the document history
The Agents window Markdown editor attaches an EditContext, so the browser
keeps no native undo history and the Cmd+Z / Cmd+Shift+Z chords never
reached VS Code. Wire them to the backing TextDocument's own history:
- editor.ts: pass a `historyStrategy` to `EditorController` that posts
`{ type: 'history', command }` to the extension. `record` is omitted so
the TextDocument stays the single source of truth (no second local stack
that would drift from the Edit menu, dirty state and hot exit).
- markdownEditorProvider.ts: run the built-in `undo`/`redo` command; the
active custom editor input scopes it to the resource's IUndoRedoService.
- editor.ts: apply host `update` via `replaceSourceText` instead of
`sourceText.set`, so the caret is mapped through the change (e.g. after an
undo shrinks the document) and stale pending-paragraph state is cleared.
Depends on the @vscode/markdown-editor API from microsoft/vscode-packages#189;
the pinned version must be bumped once that is published.
Fixesmicrosoft/vscode#327535
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b5b60dce-b175-4fe6-b2b5-d18a229c9929
* markdown: chore: bump @vscode/markdown-editor to 0.0.2-40
Pick up the published `@vscode/markdown-editor` release that ships the
`IHistoryStrategy` / `EditorControllerOptions.historyStrategy` and
`EditorModel.replaceSourceText` APIs (microsoft/vscode-packages#189) the
undo/redo integration depends on. Dependency set is unchanged from
0.0.2-26; lockfile integrity matches the published tarball.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b5b60dce-b175-4fe6-b2b5-d18a229c9929
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b5b60dce-b175-4fe6-b2b5-d18a229c9929
Normalize unsupported non-string Gemini enums and restore thought signatures when replaying historical function calls.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agent Host changes for osortega/agents/checkout-contribution-check-v2-backend
* Address review feedback and fix chat input fixtures
Require non-empty owner/name before building a pull request URI, so
metadata with empty strings no longer yields `https://github.com///pull/42`
and is no longer reported as an available pull request. Cover the case in
the unit test.
Implement `getSession` on the fixture `IAgentSessionsService` stub. The
chat input session toolbar reads it when a session has file changes, which
broke the chatInput FileChanges fixtures.
Condense the context key and chat input comments, and correct the cloud
sessions comment: the guard is reachable whenever `chatSessionPullRequest`
is unknown, not just on older clients.
Keep assistant text complete, group reasoning chunks by ID, and round-trip provider-specific continuation metadata through Responses encrypted content.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the Agent Host BYOK model-options sentinel and private MIME payload with a typed provider request option while retaining encrypted thinking metadata only for opted-in requests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: enable agent host defaults
Flip the Agent Host migration settings to their rolled-out defaults and enable remote Agent Host support for web clients attached to a remote extension host. Serverless web retains extension-host fallbacks. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: cover web agent host disablement
Add web-remote coverage for configuration and AI disablement, and clarify the serverless web requirement in the setting description. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: pin smoke session providers
Pre-seed extension-host smoke profiles before startup and update Agent Host picker labels so the suites exercise their intended providers after the default flip. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: restore agent host setting description
Keep the existing concise setting and policy description while retaining the runtime availability behavior. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Carry encrypted reasoning through a private data part only for Agent Host BYOK requests, preserving existing vscode.lm behavior for other consumers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve structured reasoning, tool calls, continuation metadata, and usage across the Agent Host renderer bridge while replacing the Chat Completions proxy contract.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* nes: feat: generate samples from workspace recordings
Parse stateful local workspace recordings, select deterministic user-edit and cursor pivots, materialize privacy-safe replay slices, and support bounded parallel datagen without splitting raw timelines.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 62cca64b-0581-410e-ab89-034e20f02ca7
* nes: fix: include cursor boundaries in sample deduplication
Hash the complete post-pivot label so identical prompts with different cursor destinations are rejected as conflicting samples.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 62cca64b-0581-410e-ab89-034e20f02ca7
* nes: fix: consolidate workspace recording imports
Use inline type specifiers so the Copilot extension lint job accepts the new workspace-recording modules.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 62cca64b-0581-410e-ab89-034e20f02ca7
---------
Copilot-Session: 62cca64b-0581-410e-ab89-034e20f02ca7
xtab: fix: clamp tagged patch range to document
Tagged prompt content can add lines beyond the source document. Clamp the CustomDiffPatch pseudo-window to the source range to avoid an unexpected failure.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 62cca64b-0581-410e-ab89-034e20f02ca7
* fix: signature help active overload not updating
- Active overload now updates when typed arguments narrow the overload set
* fix: replace findIndex with direct index lookup in getActiveSignature
- Instead of searching signatures by label to get an index and comparing
it to info.selectedItemIndex, look up signatures[info.selectedItemIndex]
directly so both sides of the comparison use the same index source
* test: add unit tests for #268728 overload fix
- Extract getActiveSignature as an exported function so unit
tests can import it without the extension host
- Add BEFORE suite documenting the original bug: on retrigger,
old code returned the stale overload index even after
TypeScript updated selectedItemIndex (e.g. after a string
argument narrows the overload set on the comma trigger)
- Add AFTER suite verifying the fix: retrigger now honours
TypeScript's updated selectedItemIndex; the BUG test case
that returned 0 now correctly returns 1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address Copilot review on #268728
- Rename exported helper to computeActiveSignatureIndex to
avoid identifier collision with the private method
- Stop returning activeSignatureHelp.activeSignature: that
index refers to the previous signature list, which is stale
if the list reorders between invocations; always use
tsSelectedItemIndex instead
- Add regression test for the reordering case: verifies that
when the list reorders and TS still selects the same overload
by label, the current index is returned, not the stale one
* fix: address Copilot review on #268728
- Simplify computeActiveSignatureIndex to only accept
tsSelectedItemIndex; the context and signatures params
were unused and made the API misleading
- Add @internal JSDoc to signal the
computeActiveSignatureIndex export is for unit
testing only, not public API
- Replace assertion-based BEFORE suite with block comment
documenting the original bug; asserting known-wrong
behaviour institutionalizes incorrect expectations
* fix: simplify active overload selection
- Replace the label-matching retrigger guard with result.activeSignature = info.selectedItemIndex;
the guard became a no-op after the existingIndex === selectedItemIndex fix and its removal is the correct minimal change
- Export TypeScriptSignatureHelpProvider as _TypeScriptSignatureHelpProvider
(VS Code underscore-prefix convention for test-only exports)
- Add unit tests via mock ITypeScriptServiceClient: documents the old buggy guard behavior
and verifies the fix — the FIX test would fail if the label-matching guard were reintroduced
* fix: address Copilot unit test review comments
- Move CancellationTokenSource into setup/teardown so it is properly disposed after each test
- Add success: true and message: '' to mock response to match the protocol shape
- Add @internal test-only export JSDoc to _TypeScriptSignatureHelpProvider to make the export intent explicit
* Fix signature help overload selection
Track TypeScript-selected and user-selected overloads separately so retriggers follow updated recommendations without resetting manual selections.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Gemini BYOK function-declaration converter assumed a JSON Schema
`type` was always a single string. When a tool parameter used a nullable
union such as `{ "type": ["string", "null"] }`, the array was stringified
into `"string,null"` and rejected with `Unsupported type: string,null`.
Through the Agent Host this surfaced as an HTTP 502 that the Copilot SDK
retried five times before failing the turn. Because the failure lives in
the shared converter, regular editor BYOK is susceptible to the same
schema shape.
Normalize nullable unions to Gemini's `nullable: true`, map multi-type
unions to `anyOf`, and handle nullable array items and anyOf/oneOf that
contain `null`. Add regression tests for these cases.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>