@@ -23,6 +23,7 @@ import { AgentSessionProviders } from '../../../../workbench/contrib/chat/browse
2323import { INewSession , LocalNewSession , RemoteNewSession } from '../../chat/browser/newSession.js' ;
2424import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js' ;
2525import { ILanguageModelsService } from '../../../../workbench/contrib/chat/common/languageModels.js' ;
26+ import { GITHUB_REMOTE_FILE_SCHEME } from '../../fileTreeView/browser/githubFileSystemProvider.js' ;
2627
2728export const IsNewChatSessionContext = new RawContextKey < boolean > ( 'isNewChatSession' , true ) ;
2829
@@ -186,11 +187,16 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
186187 }
187188 }
188189
189- private getRepositoryFromMetadata ( metadata : { readonly [ key : string ] : unknown } | undefined ) : [ URI | undefined , URI | undefined ] {
190+ private getRepositoryFromMetadata ( session : IAgentSession ) : [ URI | undefined , URI | undefined ] {
191+ const metadata = session . metadata ;
190192 if ( ! metadata ) {
191193 return [ undefined , undefined ] ;
192194 }
193195
196+ if ( session . providerType === AgentSessionProviders . Cloud ) {
197+ return [ URI . parse ( `${ GITHUB_REMOTE_FILE_SCHEME } ://github/${ metadata . owner } /${ metadata . name } ` ) , undefined ] ;
198+ }
199+
194200 const repositoryPath = metadata ?. repositoryPath as string | undefined ;
195201 const repositoryPathUri = typeof repositoryPath === 'string' ? URI . file ( repositoryPath ) : undefined ;
196202
@@ -404,7 +410,7 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
404410 if ( session ) {
405411 if ( isAgentSession ( session ) ) {
406412 this . lastSelectedSession = session . resource ;
407- const [ repository , worktree ] = this . getRepositoryFromMetadata ( session . metadata ) ;
413+ const [ repository , worktree ] = this . getRepositoryFromMetadata ( session ) ;
408414 activeSessionItem = {
409415 isUntitled : this . chatService . getSession ( session . resource ) ?. contributedChatSession ?. isUntitled ?? true ,
410416 label : session . label ,
0 commit comments