Merge pull request #304863 from mjbvz/dev/mjbvz/xenacious-roundworm

Remove unused `hasAnySessionOptions` method
This commit is contained in:
Matt Bierner
2026-03-26 14:06:04 -07:00
committed by GitHub
3 changed files with 0 additions and 46 deletions

View File

@@ -909,47 +909,6 @@ suite('MainThreadChatSessions', function () {
mainThread.$unregisterChatSessionContentProvider(1);
});
test('hasAnySessionOptions returns correct values', async function () {
const sessionScheme = 'test-session-type';
mainThread.$registerChatSessionContentProvider(1, sessionScheme);
const resourceWithOptions = URI.parse(`${sessionScheme}:/session-with-options`);
const resourceWithoutOptions = URI.parse(`${sessionScheme}:/session-without-options`);
// Session with options
const sessionContentWithOptions: IChatSessionDto = {
resource: resourceWithOptions,
history: [],
hasActiveResponseCallback: false,
hasRequestHandler: false,
hasForkHandler: false,
supportsInterruption: false,
options: { 'models': 'gpt-4' }
};
// Session without options
const sessionContentWithoutOptions: IChatSessionDto = {
resource: resourceWithoutOptions,
history: [],
hasActiveResponseCallback: false,
hasRequestHandler: false,
hasForkHandler: false,
supportsInterruption: false,
};
asSinonMethodStub(proxy.$provideChatSessionContent)
.onFirstCall().resolves(sessionContentWithOptions)
.onSecondCall().resolves(sessionContentWithoutOptions);
await chatSessionsService.getOrCreateChatSession(resourceWithOptions, CancellationToken.None);
await chatSessionsService.getOrCreateChatSession(resourceWithoutOptions, CancellationToken.None);
assert.strictEqual(chatSessionsService.hasAnySessionOptions(resourceWithOptions), true);
assert.strictEqual(chatSessionsService.hasAnySessionOptions(resourceWithoutOptions), false);
mainThread.$unregisterChatSessionContentProvider(1);
});
});
suite('ExtHostChatSessions', function () {

View File

@@ -361,7 +361,6 @@ export interface IChatSessionsService {
canResolveChatSession(sessionType: string): Promise<boolean>;
getOrCreateChatSession(sessionResource: URI, token: CancellationToken): Promise<IChatSession>;
hasAnySessionOptions(sessionResource: URI): boolean;
getSessionOptions(sessionResource: URI): ReadonlyChatSessionOptionsMap | undefined;
getSessionOption(sessionResource: URI, optionId: string): string | IChatSessionProviderOptionItem | undefined;
setSessionOption(sessionResource: URI, optionId: string, value: string | IChatSessionProviderOptionItem): boolean;

View File

@@ -202,10 +202,6 @@ export class MockChatSessionsService implements IChatSessionsService {
return true;
}
hasAnySessionOptions(resource: URI): boolean {
return this.sessionOptions.has(resource) && this.sessionOptions.get(resource)!.size > 0;
}
getCapabilitiesForSessionType(chatSessionType: string): IChatAgentAttachmentCapabilities | undefined {
return this.contributions.find(c => c.type === chatSessionType)?.capabilities;
}