Skip to content

Disable Cloud for Free/EDU users#320179

Open
cwebster-99 wants to merge 3 commits into
mainfrom
sick-silkworm
Open

Disable Cloud for Free/EDU users#320179
cwebster-99 wants to merge 3 commits into
mainfrom
sick-silkworm

Conversation

@cwebster-99
Copy link
Copy Markdown
Member

This pull request introduces entitlement-based gating for session types in the chat session picker, specifically restricting access to the cloud agent for users with Free or EDU (Student) plans. It also enhances the UI by providing upgrade prompts and improved link styling within the action widget.

Entitlement-based session gating and upgrade prompts:

  • Added logic to SessionTypePickerActionItem to check user entitlement via IChatEntitlementService and disable the cloud agent option for Free and EDU users, displaying an upgrade prompt and hover message instead. [1] [2]
  • Updated constructors and dependencies in both DelegationSessionPickerActionItem and SessionTypePickerActionItem to inject IChatEntitlementService for entitlement checks. [1] [2] [3] [4]

Type improvements for markdown support:

  • Changed the description and hover.content fields in action widget interfaces to accept IMarkdownString in addition to plain strings, enabling richer content and links in descriptions and hovers. [1] [2] [3]

UI enhancements:

  • Updated CSS to style links in action widget descriptions, ensuring they match the theme's link colors and provide visual feedback on hover or active states.
image image

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

This PR adds entitlement-based gating to the chat session target picker so that the Cloud agent option is restricted for Copilot Free and Copilot Student (EDU) users, while also enhancing the Action Widget to support markdown descriptions/hovers (including links) and styling those links consistently.

Changes:

  • Gate the Cloud session target based on IChatEntitlementService and show an upgrade prompt/hover when locked.
  • Extend Action Widget types to allow IMarkdownString for item descriptions and hover content.
  • Add Action Widget CSS to theme link colors in item descriptions.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.ts Adds entitlement checks and upgrade messaging for the Cloud session target.
src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.ts Wires IChatEntitlementService through to the base picker for delegation scenarios.
src/vs/platform/actionWidget/browser/actionWidgetDropdown.ts Allows markdown descriptions in dropdown action items.
src/vs/platform/actionWidget/browser/actionWidget.css Styles links inside action descriptions to use theme link colors.
src/vs/platform/actionWidget/browser/actionList.ts Widens hover content typing to accept IMarkdownString.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/platform/actionWidget/browser/actionList.ts:56

  • IActionListItemHover.content is widened to IMarkdownString, which can carry isTrusted: { enabledCommands: ... }. However, link activation in ActionList currently opens URIs with { allowCommands: true }, which ignores enabledCommands and can allow arbitrary command URIs whenever a markdown payload is marked trusted. It would be better to thread enabledCommands through and pass allowCommands: enabledCommands (or false) accordingly.
	/**
	 * Content to display in the hover. Can be a markdown string or an HTMLElement for full DOM control.
	 */
	readonly content?: string | IMarkdownString | HTMLElement;
	/**
	 * Optional disposable associated with the hover content (e.g. from rendered markdown).
	 */
	readonly disposable?: IDisposable;
  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment on lines +73 to 85
const lockedForEntitlement = this._isLockedForEntitlement(sessionTypeItem.type);
actions.push({
...action,
id: sessionTypeItem.commandId,
label: sessionTypeItem.label,
checked: currentType === sessionTypeItem.type,
icon: this._getSessionIcon(sessionTypeItem),
enabled: this._isSessionTypeEnabled(sessionTypeItem.type),
enabled: lockedForEntitlement ? false : this._isSessionTypeEnabled(sessionTypeItem.type),
category: this._getSessionCategory(sessionTypeItem),
description: this._getSessionDescription(sessionTypeItem),
description: lockedForEntitlement ? this._getUpgradeDescription() : this._getSessionDescription(sessionTypeItem),
tooltip: '',
hover: { content: sessionTypeItem.hoverDescription },
hover: { content: lockedForEntitlement ? this._getUpgradeHover() : sessionTypeItem.hoverDescription },
run: async () => {
cwebster-99 and others added 2 commits June 5, 2026 15:58
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts:
#	src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.ts
#	src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.ts
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.

Lock CCA on Free/EDU with prompt to upgrade

2 participants