Skip to content
Closed
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
3 changes: 2 additions & 1 deletion src/vs/sessions/contrib/chat/browser/repoPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { renderIcon } from '../../../../base/browser/ui/iconLabel/iconLabels.js'
import { ICommandService } from '../../../../platform/commands/common/commands.js';
import { INewSession } from './newSession.js';
import { URI } from '../../../../base/common/uri.js';
import { GITHUB_REMOTE_FILE_SCHEME } from '../../fileTreeView/browser/githubFileSystemProvider.js';

const OPEN_REPO_COMMAND = 'github.copilot.chat.cloudSessions.openRepository';
const STORAGE_KEY_LAST_REPO = 'agentSessions.lastPickedRepo';
Expand Down Expand Up @@ -270,7 +271,7 @@ export class RepoPicker extends Disposable {
}

private _setRepo(repo: IRepoItem): void {
this._newSession?.setRepoUri(URI.parse(`vscode-vfs://github/${repo.id}`));
this._newSession?.setRepoUri(URI.parse(`${GITHUB_REMOTE_FILE_SCHEME}://github/${repo.id}`));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { AgentSessionProviders } from '../../../../workbench/contrib/chat/browse
import { INewSession, LocalNewSession, RemoteNewSession } from '../../chat/browser/newSession.js';
import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js';
import { ILanguageModelsService } from '../../../../workbench/contrib/chat/common/languageModels.js';
import { GITHUB_REMOTE_FILE_SCHEME } from '../../fileTreeView/browser/githubFileSystemProvider.js';

export const IsNewChatSessionContext = new RawContextKey<boolean>('isNewChatSession', true);

Expand Down Expand Up @@ -202,7 +203,7 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
}

if (session.providerType === AgentSessionProviders.Cloud) {
return [URI.parse(`vscode-vfs://github/${metadata.owner}/${metadata.name}`), undefined];
return [URI.parse(`${GITHUB_REMOTE_FILE_SCHEME}://github/${metadata.owner}/${metadata.name}`), undefined];
}
Comment on lines 205 to 207

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For cloud sessions this constructs a repo URI from metadata.owner/metadata.name without validating they are present and strings. If either is missing, this will produce a URI containing undefined segments (and then get used as the active session repository label/key). Consider mirroring the safer pattern used elsewhere (e.g. casting to string | undefined and returning undefined when owner/name are not set) before building the URI.

Copilot uses AI. Check for mistakes.

const workingDirectoryPath = metadata?.workingDirectoryPath as string | undefined;
Expand Down