-
Notifications
You must be signed in to change notification settings - Fork 37.5k
Hiding local target exploration #289252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Hiding local target exploration #289252
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements functionality to hide the Local session provider option when working in an empty workspace. The goal is to provide a better user experience by not showing Local-related features when there's no workspace context.
Changes:
- Added an optional
isSessionTypeVisiblemethod to theISessionTypePickerDelegateinterface to control session type visibility - Implemented logic in the agent sessions welcome page to detect empty workspaces and hide Local provider options accordingly
- Updated the session target picker to respect visibility settings from the delegate
- Modified chat input part to hide model picker, mode picker, and option groups when Local session type is hidden
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/browser/chat.ts |
Added isSessionTypeVisible optional method to ISessionTypePickerDelegate interface |
src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.ts |
Implemented empty workspace detection and automatic switch to Cloud provider with visibility control delegate |
src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.ts |
Added check to respect delegate's visibility settings for session types |
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts |
Added logic to hide model picker, mode picker, and option groups when Local is hidden; introduced HiddenActionViewItem class |
| // Early exit: if Local session type is hidden via delegate, also hide option groups | ||
| // This supports scenarios like empty workspace where Local-related features should be hidden | ||
| if (this.options.sessionTypePickerDelegate?.isSessionTypeVisible) { | ||
| if (!this.options.sessionTypePickerDelegate.isSessionTypeVisible(AgentSessionProviders.Local)) { | ||
| setNoOptions(); | ||
| return undefined; | ||
| } | ||
| } |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic here checks if Local session type is hidden, but it doesn't verify if the effectiveSessionType is actually Local. This means option groups will be hidden for ALL session types (including Cloud) when Local is hidden in an empty workspace. The check should only hide option groups when effectiveSessionType equals AgentSessionProviders.Local.
| // If workspace is empty and we're currently on Local, switch to a different provider | ||
| const isEmptyWorkspace = this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY; | ||
| if (isEmptyWorkspace && this._selectedSessionProvider === AgentSessionProviders.Local) { | ||
| this._selectedSessionProvider = AgentSessionProviders.Cloud; |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When switching from Local to Cloud in an empty workspace, there's no guarantee that Cloud provider is available. Cloud is not a built-in provider and must be registered via extension. If Cloud is not available, the code should fall back to the first available non-Local provider, or handle the case where no providers are available gracefully. Consider checking if Cloud is available before setting it, or selecting the first available provider dynamically.
| // If workspace is empty and we're currently on Local, switch to a different provider | |
| const isEmptyWorkspace = this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY; | |
| if (isEmptyWorkspace && this._selectedSessionProvider === AgentSessionProviders.Local) { | |
| this._selectedSessionProvider = AgentSessionProviders.Cloud; | |
| // If workspace is empty and we're currently on Local, switch to a different available non-Local provider if possible | |
| const isEmptyWorkspace = this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY; | |
| if (isEmptyWorkspace && this._selectedSessionProvider === AgentSessionProviders.Local) { | |
| const availableProviders = this.agentSessionsService.getAvailableSessionProviders?.() ?? []; | |
| const nonLocalProviders = availableProviders.filter(provider => provider !== AgentSessionProviders.Local); | |
| if (nonLocalProviders.length > 0) { | |
| this._selectedSessionProvider = nonLocalProviders[0]; | |
| } |
No description provided.