Skip to content
Merged
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
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@
"contribEditorContentMenu",
"chatPromptFiles",
"mcpServerDefinitions",
"tabInputMultiDiff"
"tabInputMultiDiff",
"workspaceTrust"
],
"contributes": {
"languageModelTools": [
Expand Down Expand Up @@ -2140,6 +2141,12 @@
"icon": "$(terminal)",
"category": "Copilot CLI"
},
{
"command": "github.copilot.cli.sessions.openRepository",
"title": "%github.copilot.command.cli.sessions.openRepository%",
"icon": "$(folder-opened)",
"category": "Copilot CLI"
},
{
"command": "github.copilot.chat.replay",
"title": "Start Chat Replay",
Expand Down Expand Up @@ -4527,6 +4534,10 @@
"command": "github.copilot.cli.sessions.resumeInTerminal",
"when": "false"
},
{
"command": "github.copilot.cli.sessions.openRepository",
"when": "false"
},
{
"command": "github.copilot.cloud.sessions.openInBrowser",
"when": "false"
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@
"github.copilot.config.nextEditSuggestions.preferredModel": "Preferred model for next edit suggestions.",
"github.copilot.command.deleteAgentSession": "Delete...",
"github.copilot.command.cli.sessions.resumeInTerminal": "Resume in Terminal",
"github.copilot.command.cli.sessions.openRepository": "Open Repository",
"github.copilot.command.openCopilotAgentSessionsInBrowser": "Open in Browser",
"github.copilot.command.closeChatSessionPullRequest.title": "Close Pull Request",
"github.copilot.command.installPRExtension.title": "Install GitHub Pull Request Extension",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const IChatSessionWorkspaceFolderService = createServiceIdentifier<IChatS
*/
export interface IChatSessionWorkspaceFolderService {
readonly _serviceBrand: undefined;
getRecentFolders(): { folder: vscode.Uri; lastAccessTime: number }[];
deleteTrackedWorkspaceFolder(sessionId: string): Promise<void>;
/**
* Track workspace folder selection for a session (for folders without git repos in multi-root workspaces)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ export class ChatSessionWorkspaceFolderService extends Disposable implements ICh
this.logService.trace(`[ChatSessionWorkspaceFolderService] Cleaned up old entries, kept ${entriesToKeep.length}`);
}

public getRecentFolders(): { folder: vscode.Uri; lastAccessTime: number }[] {
const data = this.extensionContext.globalState.get<Record<string, WorkspaceFolderEntry>>(CHAT_SESSION_WORKSPACE_FOLDER_MEMENTO_KEY, {});
const recentFolders: { folder: vscode.Uri; lastAccessTime: number }[] = [];
for (const entry of Object.values(data)) {
if (typeof entry === 'string') {
continue;
}
if (isUntitledSessionId(entry.folderPath)) {
continue; // Skip untitled sessions that may have been saved.
}
recentFolders.push({ folder: vscode.Uri.file(entry.folderPath), lastAccessTime: entry.timestamp });
}
recentFolders.sort((a, b) => b.lastAccessTime - a.lastAccessTime);
return recentFolders;
}
async deleteTrackedWorkspaceFolder(sessionId: string): Promise<void> {
this._sessionWorkspaceFolders.delete(sessionId);
const data = this.extensionContext.globalState.get<Record<string, WorkspaceFolderEntry>>(CHAT_SESSION_WORKSPACE_FOLDER_MEMENTO_KEY, {});
Expand Down
3 changes: 1 addition & 2 deletions src/extension/chatSessions/vscode-node/chatSessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export class ChatSessionsContrib extends Disposable implements IExtensionContrib

const copilotcliChatSessionParticipant = this._register(copilotcliAgentInstaService.createInstance(
CopilotCLIChatSessionParticipant,
copilotcliSessionIsolationManager,
copilotcliChatSessionContentProvider,
promptResolver,
copilotcliSessionItemProvider,
Expand All @@ -145,7 +144,7 @@ export class ChatSessionsContrib extends Disposable implements IExtensionContrib
const copilotCLIWorkspaceFolderSessions = copilotcliAgentInstaService.invokeFunction(accessor => accessor.get(IChatSessionWorkspaceFolderService));
const copilotcliParticipant = vscode.chat.createChatParticipant(this.copilotcliSessionType, copilotcliChatSessionParticipant.createHandler());
this._register(vscode.chat.registerChatSessionContentProvider(this.copilotcliSessionType, copilotcliChatSessionContentProvider, copilotcliParticipant));
this._register(registerCLIChatCommands(copilotcliSessionItemProvider, copilotCLISessionService, copilotCLIWorktreeManagerService, gitService, copilotCLIWorkspaceFolderSessions));
this._register(registerCLIChatCommands(copilotcliSessionItemProvider, copilotCLISessionService, copilotCLIWorktreeManagerService, gitService, copilotCLIWorkspaceFolderSessions, copilotcliChatSessionContentProvider));
}

private registerCopilotCloudAgent() {
Expand Down
Loading