Skip to content

Commit 7eaf722

Browse files
authored
adopt chatSessionOptions when clause (depends on microsoft/vscode#286814) (#2773)
1 parent 80148af commit 7eaf722

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ export class CopilotCloudSessionsProvider extends Disposable implements vscode.C
398398
name: vscode.l10n.t('Custom Agents'),
399399
description: vscode.l10n.t('Select which custom agent to use'),
400400
items: agentItems,
401+
when: `chatSessionOption.partnerAgents == ${DEFAULT_PARTNER_AGENT_ID}`
401402
});
402403
}
403404

@@ -414,6 +415,7 @@ export class CopilotCloudSessionsProvider extends Disposable implements vscode.C
414415
name: vscode.l10n.t('Model'),
415416
description: vscode.l10n.t('Select which model to use'),
416417
items: modelItems,
418+
when: `chatSessionOption.partnerAgents == ${DEFAULT_PARTNER_AGENT_ID}`
417419
});
418420
}
419421

src/extension/vscode.proposed.chatSessionsProvider.d.ts

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,6 @@ declare module 'vscode' {
4949
*/
5050
readonly onDidCommitChatSessionItem: Event<{ original: ChatSessionItem /** untitled */; modified: ChatSessionItem /** newly created */ }>;
5151

52-
/**
53-
* DEPRECATED: Will be removed!
54-
* Creates a new chat session.
55-
*
56-
* @param options Options for the new session including an optional initial prompt and history
57-
* @param token A cancellation token
58-
* @returns Metadata for the chat session
59-
*/
60-
provideNewChatSessionItem?(options: {
61-
/**
62-
* The chat request that initiated the session creation
63-
*/
64-
readonly request: ChatRequest;
65-
66-
/**
67-
* Additional metadata to use for session creation
68-
*/
69-
metadata?: any;
70-
}, token: CancellationToken): ProviderResult<ChatSessionItem>;
71-
7252
// #endregion
7353
}
7454

@@ -382,6 +362,16 @@ declare module 'vscode' {
382362
* The selectable items within this option group.
383363
*/
384364
readonly items: ChatSessionProviderOptionItem[];
365+
366+
/**
367+
* A context key expression that controls when this option group picker is visible.
368+
* When specified, the picker is only shown when the expression evaluates to true.
369+
* The expression can reference other option group values via `chatSessionOption.<groupId>`.
370+
*
371+
* Example: `"chatSessionOption.models == 'gpt-4'"` - only show this picker when
372+
* the 'models' option group has 'gpt-4' selected.
373+
*/
374+
readonly when?: string;
385375
}
386376

387377
export interface ChatSessionProviderOptions {

0 commit comments

Comments
 (0)