* Refactor NewChatWidget to use ProjectPicker for unified project selection
* Enhance project picker to migrate legacy storage for recently picked projects and last selected project
* Fix separator visibility for extension pickers in NewChatWidget toolbar
* Remove unused separator for extension pickers in NewChatWidget
* Enhance IsolationModePicker to support cloud mode and update visibility logic in NewChatWidget
* Refactor IsolationModePicker to TargetPicker and update related logic for session target selection
* Add padding to chat-full-welcome pickers container for improved layout
* Update hover styles for project picker action label to improve visibility
* Refactor project listing in ProjectPicker to deduplicate and sort projects by type
* Add extension toolbar pickers for remote sessions in NewChatWidget
* Add checked property to project items in ProjectPicker for selection indication
* Set repo URI from project picker on session initialization
* Update visibility of branch and sync indicators based on repository selection in NewChatWidget
* Update target mode labels in TargetPicker for clarity
* Improve styling of project picker button for better visibility
* fix: correct isolation option logic in TargetPicker initialization
* fix: update isolation option logic to treat false as disabled
* fix: add cancellation support for project selection in NewChatWidget
* fix: add fireEvent parameter to setSelectedFolder and setSelectedRepo methods in ProjectPicker
* Address PR feedback: fix trust revert, use GITHUB_REMOTE_FILE_SCHEME, fix setRepository behavior
- Fix trust denial to revert to previous project selection (folder or repo)
instead of assuming previous URI is always a local folder
- Replace hardcoded 'github-remote-file' with GITHUB_REMOTE_FILE_SCHEME constant
- Keep worktree mode when repository is undefined (disable instead of switching)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR feedback on projectPicker.ts
- Rename storage keys to sessions.* namespace
- Remove repoId from IProjectSelection (URI encodes identity)
- Store URIs as UriComponents instead of strings
- Consolidate setSelectedFolder/setSelectedRepo into single setSelectedProject API
- Generalize removeFromRecents to work with any project URI
- Extract command string constants (COMMAND_BROWSE_FOLDERS/REPOS)
- Add legacy key migration for renamed storage keys
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR feedback: remove label from IProjectSelection, use IUriIdentityService
- Remove label from IProjectSelection; compute it internally via _getProjectLabel()
- Use IUriIdentityService for URI equality checks instead of string comparison
- Remove unused isEqual import
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Unify IsolationMode and TargetMode, replace setRepository with setProject
- Remove IsolationMode type; use TargetMode everywhere
- Replace isolationMode getter with isWorktree/isFolder/isCloud booleans
- Replace setRepository + setCloudMode with single setProject(ITargetPickerProject)
- Rename setPreferredIsolationMode → setPreferredMode, setIsolationMode → setMode
- Rename isolationMode field in draft state to targetMode
- Update newSession.ts to use TargetMode
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Extract ISessionProject to shared types file
- Create src/vs/sessions/contrib/sessions/common/types.ts with ISessionProject
- ISessionProject has kind, optional uri, optional repository — a global concept
- IProjectSelection (exported from projectPicker.ts) narrows it with required uri
- TargetPicker.setProject accepts ISessionProject (uri optional for state updates)
- Remove ITargetPickerProject — replaced by ISessionProject
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Refactor ISessionProject to SessionProject class
- Convert ISessionProject interface to SessionProject class with constructor(uri, repository?)
- Derive isFolder/isRepo from URI scheme instead of explicit kind field
- Add withRepository() for creating copies with updated repository
- Remove kind from IStoredProject and IDraftState (derived from URI)
- Update all consumers to use new SessionProject(uri) constructor
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Export GITHUB_REMOTE_FILE_SCHEME from sessionProject.ts, rename types.ts
- Rename types.ts → sessionProject.ts
- Export GITHUB_REMOTE_FILE_SCHEME from the common layer
- Update all imports across sessions codebase to use the new canonical location
- githubFileSystemProvider.ts now re-exports from sessionProject.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove important from project picker CSS
* Fix RemoteNewSession.targetMode to return 'cloud' instead of 'worktree'
* Remove label from IStoredProject, compute from URI on demand
* Remove setPreferredMode/setMode, use preferredMode parameter on setProject
* Remove GITHUB_REMOTE_FILE_SCHEME re-export from githubFileSystemProvider
* Remove unused setVisible from TargetPicker
* Add SessionProject to INewSession interface
- Add project property and setProject method to INewSession
- Implement in LocalNewSession and RemoteNewSession
- setRepoUri now delegates to setProject internally
- Update NewChatWidget to use setProject instead of setRepoUri
* Remove repoUri and setRepoUri from INewSession, use project instead
* Remove redundant target from draft state, derive from target picker
- Remove target (AgentSessionProviders) from IDraftState — redundant with targetMode
- Replace _currentTarget field with getter derived from _targetPicker.isCloud
- Simplify _onProjectSelected to use target picker state directly
* Unify session creation through _onProjectSelected
- _createNewSession is now a simple session factory (no trust handling)
- Initial session creation routes through _onProjectSelected when a
project was restored, ensuring trust is handled consistently
- _onProjectSelected always creates a new session and sets the project
- Removes duplicate trust handling from _createNewSession
* Remove redundant repoUri change listener from _setNewSession
* Only store targetMode in draft state for local sessions
* Use session.project as source of truth instead of projectPicker.selectedProject
- Read project from _newSession.value?.project throughout the widget
- Update session project when repository is resolved in _openRepository
- _updateTargetPickerState prefers session project over picker selection
- Reduces coupling to the picker's internal state
* Pass SessionProject as parameter to _createNewSession
* Rename ModePicker.setRepository to reset()
* Remove redundant targetMode session listener
The branch picker visibility is already handled by TargetPicker.onDidChange.
Keep the disabled listener — needed for async extension-driven state changes.
* Only open repository for folder projects, not repos
* Clean up _openRepository: read session at resolve time, remove defensive fallbacks
* Fix URI.revive error for legacy string URIs in stored projects
Add _reviveUri helper that handles both UriComponents (new) and
plain string (legacy) formats from storage.
* Migrate string URIs to UriComponents on load, remove _reviveUri
Convert legacy string URI format to UriComponents during deserialization
and re-persist. All runtime code now uses URI.revive safely.
* Remove all legacy storage migration code from ProjectPicker
* Restore legacy folder/repo picker migration, only remove string→UriComponents migration
* Only recreate session when project type changes (folder↔repo)
* Revert: always create new session when project changes
* Pass project to _updateTargetPickerState to avoid stale session state
* Inline _updateTargetPickerState and remove method
* Force Folder mode for non-git projects, disable picker when no repo
* Fix target mode restore: use _createNewSession for restored projects
Don't route restored projects through _onProjectSelected — the target
picker was already correctly configured by _restoreState with the
preferred mode. Calling _onProjectSelected would re-call setProject
without the preferred mode, losing the restored state.
* Remove early return in setProject, always update trigger label
* Default to worktree on project change, simplify setProject
Remove _preferredLocalMode — target always resets to worktree when
a new folder with git is selected, forced to folder when no git.
* Route restored projects through _onProjectSelected, remove preferredMode
- Initial session creation always goes through _onProjectSelected
- Remove preferredMode parameter from TargetPicker.setProject
- Remove targetMode from IDraftState (derived from project)
* Restore targetMode from draft state via _openRepository preferredMode
Store targetMode in draft, pass it through _openRepository to
_targetPicker.setProject when the git repo resolves.
* Reset target mode only on user project change, retain on repo resolve
- setProject takes resetMode flag instead of preferredMode
- _onProjectSelected passes resetMode=true (user action → reset to worktree)
- _openRepository passes resetMode=false (repo resolving → keep current mode)
- Remove targetMode from draft state — no longer needed for restore
- Simplify _openRepository signature
* Fix resetMode: persist flag until repo resolves
When resetMode=true is passed but the project has no repo yet,
store _pendingReset so the mode resets to worktree when the
repo resolves in a subsequent setProject call.
* Simplify: never reset target mode on project change
Target mode is retained across project changes. Only forced transitions:
- repo → cloud
- folder without git → workspace
- cloud → folder with git → worktree (switching back from cloud)
User's explicit dropdown choice (worktree/folder) is always respected.
* Don't force workspace for non-git folders, keep current mode disabled
Only forced transitions: repo→cloud, cloud→folder=worktree.
Non-git folders show current mode as disabled until repo resolves.
* Show Folder mode for non-git folders when isolation option is enabled
* Default to worktree always for folder projects
* Refactor TargetPicker: extract _updateMode, simplify disabled state
- Extract mode logic into _updateMode(), called from setProject and config change
- Folder with git → worktree, folder without git → workspace, repo → cloud
- Picker only enabled when folder has git repo and isolation option is enabled
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: populate githubRepo for GitUri marketplace references
When a plugin marketplace reference is a full GitHub URL (e.g.
https://github.com/anthropics/claude-code) parsed as a GitUri, the
githubRepo property was not being set. This caused the AgentPluginEditor
to render the marketplace link as plain text instead of a clickable link.
- Add extractGitHubRepo helper that extracts owner/repo from GitHub URLs
- Set githubRepo on GitUri references when the authority is github.com
- Also handle SCP-style references (git@github.com:org/repo.git)
Fixes https://github.com/microsoft/vscode/issues/301288
(Commit message generated by Copilot)
* pr comments
* Enhance AI Customization Management: Add section item counts and update UI components
- Introduced count property for section items in the AI Customization Management editor.
- Updated the rendering logic to display item counts conditionally.
- Implemented event emitters for item count changes in MCP, Plugin, and Chat Models widgets.
- Enhanced CSS styles for section count display in the sidebar.
* Update section count styling: increase font size and adjust padding
* Refine section count styling: adjust font size, padding, border radius, and line height
* Update section count styling: increase font size, padding, border radius, and line height
* Remove section count background and color styles from selected list items
* Update section count handling in AICustomizationManagementEditor to include MCP, Plugins, and Models
* Seed initial section counts for MCP, Plugins, and Models in AICustomizationManagementEditor
* Refactor item count calculation in MCP and Plugin list widgets to sum displayed group header counts
* Refactor prompts section count handling to refresh all sections on data changes
* Refactor item count handling in AICustomizationListWidget and AICustomizationManagementEditor to use shared loading logic
* Add fireItemCount method to MCP, Plugin, and Models widgets for item count updates
* Fix sidebar count consistency: use data arrays as single source of truth
- Guard prompt list count handler to only update prompt sections (not MCP/Plugins)
- MCP itemCount derived from filteredServers + filteredBuiltinCount (same arrays as group headers)
- Plugin itemCount derived from installedItems (same array as enabled/disabled groups)
* Address PR review: debounce prompt count refresh, handle errors
- Debounce refreshAllPromptsSectionCounts via RunOnceScheduler (100ms)
to prevent stale overwrites from rapid successive prompts events
- Route rejected computeItemCountForSection promises to onUnexpectedError
instead of leaving them unhandled
* plugins: clear enablement state on marketplace plugin uninstall
- Adds IEnablementModel.remove(key) to delete enablement entries from
both profile and workspace storage
- Calls remove() when uninstalling a marketplace plugin so that a
disabled plugin does not retain stale disabled state after uninstall
Fixes https://github.com/microsoft/vscode/issues/301295
(Commit message generated by Copilot)
* build
* build
* aiCustomization: prompt to uninstall plugin when removing plugin-provided components
When a user tries to uninstall an individual MCP server or hook that was
installed as part of a plugin, the system now prompts them to uninstall
the entire plugin instead of showing a misleading error or allowing
piecemeal removal.
- Add 'Uninstall Plugin' action to the AI Customization management editor,
visible as an inline icon and context menu item for plugin-provided items
- Update the delete action to intercept plugin items and offer plugin
uninstall with a confirmation dialog showing the plugin name
- Separate plugin handling from the extension/built-in guard so the dialog
text is accurate for each case
- Add plugin-aware context menu to the MCP list widget for builtin servers
from plugins, with collection ID tracking to identify plugin origin
- Add collectionId to IMcpBuiltinItemEntry to enable plugin detection
Fixes https://github.com/microsoft/vscode/issues/302515
(Commit message generated by Copilot)
* pr comments
* feat: add autoAttachReferences option to chat session extension point
This allows us to opt-in/out in to auto-attaching references.
Some external agents will manage auto attaching references by themselves, this allows them to do so without Core injecting stuff automatically.
* fix: treat autoAttachReferences as enabled by default, fix description
Address PR review feedback:
- Only skip instruction auto-attachment when autoAttachReferences is
explicitly false, preserving existing behavior for session types that
don't specify the flag.
- Update schema description to accurately reflect what the flag controls
(instruction files only, not implicit context) and correct the default.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: update autoAttachReferences default to false and improve description
* chat: add marketplace validation with busy state for plugin installation
Adds validation when installing plugins from source to ensure repositories
are valid plugin marketplaces. Previously, repos with no plugins would be
silently treated as single plugins. Now the system:
- Validates plugin source format before cloning (inline error in quickinput)
- Shows busy state while metadata is retrieved
- Displays validation error if 0 plugins found in marketplace.json
- Allows users to correct input and retry on validation errors
- Cleans up cloned repositories when validation fails
- Separates synchronous format validation from async install operations
Changes:
- Add validatePluginSource() synchronous format check method
- Add installPluginFromValidatedSource() async install method
- Update InstallFromSourceAction to use createInputBox for validation flow
- Hide quickinput during trust dialog to prevent overlap
- Call cleanupPluginSource() when no plugins found to avoid disk clutter
- Update tests to expect error on empty marketplace.json
Fixes https://github.com/microsoft/vscode/issues/302511
(Commit message generated by Copilot)
* fix
* chat: add URL handlers for plugin installation and marketplace registration
Adds a PluginUrlHandler workbench contribution that handles vscode:// URIs for
plugin-related actions:
- vscode://chat-plugin/install?source=<owner/repo or base64> triggers plugin
installation from a GitHub repo or git clone URL, with a trust confirmation
dialog before proceeding.
- vscode://chat-plugin/add-marketplace?ref=<owner/repo or base64> adds a
marketplace reference to the user's chat.plugins.marketplaces setting,
deduplicating against existing entries.
- Query parameters support both plain-text (owner/repo) and base64-encoded
values, with validation fallback: tries base64 decode first, then raw value.
- Includes unit tests covering routing, base64/plain-text decoding, dialog
confirmation/rejection, missing/invalid params, and marketplace dedup.
Fixes https://github.com/microsoft/vscode/issues/302316
(Commit message generated by Copilot)
* pr comments
Fixes#301293
Changed the documentation link from /docs/copilot/chat/agent-plugins to /docs/copilot/customization/agent-plugins to point to the correct documentation page.
* extensions: show installed agent plugins when searching @agentPlugins @installed
Handle @agentPlugins @installed query in the agent plugins view by treating
@installed as a filter modifier rather than search text. Also prevent @installed
modifier from triggering the default installed extensions view when @mcp or
@agentPlugins queries are present.
- Extract @installed from search text in AgentPluginsListView.show() and use
it as a filter to exclude marketplace plugins from results
- Exclude @mcp and @agentPlugins queries from isInstalledExtensionsQuery and
isSearchInstalledExtensionsQuery detection methods to prevent incorrect view
routing
- Add test cases to verify that @mcp and @agentPlugins queries with @installed
are not treated as installed extension queries
Fixes https://github.com/microsoft/vscode/issues/302509
(Commit message generated by Copilot)
* fix