Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/vs/workbench/contrib/chat/browser/chatInputPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,10 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
return hideAll();
}

if (!this.chatSessionsService.hasAnySessionOptions(ctx.chatSessionType, ctx.chatSessionId)) {
return hideAll();
}

this.chatSessionHasOptions.set(true);

const currentWidgetGroupIds = new Set(this.chatSessionPickerWidgets.keys());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,13 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
this._sessions.delete(sessionKey);
}

public hasAnySessionOptions(chatSessionType: string, id: string): boolean {
const sessionKey = `${chatSessionType}_${id}`;
const session = this._sessions.get(sessionKey);
return !!session && !!session.options && Object.keys(session.options).length > 0;
}


public getSessionOption(chatSessionType: string, id: string, optionId: string): string | undefined {
const sessionKey = `${chatSessionType}_${id}`;
const session = this._sessions.get(sessionKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export interface IChatSessionsService {
// Notify providers about session items changes
notifySessionItemsChanged(chatSessionType: string): void;

hasAnySessionOptions(chatSessionType: string, sessionId: string): boolean;
getSessionOption(chatSessionType: string, sessionId: string, optionId: string): string | undefined;
setSessionOption(chatSessionType: string, sessionId: string, optionId: string, value: string): boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ export class MockChatSessionsService implements IChatSessionsService {
return true;
}

hasAnySessionOptions(chatSessionType: string, sessionId: string): boolean {
const sessionKey = `${chatSessionType}:${sessionId}`;
const options = this.sessionOptions.get(sessionKey);
return options !== undefined && options.size > 0;
}

getCapabilitiesForSessionType(chatSessionType: string): IChatAgentAttachmentCapabilities | undefined {
return this.contributions.find(c => c.type === chatSessionType)?.capabilities;
}
Expand Down
Loading