66import * as dom from '../../../../base/browser/dom.js' ;
77import { raceCancellationError } from '../../../../base/common/async.js' ;
88import { CancellationToken } from '../../../../base/common/cancellation.js' ;
9- import { Schemas } from '../../../../base/common/network.js' ;
109import { IContextKeyService , IScopedContextKeyService } from '../../../../platform/contextkey/common/contextkey.js' ;
1110import { IEditorOptions } from '../../../../platform/editor/common/editor.js' ;
1211import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js' ;
@@ -24,16 +23,15 @@ import { ChatContextKeys } from '../common/chatContextKeys.js';
2423import { IChatModel , IExportableChatData , ISerializableChatData } from '../common/chatModel.js' ;
2524import { CHAT_PROVIDER_ID } from '../common/chatParticipantContribTypes.js' ;
2625import { IChatSessionsService } from '../common/chatSessionsService.js' ;
27- import { ChatSessionUri } from '../common/chatUri.js' ;
2826import { ChatAgentLocation , ChatModeKind } from '../common/constants.js' ;
2927import { clearChatEditor } from './actions/chatClear.js' ;
3028import { ChatEditorInput } from './chatEditorInput.js' ;
29+ import { getChatSessionType } from './chatSessions/common.js' ;
3130import { ChatWidget , IChatViewState } from './chatWidget.js' ;
3231
3332export interface IChatEditorOptions extends IEditorOptions {
3433 target ?: { sessionId : string } | { data : IExportableChatData | ISerializableChatData } ;
3534 preferredTitle ?: string ;
36- chatSessionType ?: string ;
3735 ignoreInView ?: boolean ;
3836}
3937
@@ -138,18 +136,14 @@ export class ChatEditor extends EditorPane {
138136 }
139137
140138 let isContributedChatSession = false ;
141- if ( options ?. chatSessionType || input . resource . scheme === Schemas . vscodeChatSession ) {
142- const chatSessionType = options ?. chatSessionType ?? ChatSessionUri . parse ( input . resource ) ?. chatSessionType ;
143- if ( chatSessionType ) {
144- await raceCancellationError ( this . chatSessionsService . canResolveContentProvider ( chatSessionType ) , token ) ;
145- const contributions = this . chatSessionsService . getAllChatSessionContributions ( ) ;
146- const contribution = contributions . find ( c => c . type === chatSessionType ) ;
147- if ( contribution ) {
148- this . widget . lockToCodingAgent ( contribution . name , contribution . displayName , contribution . type ) ;
149- isContributedChatSession = true ;
150- } else {
151- this . widget . unlockFromCodingAgent ( ) ;
152- }
139+ const chatSessionType = getChatSessionType ( input ) ;
140+ if ( chatSessionType !== 'local' ) {
141+ await raceCancellationError ( this . chatSessionsService . canResolveContentProvider ( chatSessionType ) , token ) ;
142+ const contributions = this . chatSessionsService . getAllChatSessionContributions ( ) ;
143+ const contribution = contributions . find ( c => c . type === chatSessionType ) ;
144+ if ( contribution ) {
145+ this . widget . lockToCodingAgent ( contribution . name , contribution . displayName , contribution . type ) ;
146+ isContributedChatSession = true ;
153147 } else {
154148 this . widget . unlockFromCodingAgent ( ) ;
155149 }
0 commit comments