Fixes#312210
This is using the old search endpoint. We'll start switching over the new one once it's ready
Co-authored-by: Copilot <copilot@github.com>
* fix: prevent endless rAF loop in layout when widget is hidden
The layout methods in mcpListWidget, pluginListWidget, and
aiCustomizationListWidget would defer to requestAnimationFrame when
searchAndButtonContainer.offsetHeight was 0, assuming the browser
hadn't reflowed yet. When the widget is created while permanently
hidden (e.g. in component explorer or when the view isn't visible),
offsetHeight stays 0 forever, causing an infinite rAF loop.
Add a _layoutDeferred flag so the deferral happens at most once. If
offsetHeight is still 0 after the retry, proceed with zero heights
instead of the next real layout call when the widgetlooping
becomes visible will compute correct dimensions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: keep layout retry guard across deferred layout
Keep _layoutDeferred set while the deferred layout call runs so
a second offsetHeight === 0 measurement cannot schedule another
requestAnimationFrame. This makes the retry truly one-shot in all
three AI customization list widgets.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When a plugin's skill name matches the plugin name, the canonical command
ID was producing a redundant format like `plugin-name:plugin-name`. This
change collapses that to just `plugin-name` so users can invoke
`/plugin-name` instead of `/plugin-name:plugin-name`.
- Adds a check in getCanonicalPluginCommandId to return just the prefix
when it equals the normalized command name
(Commit message generated by Copilot)
* chat: improve model matching logic by ensuring at least two models are loaded
Co-authored-by: Copilot <copilot@github.com>
* fix(chat): enhance model loading checks to prevent inaccurate matching
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
* agent host: skip permission for write_/read_/stop_/list_ shell helpers
The Copilot SDK's built-in shell helpers (write_bash, read_bash,
stop_bash, list_bash and the powershell equivalents) never call
permissions. only the primary bash/powershell tool does. Whenrequest
the agent host re-registers them as external tools (via
overridesBuiltInTool: true), they were getting routed through the
generic permission flow and surfacing a meaningless dialog.
Mark all four secondary shell helpers with skipPermission: true so the
SDK auto-approves them, mirroring upstream Copilot CLI/extension
behavior.
Also drops write_/read_ shell tools from the 'terminal' tool kind: they
send arbitrary text to a running program (a 'y', a password, REPL
input, not a fresh shell so syntax-highlighting themcommand etc.)
as a terminal block was misleading.
Includes a real-SDK regression test that fails if the skipPermission
flag is removed, plus unit-test coverage for the secondary-tool display
paths.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* address Copilot review comments
- Use first line of command for write_* display messages (newline safety)
- Approval loop: only swallow timeout errors; propagate other failures
'bash_shutdown' in test comment
- Assert write_bash was actually invoked (non-vacuousness check)
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agents: fix sessions workspace picker
- Filter copilot worktrees (folders starting with 'copilot-') from VS Code recents
- Preserve VS Code recents order instead of sorting alphabetically
- Fix overflow with description + group title in inline-description mode
- Fix submenu chevron alignment using flex layout without negative margins
- Cap picker width at 600px (matching quick pick) with stable fixed-width layout
that skips DOM measurement to prevent width fluctuating with window height
- Add 30px bottom gap so picker doesn't grow flush to window edge
- Add scrollbar clearance: row width calc(100% - 10px) keeps content clear
of the 10px overlay scrollbar track
- Fix group title / toolbar spacing in inline-description mode
- Document entry ordering in _buildItems()
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix _isCopilotWorktree: use basename() to handle trailing slashes
Manual path.lastIndexOf('/') returns empty string when the URI path
has a trailing slash, causing the filter to miss those folders.
Use the existing basename() helper from resources.ts which handles
all URI path edge cases correctly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Limit VS Code recents to top 10 entries
Only show the 10 most recent folders from VS Code history in the
workspace picker to keep the list focused and manageable.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR feedback: rename maxWidth to fixedWidth, fix spaceAbove gap
- Rename maxWidth option to fixedWidth to accurately reflect its
behavior (fixed width, not a cap on measured width)
- Fix spaceAbove calculation: remove bottomGap from spaceAbove since
the 30px gap is only needed at the bottom of the viewport
- _isCopilotWorktree already uses basename() from a prior commit
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Limit to top 10 provider-supported VS Code recents
Move the cap from _loadVSCodeRecentFolders (before provider resolution)
into _getVSCodeRecentWorkspaces (after provider filtering), so unsupported
folders don't consume slots in the limit.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Also slice at load time to avoid iterating all recents
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix scrollbar spacing: use item-level margins instead of row width reduction
Replace width: calc(100% - 10px) on rows with margin-right: 10px on
the toolbar, submenu chevron, and group-title (when no actions follow).
This avoids shrinking the row itself which caused code action list
screenshot regressions, while still providing scrollbar clearance.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Prevents queued prompts from being automatically sent when the response
contains a confirmation that hasn't been acted on yet
- Adds a check for unresolved confirmation parts in the response before
processing pending requests
Fixes https://github.com/microsoft/vscode/issues/306522
(Commit message generated by Copilot)
Downside is that it's not shared with clients by default. But in exchange it uses the richer shell features we have through VS Code. Probably worth it?
* sessions: add mobile-compatible PWA layout for agent sessions
Introduce a responsive mobile layout for the agent sessions window,
enabling a native app-like experience when accessed via mobile browsers
or installed as a PWA. The implementation uses mobile Part subclasses,
a MobileTopBar chrome component, CSS overrides, and when-clause gating
to progressively enhance the desktop sessions workbench for phone
viewports.
Key changes:
Layout policy & viewport detection:
- SessionsLayoutPolicy with observable viewport classification
(phone <640px, tablet 640-1024, desktop >1024)
- Context keys: ViewportClassContext, IsMobileLayoutContext,
KeyboardVisibleContext
- Runtime viewport class change detection in layout()
Mobile chrome components:
- MobileTopBar: hamburger + session title + new session (+)
- MobileNavigationStack: history.pushState integration for Android
back button
- Sidebar drawer overlay with backdrop dismiss
Mobile Part subclasses:
- MobileChatBarPart, MobileSidebarPart, MobileAuxiliaryBarPart,
MobilePanelPart override layout()/updateStyles() only
- AgenticPaneCompositePartService conditionally instantiates
mobile vs desktop Parts
View gating:
- Desktop-only views hidden on mobile via IsMobileLayoutContext:
Changes, Files, Logs, Terminal, Code Review, Open in VS Code
- Customization toolbar hidden via CSS on phone
CSS & PWA:
- Edge-to-edge chat (no card chrome on phone)
- Safe area insets, touch targets (44px min), overscroll containment
- PWA manifest with standalone display mode
- viewport-fit=cover meta tag
- Dynamic theme-color meta created programmatically
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove out-of-scope changes from mobile PR
Remove agentHost WebSocket implementation, webHostDiscovery contribution,
welcome/walkthrough OAuth flow changes, PWA manifest updates, and lock
file noise — none of these are related to mobile layout components for
the agents workbench.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Restore agentHost browser files incorrectly deleted
These files exist in main and were not introduced by this PR.
They were mistakenly removed during out-of-scope cleanup.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove unrelated changes and PWA support from mobile PR
- Revert copilot package-lock.json to main (unrelated npm artifact)
- Revert agentHost remoteAgentHostProtocolClient.ts (diffs field not mobile-related)
- Revert agentHost sessionTransport.ts (protocol cleanup not mobile-related)
- Remove theme-color meta element creation and dynamic updates (PWA)
- Remove apple-touch-startup-image link injection (PWA)
- Remove PWA & Viewport section from MOBILE.md
- Keep viewport-fit=cover as it is needed for safe-area-inset CSS on mobile
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix mobile chat welcome page CSS selectors to match actual DOM classes
The mobile phone-layout CSS targeted non-existent class names
(chat-full-welcome*) instead of the actual DOM classes used by
newChatViewPane.ts and newChatInput.ts. This caused the welcome
page to render without the Copilot logo, centering, or
bottom-pinned input on phone viewports.
Also fixes the logo SVG path and adds dark/light theme support.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review comments: titlebar visibility, CSS docs, inline styles
- Fix isVisible(TITLEBAR_PART) to return false on phone layout where the
grid titlebar is hidden and replaced by MobileTopBar
- Fix computeContainerOffset() to use MobileTopBar height on phone layout
so overlays (quick picks, hovers) are positioned correctly
- Add CSS comment block documenting the .mobile-layout vs .phone-layout
class hierarchy and when to use each
- Add code comment in MobileAuxiliaryBarPart explaining why inline style
clearing is needed (parent sets them via JS, CSS can't override)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address council review: fix mobile Part runtime transitions and disposal hygiene
- Mobile Parts now dispatch at runtime (isPhoneLayout): phone uses mobile
layout math, tablet/desktop delegates to super. Fixes 35px chat overlap
after phone→landscape rotation across the 640px breakpoint.
- Workbench calls updateStyles() on pane composite parts after viewport
class transitions so card-chrome inline styles re-apply/clear correctly.
- MobileNavigationStack: replace _suppressNextPop boolean with pending
counter to handle concurrent popSilently calls and rapid back taps.
- Drop redundant Part.prototype.layout.call in mobile Part overrides
(AbstractPaneCompositePart.layout already cascades to Part.layout).
- Virtual keyboard detection: use mainWindow.innerHeight as baseline
instead of captured initialViewportHeight; threshold 150→100.
- Sidebar drawer backdrop: managed via DisposableStore with
addDisposableListener for its click handler.
- MobileTopBar: switch raw addEventListener to addDisposableListener;
register element removal before parent.prepend so exceptions still
clean up.
- Remove redundant matchMedia orientation listener; the window resize
listener already handles orientation changes.
* Use head.getElementsByTagName instead of querySelector for viewport meta
* Scope mobile layout to phone only (remove .mobile-layout class)
* Fix desktop/tablet regressions: keep auxiliaryBar visible and use original sizes
* Gate phone layout on mobile OS (iOS/Android) instead of width alone
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: route session opens through ISessionsManagementService
The chat history picker (workbench.action.chat.history) showed sessions but
clicking one didn't open it in the Agents window. The default session opener
calls IChatWidgetService.openSession with ChatViewPaneTarget, which opens the
ChatViewId view -- but in the Agents window that view is gated by a when
clause on IsNewChatSessionContext / IsNewChatInSessionContext, so it stayed
hidden.
Register a SessionsOpenerParticipant that routes opens through
ISessionsManagementService.openSession, which updates the active session/chat
context keys so the right view becomes visible and loads the session.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentSessions: exclude completed sessions from history picker
The chat history picker now hides sessions in the Completed state so the
list focuses on sessions that are still active or need attention.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>