Commit Graph
23042 Commits
Author SHA1 Message Date
Vijay UpadyaandGitHub 7a76a605df Telemetry: Emit messagesJson compressed chunks as messagesJSONChunk (#328815)
* Telemetry: override chunk property name

* test update
2026-08-03 20:22:40 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c52f6d5e3e build(deps): bump @vscode/markdown-editor from 0.0.2-40 to 0.0.2-41 in /extensions/markdown-language-features (#328697)
build(deps): bump @vscode/markdown-editor

Bumps [@vscode/markdown-editor](https://github.com/microsoft/vscode-packages/tree/HEAD/vscode-team-tools/packages/markdown-editor) from 0.0.2-40 to 0.0.2-41.
- [Commits](https://github.com/microsoft/vscode-packages/commits/HEAD/vscode-team-tools/packages/markdown-editor)

---
updated-dependencies:
- dependency-name: "@vscode/markdown-editor"
  dependency-version: 0.0.2-41
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-04 01:03:47 +05:00
vs-code-engineering[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
365903f368 Bump version to 1.133.0 (#328671)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-03 13:43:30 +00:00
Bhavya UandGitHub a5944fe94f Enable tool search for Claude Haiku 4.5 and Sonnet 5 (#328662)
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.
2026-08-03 05:17:22 +00:00
849be60ee8 Prefer semantic search in agent mode (#328663)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-03 05:06:51 +00:00
Justin ChenandGitHub e51d1cb61d clean up picker descriptions (#328637) 2026-08-02 21:58:43 +00:00
Vikram NitinandGitHub 8c3c10f42d Merge pull request #328503 from vikramnitin9/vikram/exec_sub_remove_gemini_gating
Execution Subagent: Remove gating on Gemini Availability
2026-08-02 21:57:44 +00:00
1992d7c712 Enable tool search and prefer-long-context by default (#328628)
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>
2026-08-02 19:52:30 +00:00
cfc79ce010 editor priority: renames never to explicit (#328495)
* editor priority: renames never to explicit

* Update editor type picker priority test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9c58be62-6f9c-4386-8b05-6ef7594a8bf6

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9c58be62-6f9c-4386-8b05-6ef7594a8bf6
2026-08-01 23:04:13 +00:00
6dc67ef483 fix: wrap module script content in block scope to prevent false redeclaration errors (#308027)
* 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>
2026-08-01 00:30:58 +00:00
Justin ChenGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
91663e918c plan widget + commenting service (#328293)
* plan widget + commenting service

* address comments

* fix component fixtures and bug

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-08-01 00:00:05 +00:00
Dileep YavanmandhaandGitHub 7d661297ba Updating function call output to include content property for attaching cache breakpoint marker, (#328521)
Updating function call output to include content property when cacheBreakPoint is enabled
2026-07-31 23:00:46 +00:00
vritant24andCopilot ddf40933c4 Fix tool embeddings test constructor
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-31 13:18:32 -07:00
Vritant BhardwajandGitHub f7f831563f Merge branch 'main' into agents/investigate-unit-tests-agenthost-local 2026-07-31 13:08:50 -07:00
vritant24andCopilot 3e6e47985f Keep fallback tool groups within request limits
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-31 11:51:36 -07:00
9ccad27a28 Enable tool search for GPT models and add deferThreshold setting (#328136)
* Enable tool search for GPT models and add deferThreshold setting

- Uncomment GPT-5.4/5.5/5.6 support in agentHostModelSupportsToolSearch
- Add chat.agentHost.copilot.toolSearch.deferThreshold setting (default 1)
- Fix system instruction: generic 'use tool search' instead of backtick-quoted tool_search_tool name that doesn't exist in OpenAI Responses API
- Fix tool search description: generic 'deferred tools list' instead of extension-specific availableDeferredTools tag name
- Floor fractional threshold values to prevent runtime fallback to 30

* Address tool search review feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-31 11:32:32 -07:00
vritant24 f1446ccb43 Agent Host changes for agents/investigate-unit-tests-agenthost-local 2026-07-31 11:23:06 -07:00
Henning DieterichsandHenning Dieterichs c5f0840e78 Render Markdown diffs in the Markdown editor 2026-07-31 18:50:59 +02:00
924d37b459 Make coding agent voice aware for better voice experience (#328217)
* Add voice-aware progress to Copilot Agent mode

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Gate voice-aware agent progress

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Mir Imad Ahmed <mirimadahmed@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-07-31 16:24:24 +00:00
3d1fee0cc0 nes: preserve ghost-text state for speculative reuse (#328406)
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
2026-07-31 18:18:31 +05:00
Vritant BhardwajandGitHub 985c82d099 Merge pull request #328147 from microsoft/agents/gemini-agent-host-byok-fixes
copilot: preserve Gemini BYOK tool fidelity
2026-07-31 05:57:31 -07:00
9bbf5e43c8 Coalesce content exclusion fetches to stop exhausting the GitHub API rate limit (#328268)
* 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
2026-07-31 08:37:52 -04:00
2f841fe001 markdown: fix: route undo and redo to the document history (#328245)
* 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.

Fixes microsoft/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
2026-07-31 10:03:48 +05:00
Vritant BhardwajandGitHub 730bdd516e Merge branch 'main' into agents/gemini-agent-host-byok-fixes 2026-07-30 18:22:22 -07:00
b8f42e0b91 Support COPILOT_HOME for Copilot CLI state (#314917)
* Support COPILOT_HOME for Copilot CLI state

* Align Copilot CLI state with COPILOT_HOME

Use COPILOT_HOME as the configured Copilot root and otherwise fall back to ~/.copilot, matching the current CLI. XDG_STATE_HOME is now a migration source handled by the CLI rather than an active state location.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Honor COPILOT_HOME in agent host log collection

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Don Jayamanne <don.jayamanne@outlook.com>
2026-07-31 01:01:31 +00:00
vritant24andCopilot ca5a7f94ed copilot: preserve Gemini BYOK tool fidelity
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>
2026-07-30 17:40:17 -07:00
Vritant BhardwajandGitHub 767ea24568 Merge pull request #328146 from microsoft/agents/byok-agent-host-api-translation-review
agentHost: use Responses API for BYOK models
2026-07-30 17:36:16 -07:00
Osvaldo OrtegaandGitHub 9dc513a697 Fix checkout contribution for cloud sessions in backend v2 (#328258)
* 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.
2026-07-30 16:02:31 -07:00
Raymond ZhaoandGitHub 18a1f78e00 Revert "[cherry-pick] Add Kimi K3 biosecurity policy for Copilot Chat recovery" (#328260)
Revert "[cherry-pick] Add Kimi K3 biosecurity policy for Copilot Chat recover…"

This reverts commit eb7a00caa2.
2026-07-30 16:00:16 -07:00
vritant24andCopilot 243697fa70 agentHost: preserve BYOK reasoning continuation fidelity
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>
2026-07-30 11:50:49 -07:00
vritant24andCopilot 020db71706 agentHost: simplify encrypted thinking opt-in
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>
2026-07-30 11:50:49 -07:00
Vritant BhardwajandGitHub 6f67656a1a Merge branch 'main' into agents/byok-agent-host-api-translation-review 2026-07-30 11:47:32 -07:00
vs-code-engineering[bot]GitHubvs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>rzhao271
eb7a00caa2 [cherry-pick] Add Kimi K3 biosecurity policy for Copilot Chat recovery (#328213)
* [cherry-pick] Add Kimi K3 biosecurity policy for Copilot Chat recovery

* Resolve merge conflict in package.json, keeping version at 0.60.0

Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>

* Resolve merge conflict in package-lock.json, keeping version at 0.60.0

Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>

---------

Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
2026-07-30 16:45:42 +00:00
Benjamin SteenhoekandGitHub d9d6728092 Set default NES aggressiveness to medium (#327049) 2026-07-30 15:57:55 +00:00
dependabot[bot]andHenning Dieterichs abf2ee04c6 build(deps): bump @vscode/markdown-editor
Bumps [@vscode/markdown-editor](https://github.com/microsoft/vscode-packages/tree/HEAD/vscode-team-tools/packages/markdown-editor) from 0.0.2-26 to 0.0.2-37.
- [Commits](https://github.com/microsoft/vscode-packages/commits/HEAD/vscode-team-tools/packages/markdown-editor)

---
updated-dependencies:
- dependency-name: "@vscode/markdown-editor"
  dependency-version: 0.0.2-37
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-30 17:06:28 +02:00
Henning DieterichsandGitHub 019bc8f763 Apply smaller markdown editor edits (#328215) 2026-07-30 14:47:10 +00:00
Bhavya UandGitHub 3cd0ed6750 Don't splice signed thinking blocks from different responses when merging assistant messages (#328157)
Don't splice signed thinking blocks from different responses when merging assistant messages (#327646)
2026-07-30 05:26:05 +00:00
2c549ee083 Enable Agent Host migration settings by default (#328127)
* 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>
2026-07-30 02:56:36 +00:00
vritant24andCopilot bd2cb6d3ed agentHost: gate BYOK encrypted reasoning bridge
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>
2026-07-29 18:07:34 -07:00
vritant24andCopilot a97aec123f agentHost: use Responses API for BYOK models
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>
2026-07-29 17:50:46 -07:00
SrirajandGitHub e530e14eda Escape dynamic values in the customizations index (#327475)
* Escape customizations index values

* Scope customizations index escaping
2026-07-30 00:39:14 +00:00
Ulugbek AbdullaevandGitHub 1516e1ad31 nes: generate samples from workspace recordings (#328095)
* 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
2026-07-30 04:49:08 +05:00
Vritant BhardwajandGitHub dd83544dc8 Merge branch 'main' into dev/vritan24/geminiByok 2026-07-29 15:27:22 -07:00
Ulugbek AbdullaevandGitHub 060d04f069 xtab: clamp tagged patch range to document (#328090)
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
2026-07-30 01:41:11 +05:00
Arthur CnopsandGitHub eb699a8ed4 Voice: answer question carousels by voice (#327899) 2026-07-29 18:18:51 +00:00
Dileep YavanmandhaandGitHub ece5c004ed Set Responses API prompt cache mode (#327960)
* changes

Signed-off-by: Dileep Yavanamandha <dileepy@microsoft.com>

* fix: scope prompt cache policy to supported models

Signed-off-by: Dileep Yavanamandha <dileepy@microsoft.com>

* fix: restrict Responses cache breakpoint targets

Signed-off-by: Dileep Yavanamandha <dileepy@microsoft.com>

* fix: target supported Responses cache inputs

Signed-off-by: Dileep Yavanamandha <dileepy@microsoft.com>

* fix: restrict Responses cache markers to content blocks

Signed-off-by: Dileep Yavanamandha <dileepy@microsoft.com>

* fix: centralize cache breakpoint eligibility

Signed-off-by: Dileep Yavanamandha <dileepy@microsoft.com>

* fix: preserve response cache breakpoint position

---------

Signed-off-by: Dileep Yavanamandha <dileepy@microsoft.com>
2026-07-29 10:27:48 -07:00
69e459e483 fix: signature help's active overload not updating (#320980)
* 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>
2026-07-29 15:55:32 +00:00
Vritant BhardwajandGitHub 8172d49805 Merge branch 'main' into dev/vritan24/geminiByok 2026-07-29 06:47:55 -07:00
vritant24andCopilot a0507913cb copilot: fix Gemini BYOK tool schemas with nullable type arrays
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>
2026-07-29 06:45:02 -07:00
vs-code-engineering[bot]GitHubvs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
bbb34827b8 [cherry-pick] Fix Kimi K3 release model handling (#327786)
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
2026-07-29 10:46:53 +00:00