sessions: workspace picker emits folder URI, session type picker spans 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> S
Sandeep Somavarapu committed
1e7597c912efdfa3f6e6465184c87d7ef657ab87
Parent: 9ecd1e9
Committed by GitHub <noreply@github.com>
on 5/20/2026, 6:38:57 PM