Skip to content

Commit 5b78679

Browse files
authored
Fix issues with agent mode disabled (microsoft#258371)
- When agent mode is selected, then disabled, fall back to ask mode - Disable custom modes when agent mode disabled Fix microsoft/vscode-copilot#19072
1 parent 3b2a65d commit 5b78679

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/vs/workbench/contrib/chat/browser/chatInputPart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
693693
const currentMode = this._currentModeObservable.get();
694694
const validMode = this.chatModeService.findModeById(currentMode.id);
695695
if (!validMode) {
696-
this.setChatMode2(ChatMode.Agent);
696+
this.setChatMode(ChatModeKind.Agent);
697697
return;
698698
}
699699
}

src/vs/workbench/contrib/chat/common/chatModes.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,12 @@ export class ChatModeService extends Disposable implements IChatModeService {
160160
}
161161

162162
getModes(): { builtin: readonly IChatMode[]; custom: readonly IChatMode[] } {
163-
return { builtin: this.getBuiltinModes(), custom: Array.from(this._customModeInstances.values()) };
163+
return {
164+
builtin: this.getBuiltinModes(),
165+
custom: this.chatAgentService.hasToolsAgent ?
166+
Array.from(this._customModeInstances.values()) :
167+
[]
168+
};
164169
}
165170

166171
private getFlatModes(): IChatMode[] {

0 commit comments

Comments
 (0)