Skip to content

[pull] main from microsoft:main#1399

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

[pull] main from microsoft:main#1399
pull[bot] merged 48 commits into
KingDEV95:mainfrom
microsoft:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 8, 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 : )

cwebster-99 and others added 30 commits May 7, 2026 09:33
Co-authored-by: Copilot <copilot@github.com>
Add a new 'local' session type that runs in-process VS Code chat
sessions directly in the Agents window, without requiring a background
agent or worktree.

- Add `LocalSessionType`, `LocalNewSession`, and the
  `sessions.chat.localAgent.enabled` experimental setting
- Wire local sessions into menus, context keys, and model selection
  (use general-purpose models without a `targetChatSessionType`)
- Introduce `IChatSessionItemMetadata` interface to replace the untyped
  `{ [key: string]: unknown }` metadata shape
- Add `workingDirectory` to `IChatModel` and propagate it through
  `IChatDetail` and `LocalChatSessionItem`
- Split `chatSessionStore` metadata into sync/async paths; add
  `updateAndFlushIndexSync` so the session index is persisted before
  the storage service flushes in `onWillSaveState`
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The _sendFirstChatLocal method calls chatService.sendRequest directly,
bypassing chatWidget.acceptInput() which normally provides
userSelectedTools and instructionContext. Without userSelectedTools,
the copilot extension receives an empty tools map, so only a handful
of tools are available in agents window local sessions.

Fix by destructuring userSelectedTools from the widget's mode request
options and passing it along with the instructionContext.
Serialize workingDirectory in ISerializableChatData3 and restore it
in the ChatModel constructor so it survives window reload. Also cache
it in the session index metadata (IChatSessionEntryMetadata) for
lightweight access in the sessions list without loading the full model.

This fixes the changes view in the agents window being empty after
reload for local sessions, since the view needs workingDirectoryPath
in the session metadata to resolve the git repository for diffs.
- Remove IsSessionsWindowContext precondition and menu guards from New Window, Open Folder, Open..., Open Workspace from File, Open Recent, and New Window with Profile commands
- In windowsMainService, prevent the Agents window from being reused when opening folders/workspaces by checking isSessionsWindow in doOpenFolderOrWorkspace, doOpenEmpty, and openInBrowserWindow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When reporting an issue from the agents window, include
'Window: Agents' in the generated issue body so triagers
can identify the source window.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove gradient background for compatibility
…ions

In the agents window, each chat session has its own working directory
that may differ from the current workspace folders (which change when
switching between sessions). This caused tools to search the wrong
folder, show spurious 'Allow reading external files?' prompts, and
render incorrect workspace_info in the system prompt.

Core plumbing:
- Add workingDirectory to IToolInvocationContext, IToolInvocationPreparationContext,
  ILanguageModelToolConfirmationRef, and IChatAgentRequest
- Enrich tool invocation context from model.workingDirectory in invokeTool()
- Include workingDirectory in toolInvocationToken built in extHostTypeConverters
- Pass workingDirectory through LanguageModelToolInvocationOptions and
  LanguageModelToolInvocationPrepareOptions (proposed API)
- Revive workingDirectory URI in extHostLanguageModelTools

Tool fixes (when workingDirectory is set, use it exclusively):
- chatExternalPathConfirmation: auto-approve paths within workingDirectory
- isFileExternalAndNeedsConfirmation / isDirExternalAndNeedsConfirmation /
  assertFileOkForTool: treat workingDirectory as workspace-internal
- createEditConfirmation: use workingDirectory for edit trust checks
- All edit tools (create_file, replace_string, multi_replace, apply_patch,
  insert_edit, edit_notebook, create_directory): pass workingDirectory
- resolveToolUri: resolve relative paths against workingDirectory
- inputGlobToPattern: scope unscoped globs to workingDirectory
- file_search / grep_search: scope searches to workingDirectory
- semantic_search: prefer workingDirectory for cwd
- run_in_terminal: prefer workingDirectory for terminal cwd
- fetchPageTool: check workingDirectory for file URI trust
- readFileTool / listDirTool / viewImageTool: pass workingDirectory

Prompt fixes:
- WorkspaceFoldersHint: show workingDirectory instead of workspace folders
- AgentMultirootWorkspaceStructure: generate file tree from workingDirectory
…5263)

When a session transitions from InProgress to a terminal status
(Completed, NeedsInput, Error) while it is not the active session,
mark it as unread in the SessionsListModelService so the sessions
list sidebar shows the unread indicator.

Previously, SessionsListModelService only tracked read state via
a simple set — sessions were marked read when opened but never
marked unread when a background turn completed. This caused existing
sessions to appear as read even after new turns finished, while new
sessions (never in the read set) correctly showed as unread.

Fixes #311985

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bind Ctrl+R (Ctrl+R on macOS) to the Show Sessions Picker command,
scoped to the sessions window via IsSessionsWindowContext. This
overrides the Open Recent workspace picker keybinding in the agents
window so Ctrl+R opens the sessions picker instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agents - switch pull request actions away from the agentic loop

* Fix compilation
…indow` (#315265)

* extensions: rename supportSessionsWindow setting to supportAgentsWindow

Renames the \�xtensions.supportSessionsWindow\ setting and its associated
constant \EXTENSIONS_SUPPORT_SESSIONS_WINDOW\ to \�xtensions.supportAgentsWindow\
and \EXTENSIONS_SUPPORT_AGENTS_WINDOW\ respectively, to align with the
renaming of the Sessions window to the Agents window.

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

* extensions: add vscodevim.vim to sessions window allowed extensions

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

---------

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

Local session type for agents window
…15286)

Reverts the agents widget icon from codicon-agent back to the
sessions-icon.svg background image with grayscale filter, matching
the pattern used by the Open in VS Code widget.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add right click visibility toggle for sign in button
Tyriar and others added 18 commits May 8, 2026 16:32
Adopts the agent-host protocol's MessageAttachment surface so user-attached images, file
references, selections, paste, prompt text, and prompt files round-trip through the agent
host and into the underlying agent SDK.

- Expand `_convertVariableToAttachment` in the chat-side handler to cover image, symbol,
  paste, promptText, promptFile, and selection variants in addition to file/directory.
- On the agent host, snapshot inline `EmbeddedResource` payloads and remote `Resource`
  attachments to disk under `<sessionDataDir>/attachments/<uuid>/<basename>` and rewrite
  the action to reference them via local `file:` URIs, keeping large blobs out of the
  in-memory state tree.
- Read remote attachment bytes through `toAgentClientUri` so the existing
  `vscode-agent-client` filesystem provider routes the request to the originating client.
- Auto-approve `read` permission requests for any path under the session's `attachments`
  directory in the Copilot agent's `handlePermissionRequest`.
- Translate protocol attachments back to chat-layer `IChatRequestVariableEntry`s when
  building history (`turnsToHistory`), the active turn synthesis, the server-initiated
  turn (`startServerRequest`), and the pending/queued message sync, so attachments
  survive history replay and pending message round-trips.
- Restore SDK-side attachments in `mapSessionEvents`'s `user.message` handling so
  resumed sessions retain their attachments.
- Forward attachments from the workbench to the SDK in `_toSdkAttachment`, mapping
  Resource selections to `selection`, directories to `directory`, files to `file`, and
  `EmbeddedResource` blobs to `blob`.

Fixes #315137

(Commit message generated by Copilot)
Addresses review feedback and CI failures on the agent-host attachment
support change.

- Restore the `Resource` branch in `_isRewritableAttachment` (and thus in
  `_needsAsyncRewrite`) so non-directory `Resource` attachments not
  already under the session attachments folder are snapshotted, matching
  the PR's stated intent and the new tests.
- Restore the `isSelection` gate when converting `implicit` variable
  entries: a bare visible-document implicit attachment should not become
  a `selection` attachment.
- Avoid emitting `attachments: undefined` and `variableData: undefined`
  fields on the synced pending message actions and synthesised history
  entries, so the existing deep-equal test assertions keep passing.

(Commit message generated by Copilot)
The single-entry sidebar 'Customizations' button had `width: 100%` set on
both the link-button container and the inner button. Combined with the
inherited `margin: 0 10px` from the per-section rule, this overflowed the
panel by 20px and was visible as a misaligned focus outline that extended
past the panel edge.

Drop the explicit widths and let the parent's default `align-items: stretch`
plus the inherited margins size the entry, matching the per-section items.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reverts the manual omission of undefined `attachments` / `variableData`
fields in the pending message sync and history synthesis paths. Updates
the corresponding deep-equal test assertions to expect the new shape
instead.

(Commit message generated by Copilot)
…#315319)

The 'Bridged' badge that appeared next to MCP server names in the chat
customizations editor has been removed. This badge was shown when the
active harness was not Local, indicating the server was forwarded to
agent sessions. It is no longer needed.

- Remove the bridgedBadge DOM element, hover tooltip, and autorun from McpServerItemRenderer
- Remove bridgedBadge from IMcpServerItemTemplateData
- Remove ICustomizationHarnessService injection from McpServerItemRenderer
- Simplify the accessibility aria label (no longer appends 'Bridged')
- Remove unused ICustomizationHarnessService injection from McpListWidget
- Remove unused derived and SessionType imports from mcpListWidget.ts
- Update CSS comment referencing the Bridged badge
- Update AI_CUSTOMIZATIONS.md to remove reference to the Bridged badge

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

Fixes #315270

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
On reload, the agents window now restores the last active session instead
of showing the new-session view.

- Add `restoreLastActiveSession()` to `ISessionsManagementService` and
  call it from `Workbench.restore()` during startup.
- Switch away from the new-session view synchronously (before any await)
  to prevent `NewChatViewPane` from rendering and accidentally cancelling
  the restore token via `createNewSession`.
- Wait for the session provider to register if the session isn't
  available immediately, then delegate to `_doOpenSession`.
- Show a progress indicator on `ChatViewId` during restore (200ms delay
  to avoid flicker on fast restores); cancel it immediately if the user
  navigates to the new-session view.
- `_startOpenSession` cancels any in-flight open/restore and returns a
  fresh token; all navigation paths (openSession, openChat,
  createNewSession, openNewSessionView, openNewChatInSession) now call it
  so concurrent operations are safely cancelled.
- Fire `_onDidOpenNewSessionView` in `openNewSessionView` so the restore
  progress promise can race against it and dismiss early.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Items that come from the 'vscode-synced-customization' scheme are backed
by a synthetic plugin that is purely an implementation detail of the sync
mechanism. Showing 'Show Plugin' and 'Uninstall Plugin' context menu
actions for those items is confusing because the plugin concept is not
user-facing in that context.

Tighten WHEN_ITEM_IS_PLUGIN to also require that the plugin URI does NOT
start with the 'vscode-synced-customization:' scheme, so all three
plugin-related menu items (inline trash icon, 'Uninstall Plugin', and
'Show Plugin') are suppressed for synced customization entries.

Fixes: #314879

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add proposal for custom editor diff/merge priority
* agentHost: support image and blob user-message attachments

Adopts the agent-host protocol's MessageAttachment surface so user-attached images, file
references, selections, paste, prompt text, and prompt files round-trip through the agent
host and into the underlying agent SDK.

- Expand `_convertVariableToAttachment` in the chat-side handler to cover image, symbol,
  paste, promptText, promptFile, and selection variants in addition to file/directory.
- On the agent host, snapshot inline `EmbeddedResource` payloads and remote `Resource`
  attachments to disk under `<sessionDataDir>/attachments/<uuid>/<basename>` and rewrite
  the action to reference them via local `file:` URIs, keeping large blobs out of the
  in-memory state tree.
- Read remote attachment bytes through `toAgentClientUri` so the existing
  `vscode-agent-client` filesystem provider routes the request to the originating client.
- Auto-approve `read` permission requests for any path under the session's `attachments`
  directory in the Copilot agent's `handlePermissionRequest`.
- Translate protocol attachments back to chat-layer `IChatRequestVariableEntry`s when
  building history (`turnsToHistory`), the active turn synthesis, the server-initiated
  turn (`startServerRequest`), and the pending/queued message sync, so attachments
  survive history replay and pending message round-trips.
- Restore SDK-side attachments in `mapSessionEvents`'s `user.message` handling so
  resumed sessions retain their attachments.
- Forward attachments from the workbench to the SDK in `_toSdkAttachment`, mapping
  Resource selections to `selection`, directories to `directory`, files to `file`, and
  `EmbeddedResource` blobs to `blob`.

Fixes #315137

(Commit message generated by Copilot)

* agentHost: rewrite Resource attachments and omit undefined fields

Addresses review feedback and CI failures on the agent-host attachment
support change.

- Restore the `Resource` branch in `_isRewritableAttachment` (and thus in
  `_needsAsyncRewrite`) so non-directory `Resource` attachments not
  already under the session attachments folder are snapshotted, matching
  the PR's stated intent and the new tests.
- Restore the `isSelection` gate when converting `implicit` variable
  entries: a bare visible-document implicit attachment should not become
  a `selection` attachment.
- Avoid emitting `attachments: undefined` and `variableData: undefined`
  fields on the synced pending message actions and synthesised history
  entries, so the existing deep-equal test assertions keep passing.

(Commit message generated by Copilot)

* agentHost: revert undefined-field omission, update tests instead

Reverts the manual omission of undefined `attachments` / `variableData`
fields in the pending message sync and history synthesis paths. Updates
the corresponding deep-equal test assertions to expect the new shape
instead.

(Commit message generated by Copilot)
@pull pull Bot locked and limited conversation to collaborators May 8, 2026
@pull pull Bot added the ⤵️ pull label May 8, 2026
@pull pull Bot merged commit e1106b6 into KingDEV95:main May 8, 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.