Skip to content

fix #308675#308770

Merged
sandy081 merged 1 commit intomainfrom
sandy081/rigid-jay
Apr 9, 2026
Merged

fix #308675#308770
sandy081 merged 1 commit intomainfrom
sandy081/rigid-jay

Conversation

@sandy081
Copy link
Copy Markdown
Member

@sandy081 sandy081 commented Apr 9, 2026

fix #308675

Copilot AI review requested due to automatic review settings April 9, 2026 12:32
@sandy081 sandy081 enabled auto-merge (squash) April 9, 2026 12:32
@sandy081 sandy081 self-assigned this Apr 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Sessions “harness/session type” picker so it can still open on the New Session screen and display all provider-defined session types, with unavailable ones shown as disabled (addressing #308675).

Changes:

  • Fetch both (a) provider-wide session types and (b) session-supported session types, and use them to render a full list with disabled entries.
  • Change picker open/visibility logic to be based on provider session types rather than only the supported subset.
Show a summary per file
File Description
src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts Builds the picker list from provider session types and disables unsupported ones so the dropdown still opens even when only one option is selectable.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts:97

  • Now that the picker can open even when only one session type is supported (by showing other provider types as disabled), users can click the already-checked/enabled item. That will still trigger the delegate's onSelect path and call sessionsManagementService.setSessionType(...), which can reject/throw for providers that don't support changing session type (e.g. CopilotChatSessionsProvider throws "Session type cannot be changed"). Consider preventing selection of the current type (or making it a no-op) and handling the returned promise to avoid unhandled rejections.
		const items: IActionListItem<ISessionType>[] = this._allProviderSessionTypes.map(type => ({
			kind: ActionListItemKind.Action,
			label: type.label,
			group: { title: '', icon: type.icon },
			disabled: !supportedTypeIds.has(type.id),
			item: type.id === this._sessionType ? { ...type, checked: true } : type,
		}));
  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment on lines 34 to 46
this._register(autorun(reader => {
const session = this.sessionsManagementService.activeSession.read(reader);
if (session) {
this._sessionTypes = this.sessionsManagementService.getSessionTypes(session);
this._supportedSessionTypes = this.sessionsManagementService.getSessionTypes(session);
const provider = this.sessionsProvidersService.getProvider(session.providerId);
this._allProviderSessionTypes = provider ? [...provider.sessionTypes] : [];
this._sessionType = session.sessionType;
} else {
this._sessionTypes = [];
this._supportedSessionTypes = [];
this._allProviderSessionTypes = [];
this._sessionType = undefined;
}
this._updateTriggerLabel();
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list of _allProviderSessionTypes is derived from sessionsProvidersService.getProvider(...), but this is only recomputed when activeSession changes. If providers register/unregister after the active session is set (there is existing code handling provider-registration startup races elsewhere), this picker can remain hidden or stale until the session changes again. Consider subscribing to sessionsProvidersService.onDidChangeProviders (or another observable/event) to refresh _allProviderSessionTypes (and _supportedSessionTypes) for the current active session when providers change.

Copilot uses AI. Check for mistakes.
Comment on lines +89 to 97
const supportedTypeIds = new Set(this._supportedSessionTypes.map(t => t.id));

const items: IActionListItem<ISessionType>[] = this._allProviderSessionTypes.map(type => ({
kind: ActionListItemKind.Action,
label: type.label,
group: { title: '', icon: type.icon },
disabled: !supportedTypeIds.has(type.id),
item: type.id === this._sessionType ? { ...type, checked: true } : type,
}));
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change adds new behavior (show all provider session types and mark unsupported ones as disabled). There are existing unit tests for other pickers under src/vs/sessions/contrib/chat/test/browser/ (e.g. workspace picker), but none for SessionTypePicker. Please add tests that verify: (1) the picker opens when the provider has >1 session type even if only one is supported, (2) unsupported types are marked disabled, and (3) selecting a disabled item does not call setSessionType.

This issue also appears on line 91 of the same file.

Copilot uses AI. Check for mistakes.
@sandy081 sandy081 merged commit ef3548d into main Apr 9, 2026
27 checks passed
@sandy081 sandy081 deleted the sandy081/rigid-jay branch April 9, 2026 12:53
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 9, 2026
joshspicer pushed a commit that referenced this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agents: The harness picker should allow opening on the new session screen

3 participants