Move the model-registration deferral from the provideChatSessionContent
reconnect call site into _setupClientToolCall, where beginToolCall and
invokeTool actually require the ChatModel. The coarse deferral wrongly
delayed the progress/completion streaming wiring in _observeTurn (which
does not need a model), breaking two AgentHostChatContribution tests and
the rename/fork paths that resolve content without ever creating a model.
Gating at the client-tool layer also covers server-initiated live turns,
not just reconnect snapshots.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When reconnecting to an active agent-host turn that is blocked on a client
tool, `provideChatSessionContent` invoked `_reconnectToActiveTurn`
synchronously before the chat model was registered in `IChatService`.
Reconnect re-invokes the blocked client tool, and
`LanguageModelToolsService.invokeTool` throws "Tool called for unknown chat
session" when the model is missing, leaving the turn blocked forever with the
session stuck in `InputNeeded` and no confirmation/question rendered.
- Defer `_reconnectToActiveTurn` until the chat model exists, mirroring the
adjacent snapshot-controller `getSession` / `onDidCreateModel` guard.
- As defense in depth, dispatch a failed `ChatToolCallComplete` when a client
tool fails pre-execution (non-cancellation), so a rejected tool call can no
longer strand the turn.
Adds two repro tests in agentHostClientTools.test.ts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The draft chat tab close button used a trash icon while committed chats
used a close icon. Always use the close icon for the chat tab close
button while keeping the destructive "Delete Chat" label and
delete-without-confirmation behavior for untitled drafts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: restore last-used agent and model for new chat editors
- New chat editors always opened with the Local agent and the Auto model,
even right after the user had been working with an agent host (e.g.
Copilot Agent Host). The last-used agent/model was never consulted, so
users had to re-pick the agent, model, and model configuration for every
new editor, and it reset in every new workspace.
- Persists the last-used non-local chat agent (session type) at profile
scope and prefers it when resolving the session type for a new chat
editor, so the editor reopens with the agent the user last worked with
across windows and workspaces. An explicit chat.editor.defaultProvider
still wins.
- Restores that agent's last-used model and its configuration (e.g. context
size, thinking effort) for the fresh editor session, mirroring the
existing reopened-session restore.
Fixes https://github.com/microsoft/vscode/issues/322792
(Commit message generated by Copilot)
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>
* 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>
* 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>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fix: guard WorkspaceTrustEditor.render against disposed instantiation service
The @debounce(100) render() can fire after the editor pane and its scoped
InstantiationService have been disposed, throwing "InstantiationService has
been disposed" from createInstance. Bail out early when the pane's own
DisposableStore is already disposed.
Fixes#322973
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: Dmitriy Vasyura <dmitriv@microsoft.com>
* sessions: surface un-accepted PR review comments to the agent
Un-accepted PR review comments lived only client-side in CodeReviewService and were never written to the agent-host annotations channel, so the listComments note ("there are N pull request comments...") and the viewUnreviewedComments tool never saw them.
Add AgentFeedbackPRReviewSeederContribution which mirrors the active agent-host session's un-accepted PR review comments onto the feedback annotations channel as created prReview items, keyed by the session resource so they stay on one channel across multiple chats. Mirrors carry sourcePRReviewCommentId for editor de-duplication and GitHub thread resolution. The seeder refreshes mirror text on upstream edits, collapses duplicate mirrors, and removes created mirrors whose source comment is gone.
Deleting a comment from the viewUnreviewedComments confirmation now dismisses the source PR comment (new ICodeReviewService.dismissPRReviewComment) so the seeder does not recreate it. getSessionEditorComments de-duplicates the mirror against the raw PR comment in the editor.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: address PR review feedback on agent feedback tests
- Restore the resolvePRReviewThread coverage in codeReviewService.test.ts alongside the new dismissPRReviewComment test.
- Use the store returned by ensureNoDisposablesAreLeakedInTestSuite() (registered before setup) so the leak tracker is installed when setup runs.
- Match the updated IAgentFeedbackService / ICodeReviewService mock override signatures.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: implement hasLoadedFeedback in component fixture instance
The fixtureUtils IAgentFeedbackService fixture is a full (non-mock) instance, so it must implement the new hasLoadedFeedback API added in this branch. Fixes the Compile & Hygiene CI failure (TS2741).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Updated `MockCopilotSession` to include aliases and input hints for commands.
- Modified command invocation logic to support trailing text as input for commands like `/env` and `/review`.
- Improved slash command parsing to retain raw input for better handling of multiline commands.
- Enhanced completion provider to include runtime command descriptions and hints in completion items.
- Added tests for new command behaviors and completion scenarios, ensuring robust handling of runtime commands.
- Updated `AgentHostInputCompletionHandler` to provide detailed command descriptions in completion suggestions.
Refactored galleryItemRenderer into a component shared between MCP, Plugins and Tools views.
Added Extension tools details pane to view tools provided by an extension from the Tools view.
Fixed an issue in MCP view where installed items were rendered incorrectly
* Voice mode: add send keyword setting for hands-free submit
When agents.voice.autoSendDelay is -1 (manual send), users can now
configure a keyword phrase (e.g. "send it") via agents.voice.sendKeyword.
When detected at the end of the transcript, the keyword is stripped and
the request is submitted automatically — enabling fully hands-free
workflow without auto-send on silence.
Fixesmicrosoft/vscode-internalbacklog#8187
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: persist transcript, clear toggle mode, trim keyword
- Persist final transcript and clear _pttToggleMode before _finishPtt()
to avoid stuck toggle state and missing transcript history
- Trim configured keyword before comparison to handle whitespace
- Use full setting key in description for clarity
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix send keyword: strip trailing punctuation before matching
Speech recognizers often append punctuation (e.g. 'hello send.' instead
of 'hello send'), causing the keyword match to fail. Strip trailing
punctuation before comparing.
Also allow keyword trigger regardless of autoSendDelay value — useful
as an immediate send even when silence-based auto-send is active.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update sendKeyword description: works regardless of autoSendDelay
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Respect chat.tools.terminal.autoApprove for agent host
* Make things cleaner
* address copilot feedback to cache to avoid rebuilding regex
* Add terminal auto-approve fallback removal TODO and source-of-truth tests
* align order with workbench
* agent host: generate PR title and description from session conversation
The local agent host Create PR / Create Draft PR operation previously
derived the title and body from the branch name only. It now asks the
utility model for a title and description, feeding it the main session
conversation (markdown text of requests/responses only — tool calls,
subagents, and reasoning are excluded and the text is char-bounded) plus
a changed-file summary. Falls back to the branch-name title/body when no
Copilot token is available or generation fails, so PR creation never
fails because the model is unavailable.
The conversation-to-text logic is extracted from the session title
controller into a shared, configurable helper
(agentHostConversationContext) that truncates only the conversation and
preserves any framing in full.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agent host: fix PR title generation typecheck and diff summary perf
Use ISessionWithDefaultChat (which exposes `turns`) for the PR handler's
session state so the conversation context can be built, fixing the
tsgo typecheck failure. Also track the running length in
_summarizeDiffsForPrompt instead of re-joining the lines each iteration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agent host: use const for parsed PR title (eslint prefer-const)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* style: update activity bar colors to use icon foreground variables
Co-authored-by: Copilot <copilot@github.com>
* style: enhance hover effect for compact combo controls in status bar
---------
Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
* Gate Claude3PIntegration behind editor preview policy
Flip ownership of the `Claude3PIntegration` enterprise policy so it can
honor the account-side editor preview-features flag.
Previously the policy was owned by the copilot-chat extension setting
`github.copilot.chat.claudeAgent.enabled` via the distro `product.json`
`extensionConfigurationPolicy` block. Because `product.json` is pure JSON
it cannot carry a `value(policyData)` callback, so the policy only
responded to OS/MDM admin policy and never honored
`chat_preview_features_enabled` (sourced from the Copilot token's
`editor_preview_features`). Codex works because its core setting owns
`Codex3PIntegration` in code with a value callback.
Now the in-code core setting `chat.agentHost.claudeAgent.enabled` owns
`Claude3PIntegration` with the preview-features value callback, and the
extension setting attaches via a `policyReference` declared from
`product.json`. To express that, an `extensionConfigurationPolicy` entry
can now be either form:
- the current owner/"parent" syntax (full `IPolicy`: name, category,
minimumVersion, description), or
- a reference: `{ "policyReference": { "name": "<owner>" } }`, mirroring
the in-code `policyReference` configuration field.
`configurationExtensionPoint` and the policy exporter detect the
`policyReference` key to route entries to `.policy` vs `.policyReference`;
the exporter links reference entries into the owner's `referencedSettings`
and skips type validation for settings not registered in the headless
export process.
Regenerates `policyData.jsonc` and updates the export test fixture.
Requires the companion change in microsoft/vscode-distro that turns the
claude entry into a `policyReference`.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump distro to pick up Claude3PIntegration policy reference
Update the distro pin to 7abf39b86c07d094722a4b3ec9f37e78fe3d5db3, which
includes the merged change turning the `github.copilot.chat.claudeAgent.enabled`
`extensionConfigurationPolicy` entry into a `policyReference` to the in-code
`Claude3PIntegration` owner (microsoft/vscode-distro#1434).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Ubuntu <josh@ahp.4mywozgnka0etnlo23z031udwc.xx.internal.cloudapp.net>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: rework New Chat UX in session header, tabs and Conversations menu
Show the New Chat action in the session header until the session has more
than one committed (non-draft) chat. Surface the chat tab strip (with its
own trailing New Chat action) as soon as there is more than one open chat,
including in-composer drafts. Show the Conversations dropdown only once
there is more than one committed chat, and keep the New Chat entry at the
top of that dropdown.
Exclude untitled draft chats from the per-chat toggle list, and delete
untitled drafts without a confirmation prompt when their tab is closed via
a new IDeleteChatOptions.skipConfirmation threaded through the delete-chat
API and all providers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address CCR feedback and fix component screenshot fixtures
- deleteChat now returns whether a delete actually occurred so the
management service only fires onDidDeleteChat on real deletions
- tab-strip New Chat action is disabled for archived sessions
- draft tab close button uses a destructive Delete label/trash icon
- add focus-visible outline for the tab-strip New Chat action
- update sessions chat accessibility help text
- register ISessionsPartService stub and isArchived in the
chatCompositeBar component fixture so all variants render
- add unit tests for skipConfirmation delete behaviour
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agent Host changes for agents/new-session-action-group-toolbar-f3219f4a
* Clarify onDidDiscardNewSession docs and add discard event tests
Reword the onDidDiscardNewSession JSDoc to note that sendRequest into an existing session also discards the pending draft, while sendNewChatRequest clears it without firing the event. Add unit tests asserting the event fires on discardNewSession and does not fire on sendNewChatRequest.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: manage side pane and responsive sidebar in the layout controller
Move the Toggle Side Panel action into the session layout controller so the
side-pane visibility memory lives with the controller, and introduce
ISessionChangesService to own the changes-multi-diff-source URI identity
alongside the upstream IChangesViewService.
Fix the responsive sidebar reveal bug after reload: the controller now only
auto-reveals a sidebar it auto-hid (tracked via _sidebarAutoHidden) instead of
relying on an in-memory _userClosedSidebar flag that reset on reload. A sidebar
the user had closed before reloading is therefore no longer auto-revealed when
the side pane is later closed. Adds a regression test plus harness options for
initial container width and part visibility.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: void floating openView promises in desktop layout controller
Address CCR feedback: prefix the fire-and-forget openView calls with void to
match the existing pattern in the file.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skip the first MenuItemAction (not array index 0) when mirroring create
submenu actions, so the primary create command isn't duplicated into the
Chat New menu when the submenu starts with a separator/submenu. Tighten the
explanatory comment, and log a warning when no create command resolves
instead of silently no-opping.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The session type picker creates a new session for a non-delegating,
extension-contributed chat session (e.g. Codex from the openai.chatgpt
extension) by invoking `openNewChatSessionExternal.<type>`. That command
was only registered when `_registerMenuItems` happened to see an entry in
the create submenu at the moment the contribution was enabled, which races
extension menu/command registration. When the submenu is still empty at
enable time (as it is for Codex), the command is never registered and never
retried, so clicking the entry rejects with "command not found" and the
picker silently does nothing.
Register `openNewChatSessionExternal.<type>` unconditionally for
non-delegating contributions and resolve the underlying create-submenu
command lazily at execution time, so it is unaffected by extension
registration ordering. The action no-ops gracefully when no create command
is contributed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* smoke: fail fast with actionable error when Electron crashes during launch
The per-suite `before all` hook launches Electron via Playwright's
`_electron.launch`. This was called with `timeout: 0`, so when the
Electron process crashed during startup (e.g. a native SIGSEGV in the
Chromium browser-process/sandbox init path, which leaves a minidump),
the launch promise never resolved or rejected. It simply hung until
Mocha's 120s `before all` hook timeout fired, producing an opaque
"Timeout of 120000ms exceeded" with no hint that a native crash had
occurred.
Give the launch (and the first-window wait) a finite timeout well below
the Mocha hook timeout and wrap them so a failure is re-thrown as an
actionable error pointing at the crash-dump directory and Playwright
trace. This turns a 120s opaque hang into a faster, clearly-diagnosable
failure.
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 changes for agents/fix-input-banner-button-color-3e80d66b
* Fix CI input banner button color and check count text
Make the primary 'Fix Checks' button match the orange banner accent and update the banner text to 'X out of N checks failed, P pending' where N is the number of completed checks.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Only show session input banners when the session has completed
Gate the CI and comments input banners on the active session's status so they don't appear while the agent is still in progress.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Linux smoke-test job works around the expat 2.6.1 fontconfig NULL-deref
CVEs by pointing FONTCONFIG_FILE at a minimal config with <include> removed.
However that config still declared an external DTD:
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
fontconfig feeds that DTD to expat as an external *parameter* entity, which
still hits the not-yet-backported CVE-2026-32776 / CVE-2026-32778 crash paths
on expat 2.6.1 even with <include> gone. This was observed in CI as a SIGSEGV
inside libexpat (called from libfontconfig) during Chromium browser-process
font initialization, which crashed Electron at startup. Because the smoke-test
launch used no timeout, that crash surfaced only as an opaque 120s Mocha
"before all" hook timeout.
fontconfig does not require the DOCTYPE, so drop it to remove the last
external-entity codepath. The full workaround can be removed once the runner
ships libexpat >= 2.7.5 (the step already auto-disables itself in that case).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: drag & drop to reorder workspaces and groups in the sessions list
Let users drag workspace section headers and user-group headers to reorder
them, with an insertion line shown above/below the target. Pinned stays
locked to the top and Done to the bottom; neither (nor the date sections) is
draggable or a drop target.
Groups are now fully user-managed: their order no longer derives from member
recency and is shared across both grouping modes. In By Workspace mode groups
and workspaces share one freely-intermixable order (groups default above
workspaces, workspaces alphabetical); dragging a workspace promotes it so it
escapes the "+N more workspaces" capping. In By Date mode groups form a
contiguous block right below Pinned and never mix into the date sections.
Introduces ISessionSectionOrderService (explicit ordered-id list + workspace
promotion, persisted locally with stale-id GC) and removes the obsolete group
sortKeyOverride member-recency mechanism.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: fix template-literal Map key type in getGroupsInDisplayOrder
The s const tuple made the Map key type group:, so get(id)
with a plain string id failed to type-check (CI Compile & Hygiene). Type the
Map key explicitly as string.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: default to Changes after session creation
Keep new sessions on Files until their first request marks the session as created. Once created, use Changes as the default aux view while preserving per-session user choices like switching back to Files.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: persist fallback aux view on reveal
When a hidden created session falls back to Changes because its saved aux container is unavailable, persist Changes as the resolved active container so future restores do not keep pointing at the invalid container.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* style: enhance horizontal activity bar appearance with rounded backgrounds and consistent icon tinting
* style: enhance activity bar appearance with rounded backgrounds and improved icon alignment
Co-authored-by: Copilot <copilot@github.com>
* Refactor activity bar styles for improved layout and consistency
* Fix CSS syntax by adding missing semicolon in activity bar styles
* Adjust activity bar and tab heights to 24px for improved consistency
Co-authored-by: Copilot <copilot@github.com>
* Fix CSS left property values in activity bar styles for consistency
* Adjust activity bar positioning and ensure consistent height for text-label composites
Co-authored-by: Copilot <copilot@github.com>
* Add styles for 24px overflow control in activity bar for consistency
Co-authored-by: Copilot <copilot@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: mrleemurray <mrleemurray@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The Agents window contributes editor-area layout actions (Maximize/Restore/
Close Editor Area, Open in Modal Editor, and the secondary side bar toggle)
to the `EditorTitleLayout` menu. `SingleEditorTabsControl` previously
returned empty layout actions, so these controls disappeared when
`workbench.editor.showTabs` was set to `single`.
Return the resolved layout actions instead. This menu is only populated by
the Agents window, so there is no visible change in the regular VS Code
editor where the menu is empty.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>