Skip to content

Revert to old non-agentic ask behavior when agent is disabled#296257

Merged
benibenj merged 2 commits intomainfrom
benibenj/sure-rat
Feb 19, 2026
Merged

Revert to old non-agentic ask behavior when agent is disabled#296257
benibenj merged 2 commits intomainfrom
benibenj/sure-rat

Conversation

@benibenj
Copy link
Contributor

Copilot Generated Description: Update the mode display logic to revert to the previous behavior for the "Ask" mode when the agent is disabled. Adjustments ensure that the old or new version of the "Ask" mode is shown based on the assignment and agent disablement.

Fixes #296232

Copilot AI review requested due to automatic review settings February 19, 2026 11:07
@benibenj benibenj enabled auto-merge February 19, 2026 11:07
@benibenj benibenj self-assigned this Feb 19, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 19, 2026
Copy link
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

Adjusts the chat mode picker’s filtering logic to prefer the legacy (non-agentic) “Ask” mode when Agent mode is disabled via policy, while still supporting assignment-based rollout between old/new “Ask”.

Changes:

  • Thread agentModeDisabledViaPolicy into built-in mode filtering.
  • Update shouldShowBuiltInMode to alter “Ask” (and “Edit”) visibility based on assignment + policy disablement.
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.ts:345

  • The "Edit" filtering now shows the legacy ChatMode.Edit entry when agentModeDisabledViaPolicy is true, but it also unconditionally allows any built-in-considered mode whose name lowercases to 'edit'. If there is a replacement (prompt-file) "Edit" mode, this will cause both the deprecated and the replacement Edit modes to be shown simultaneously when agent mode is disabled by policy. Consider applying the same mutual-exclusion logic here as for "Ask" so only one Edit mode is visible for a given state.
	if (mode.id === ChatMode.Edit.id || mode.name.get().toLowerCase() === 'edit') {
		if (mode.id === ChatMode.Edit.id) {
			return agentModeDisabledViaPolicy;
		}
		return true;
	}

Comment on lines 349 to 354
if (mode.id === ChatMode.Ask.id || mode.name.get().toLowerCase() === 'ask') {
if (mode.id === ChatMode.Ask.id) {
return assignments.showOldAskMode || agentModeDisabledViaPolicy;
}
return true;
}
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

shouldShowBuiltInMode now returns true for any mode whose name lowercases to 'ask', which means the new/agentic "Ask" mode will always be shown. When assignments.showOldAskMode is true (or when agentModeDisabledViaPolicy is true), this will also allow the legacy ChatMode.Ask entry, so both "Ask" modes can appear at once—contradicting the comment (“but not both”) and defeating the revert-when-agent-disabled behavior. Adjust the logic so the name-based (new) Ask mode is hidden when the old Ask mode is selected and/or when agent mode is disabled via policy.

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

Copilot uses AI. Check for mistakes.
@benibenj benibenj merged commit d0a76aa into main Feb 19, 2026
18 checks passed
@benibenj benibenj deleted the benibenj/sure-rat branch February 19, 2026 11:48
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.

If agent is disabled, revert behavior back to old non-agentic ask

2 participants

Comments