Revert to old non-agentic ask behavior when agent is disabled#296257
Revert to old non-agentic ask behavior when agent is disabled#296257
Conversation
There was a problem hiding this comment.
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
agentModeDisabledViaPolicyinto built-in mode filtering. - Update
shouldShowBuiltInModeto 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.Editentry whenagentModeDisabledViaPolicyis 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;
}
| if (mode.id === ChatMode.Ask.id || mode.name.get().toLowerCase() === 'ask') { | ||
| if (mode.id === ChatMode.Ask.id) { | ||
| return assignments.showOldAskMode || agentModeDisabledViaPolicy; | ||
| } | ||
| return true; | ||
| } |
There was a problem hiding this comment.
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 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