Skip to content

[pull] main from microsoft:main#1448

Merged
pull[bot] merged 47 commits into
KingDEV95:mainfrom
microsoft:main
May 21, 2026
Merged

[pull] main from microsoft:main#1448
pull[bot] merged 47 commits into
KingDEV95:mainfrom
microsoft:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 21, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Lefgk and others added 30 commits May 19, 2026 13:15
…s providers (#317525)

* sessions: workspace picker emits folder URI, session type picker spans providers

Refactor the new-session workspace picker so it selects only a folder URI
instead of a (providerId, workspace) pair. The session management service
resolves the provider from the URI at session-creation time. The session
type picker now queries the management service for all session types every
registered provider can serve for the folder, grouped by provider with a
separator between groups.

Highlights:

- ISessionsManagementService gains:
  - getSessionTypesForFolder(folderUri): returns one entry per provider x
    sessionType supported for the URI.
  - resolveWorkspaceForFolder(folderUri): finds the first provider that
    can resolve the URI.
  - createNewSession(folderUri, options?): iterates providers and picks
    the first matching one when no providerId is supplied.

- WorkspacePicker:
  - Emits URI | undefined; selectedFolderUri / setSelectedWorkspace(uri).
  - Drops the up-front quick-pick that asked the user to choose between
    multiple local providers when browsing.
  - Recents storage stores URI only (with backward-compat reads of old
    {uri, providerId} entries); recents resolution prefers the stored
    providerId hint so a re-picked folder stays with the same provider.

- SessionTypePicker:
  - Reads getSessionTypesForFolder; groups items by provider with a
    separator between groups and the provider label as a header.
  - Emits IPickedSessionType = { providerId, sessionTypeId } so the same
    sessionType id (e.g. 'copilot-cli') from different providers is
    disambiguated.
  - Recomputes types at open time as a safety net for late-registering
    providers.

- SessionsManagementService._updateSessionTypes now fires
  onDidChangeSessionTypes unconditionally; the previous dedup check
  skipped the event when a new provider contributed an overlapping
  sessionType id, leaving the per-folder list stale.

- LocalAgentHostSessionsProvider drops the `[Local]` suffix from
  workspace labels so its sessions for a folder share the workspace
  group with other providers' sessions for the same folder.

- NewChatViewPane is rewired to the URI flow and uses the picker's
  selectedResolved.providerId as the createNewSession fallback when
  the session type picker has no explicit pick yet, preserving the
  user's historical provider association for recently-picked folders.

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

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* sessions: address CCR feedback — providerId hint + legacy session type pref

- selectWorkspace(folderUri, providerId?) plumbs an explicit providerId
  hint from "New Session" in a workspace section down through the
  workspace picker so the created session matches the section's provider.
- setSelectedWorkspace accepts an options bag with { fireEvent?, providerId? }.
- _readStoredPick now honors legacy storage shapes (raw string sessionTypeId
  and JSON without providerId) as a deferred preference; the provider is
  resolved lazily once the active folder is known.
- New IPreferredSessionType type for stored / restored preferences where
  providerId may be missing; IPickedSessionType remains required-providerId
  for picker emissions.

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

* sessions: rename IFolderSessionType → IProviderSessionType and getSessionTypes → getSessionTypesForFolder

- IFolderSessionType was misleading (implied 'a type for a folder'; it's really a provider × session-type pair)
- ISessionsManagementService.getSessionTypes() collided in name with ISessionsProvider.getSessionTypes() but returned a different type
- Rename to IProviderSessionType and getSessionTypesForFolder() for clarity

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Address GHE onboarding issues

* More polish

* Enhance GitHub Enterprise sign-in flow with improved UI state management and input validation

* Use InputBox for GHE onboarding entry

* Implement GHE instance input parsing and validation with unit tests

* Update onboarding button behavior based on user sign-in status

Co-authored-by: Copilot <copilot@github.com>

* Wrap overflow text

* Address PR review feedback

- Fix GHE_DOMAIN_REGEX to allow numbers (consistent with GHE_FULL_URI_REGEX)
- Use inputBox.onDidChange instead of raw DOM 'input' listener
- Remove hardcoded RGBA fallbacks in CSS that break light themes
- Extract duplicate error notification to _notifyEnterpriseSignInError helper
- Clear enterpriseSignInWatch when cancelling via back button or Escape
- Remove redundant .info CSS rule (identical to base rule)
- Add missing test for single-word slug with numbers

* Revert CSS rgba fallbacks, clear enterpriseSignInWatch in _nextStep

- Restore rgba() fallbacks in GHE CSS to match the rest of the file
  (these CSS variables may be undefined in some themes)
- Clear enterpriseSignInWatch in _nextStep when leaving sign-in step
  to prevent StopWatch leak when user clicks GHE then continues
  without signing in

* Address some PR feedback and cleanup listeners

* middle aligned arrow

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Logan Ramos <lramos15@gmail.com>
Co-authored-by: Logan Ramos <loganramos@microsoft.com>
Co-authored-by: Elijah King <elijahwilliamking@icloud.com>
#317532)

Add agent (grok build, cursor) and agy (antigravity) CLIs to ignoredCommands

This will turn off sticky scroll when these CLIs are active
Persists enough installed plugin identity for marketplace plugins to survive reloads while keeping installed.json easy for external tools to read.

- Stores plugin name alongside plugin URI and marketplace in installed.json, avoiding full source descriptor persistence.

- Hydrates installed plugin metadata by re-reading marketplace data and matching current entries by stored name.

- Falls back to install URI matching for older entries without names and keeps package/git install URI handling consistent.

- Adds focused coverage for GitHub-sourced marketplace plugins like azure from awesome-copilot.

(Commit message generated by Copilot)
…ptsStorage (#317555)

* add ChatSessionCustomizationItem.source, clean up AICustomizationPromptsStorage

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* update

* use promptsServiceItemProvider

* update

* update

* update

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ixes #317566) (#317576)

When sessionManager.getSession() throws due to a corrupted session file,
catch the error, log it, and return empty history instead of letting the
error propagate as an unhandled rejection.

This follows the same pattern used in sessionReindexer.ts where corrupt
sessions are skipped gracefully.

Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Megan Rogge <meganrogge@Megans-MacBook-Pro.local>
…ilot

Remove copilot models from default list
* fix worktree-created task dispatch

Only dispatch worktree-created tasks for newly-created sessions once a concrete worktree is available. Keep restored sessions from re-running setup tasks on window open while still tracking pending untitled sessions created before the dispatcher starts.

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

* fix worktree task replacement tracking

Avoid wall-clock restored-session checks and only allow committed replacements from still-pending tracked sessions. This prevents restored or already-dispatched sessions from re-running worktreeCreated tasks while preserving pending untitled session dispatch.

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

---------

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

* agents: add smoke test for Agents Window with mocked LLM server

Adds a smoke test that opens the Agents Window, creates a new session
on a workspace folder, sends a 'hello world' prompt, and verifies the
request reaches a local mock LLM server that returns a canned response.

The test exercises two session types: Copilot CLI and Claude Code. A
third Local-session test is included but marked `it.skip` for now.

Key pieces:

* `test/smoke/src/areas/agents/agents.test.ts` — new smoke suite. Starts
  `scripts/chat-simulation/common/mock-llm-server.js` on a random port,
  registers a per-test scenario with a distinct reply, and injects
  `VSCODE_COPILOT_CHAT_TOKEN` / `GITHUB_PAT` / `IS_SCENARIO_AUTOMATION`
  env vars so the Copilot extension's token manager picks up a fake
  token whose endpoints.api/proxy point at the mock server.

* `test/automation/src/agents.ts` — new `Agents` workbench helper with
  `openCurrentFolderInAgentsWindow`, `switchToAgentsWindow`,
  `startNewSession`, `selectSessionType`, `submitNewSessionPrompt`,
  `waitForAssistantText`.

* `test/automation/src/code.ts` + `electron.ts` — `LaunchOptions` now
  accepts an `extraEnv` map that is merged on top of `process.env`
  when spawning the Electron child, so tests can inject env-based mocks
  without going through a custom launcher.

* `src/vs/sessions/browser/sessionsSetUpService.ts` —
  `shouldSkipSessionsWelcome` now returns `true` whenever
  `enableSmokeTestDriver` is set, so the welcome/auth dialog does not
  block smoke runs.

* `scripts/chat-simulation/common/mock-llm-server.js` — adds two
  models to `EXTRA_MODELS` (`gpt-5.3-codex` for Copilot CLI default,
  `claude-sonnet-4.5` for Claude Code), and routes `/v1/messages` to a
  new `handleMessagesApi` that streams Anthropic-format SSE
  (`message_start` / `content_block_delta` / `message_stop`) which the
  Claude Code session type's messages-API parser expects.

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

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix copilot cli test

* skip claude test

* sessions: fix new-session removal regression and rename smoke test

1. Revert the `_refreshSessionCache` filter change from d5747b3
   back to `adapter instanceof AgentSessionAdapter`. The broadened
   `adapter !== this._currentNewSession` check raced with the
   unconditional `this._currentNewSession = undefined` in the
   `_sendFirstChat*` paths: a late callback from a previous session's
   commit would wipe the pointer and the next refresh would evict the
   new session's temp adapter, navigating the Agents Window back to the
   homepage mid-request.

2. Rename the Agents Window smoke test infrastructure for clarity:
   - `test/automation/src/agents.ts` -> `agentsWindow.ts`
     (class `Agents` -> `AgentsWindow`,
     `workbench.agents` -> `workbench.agentsWindow`)
   - `test/smoke/src/areas/agents/agents.test.ts` ->
     `areas/agentsWindow/agentsWindow.test.ts`

Verified with 10 consecutive smoke-test loops: 8/10 fully green
(Copilot CLI + Claude + Local), 2 intermittent UI timing flakes
unrelated to the navigation regression.

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

* agents smoke: address PR #317545 review feedback

- switchToAgentsWindow: replace fixed 2s sleep with waitForElement on
  the Agents workbench DOM (`.agent-sessions-workbench`) so the helper
  returns as soon as the new window is interactable.
- resolveElectronConfiguration: apply `extraEnv` last, after the
  TESTRESOLVER_* assignments in the remote branch, so caller-provided
  env vars truly have final precedence.

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

* agents smoke: skip Agents Window tests for OSS quality

The Copilot extension is not built in OSS CI (it's in excludedExtensions
and its dist/extension.js is only produced by its own esbuild pipeline).
Without it all three session-type providers fail to activate, causing
every Agents Window test to time out.

Skip the suite when quality is OSS, matching the pattern used by
setupExtensionTests and setupLocalizationTests.

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

* copilotcli: add proxy endpoint to getAuthInfo for mock server routing

Without `endpoints.proxy`, the SDK's model-fetch calls
(`/models/session`, `/copilot_internal/v2/token`) fall back to
the real GitHub API which rejects the fake HMAC with a 401. This
caused intermittent smoke test failures (1 in 10) because the
Copilot CLI language models never registered, making the chat-setup
readiness gate depend on Claude's model registration timing.

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

* copilotcli: don't cache failed model fetches

When `getAvailableModels` throws (e.g. transient network failure or
HMAC validation error with a proxy), the empty result was permanently
cached in `_availableModels`. Subsequent calls to `getModels()` would
return the cached empty array without retrying, leaving the Copilot CLI
language model provider with zero models for the rest of the session.

Clear `_availableModels` on error so the next call retries the fetch.

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

* agents smoke: reset workspace before opening Agents Window

Earlier smoke test suites (e.g. Tasks) modify .vscode/tasks.json and
leave uncommitted changes. A dirty workspace prevents worktree creation
and triggers the uncommitted-changes confirmation flow which aborts the
Copilot CLI session on builds.

Reset via `git checkout . --quiet` in the before hook, matching the
pattern used by notebook and search smoke tests.

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

---------

Co-authored-by: Sandeep Somavarapu <sandy081@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Fixes #316968

Creates a new theme for mermaid diagrams that is derived from the current VS Code color theme
Fix typo in README contributing section
mjbvz and others added 17 commits May 20, 2026 14:23
Sessions surfaced by the agent host sessions provider were using the
generic provider icon (`vm` for Local, `remote` for Remote) instead of
the per-agent icon that the matching session type already uses (e.g.
`copilot`, `claude`, `openai`).

Route session adapter and new-session creation through the same
`iconForAgentProvider` lookup that `_syncSessionTypesFromRootState`
uses, so a session's icon always matches its session type.

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

Add granular provider group management actions to Manage Models
Sanity test: tighten agent-mode prompt so the model can't skip the tool call
…etimers

test(mcp): silence sinon FakeTimers native-timer warning in sampling log tests
Add new VS Code theme for mermaid diagrams
* Sessions list: don't reorder when find widget opens

Previously, opening the find widget in the sessions list (clicking the
search icon) immediately bypassed workspace group capping and per-group
limits, causing a visible reorder before any text was typed.

Track the find pattern instead of the find open state so reordering
only happens once the user actually types a search query.

Fixes #317520

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

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* agent-host: stop redundant customization sync events

Refactors customization syncing to publish state changes as SessionActions
through the session state manager rather than via a per-call progress callback
that emitted full lists each tick. Also avoids redundant `activeClientChanged`
dispatches that were driving large loops of customization/file requests across
the connection.

- `setClientCustomizations` now takes the session URI and publishes
  `SessionCustomizationsChanged` once with the resolved list, followed by
  `SessionCustomizationUpdated` actions only when an individual customization's
  state actually changes.
- `agentSideEffects` no longer wires its own progress callback; it lets the
  agent publish actions and forwards action signals into the state manager even
  when no turn is active so session-level state (customizations, title, config)
  stays consistent.
- `agentHostSessionHandler` no longer claims the active-client role on session
  restore, and only re-dispatches `activeClientChanged` when the local view of
  `activeClient` actually differs from the session state. The pre-send hook
  ensures the active client is current before sending a message.
- `agentCustomizationItemProvider` reads session customizations from the
  shared session subscription instead of caching them locally and re-firing on
  every customization update.
- Adds tests covering the no-redundant-dispatch behavior and the new progress
  publishing flow.

Fixes #316538

(Commit message generated by Copilot)

* address Copilot review and fix provider tests

- copilotAgent: construct SessionCustomizationUpdated explicitly (omit clientId)

- mockAgent: always emit SessionCustomizationsChanged so clears propagate

- agentCustomizationItemProvider: restore session customizations cache and handle both Changed/Updated actions

- agentSideEffects.test: assert clear publishes one empty SessionCustomizationsChanged

* drop local session-customization cache, read from session subscription

Replaces the provider-local _sessionCustomizationsCache with a direct read from the central session subscription via getSubscriptionUnmanaged(StateComponents.Session). The session reducer already maintains 'customizations' from SessionCustomizationsChanged/Updated, so the local mirror only duplicated logic and would have missed state populated before the provider attached. Teaches MockAgentConnection to expose session subscriptions backed by fireAction so tests exercise the same code path.

* build
* agent-host: route long question text through detailedMessage

Long elicitation prompts from the agent host were being placed into the question title/description, causing the question carousel header to grow tall and squeeze out the scrollable input area. Route the long body through detailedMessage (rendered inside the scrollable container) and keep the title short by splitting on the first newline when no explicit title is provided.

Fixes #316544

(Commit message generated by Copilot)

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Make sure `npm run watch` also checks extension media builds
Air-gapped BYOK: enable chat and some other AI functionality when user is not authenticated (with or without utility models enabled).
* fix null-safety in LocalNewSession._resolveGitState

When resolveWorkspace() creates a folder with gitRepository: undefined,
the autorun in _resolveGitState crashed spreading undefined with the
non-null assertion. Build a fallback ISessionGitRepository from the
folder root so the git state update works even when the workspace was
not pre-populated with repository metadata.

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

* smoke: skip Claude session test pending CI investigation

The Claude session test consistently times out on macOS CI — the
claude-code session controller never starts. Skip it while we
investigate what blocks createNewChatSessionItem on CI builds.

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

* hoist fallback gitRepository outside autorun

Avoid recreating the fallback ISessionGitRepository and its
constObservable on every git state change by moving it before the
autorun closure.

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

* smoke: retry send button click if new-session view persists

The send button click can silently fail on CI if the button moved or
an overlay intercepted the event. After clicking, verify the new-session
homepage disappears. If it's still visible after 3 seconds, retry the
click up to 3 times.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators May 21, 2026
@pull pull Bot added the ⤵️ pull label May 21, 2026
@pull pull Bot merged commit 8f51c4a into KingDEV95:main May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.