Skip to content

When in the Agents app, return all sessions#312229

Merged
TylerLeonhardt merged 1 commit intomainfrom
tyler/disastrous-stingray
Apr 23, 2026
Merged

When in the Agents app, return all sessions#312229
TylerLeonhardt merged 1 commit intomainfrom
tyler/disastrous-stingray

Conversation

@TylerLeonhardt
Copy link
Copy Markdown
Member

and make sure that git stuff is gated behind workspace trust.

Co-authored-by: Copilot copilot@github.com

and make sure that git stuff is gated behind workspace trust.

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 23, 2026 21:31
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) April 23, 2026 21:31
@TylerLeonhardt TylerLeonhardt self-assigned this Apr 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Copilot’s chat sessions integration to (1) list all Claude sessions when running inside the dedicated Agents app/workspace and (2) gate git-derived session metadata/change detection behind workspace trust, via a workspace-service abstraction.

Changes:

  • Add IWorkspaceService.isResourceTrusted(...) and implement it across VS Code, null, simulation, and mock workspace services.
  • In Claude sessions UI, only fetch git metadata and workspace changes for trusted working directories; run metadata+changes concurrently when trusted.
  • In Agents sessions workspace, list all Claude sessions by calling the SDK without a directory argument; update docs and tests accordingly.
Show a summary per file
File Description
extensions/copilot/src/platform/workspace/vscode/workspaceServiceImpl.ts Implements isResourceTrusted via VS Code workspace API.
extensions/copilot/src/platform/workspace/common/workspaceService.ts Adds isResourceTrusted to the workspace service interface/abstractions and null implementation.
extensions/copilot/src/platform/test/node/simulationWorkspaceServices.ts Implements isResourceTrusted for simulation workspace service.
extensions/copilot/src/platform/ignore/node/test/mockWorkspaceService.ts Updates mock workspace service to implement isResourceTrusted.
extensions/copilot/src/extension/test/node/notebookPromptRendering.spec.ts Updates a test workspace stub to implement isResourceTrusted.
extensions/copilot/src/extension/chatSessions/vscode-node/sessionOptionGroupBuilder.ts Uses workspace-service trust check to treat untrusted folders as non-git.
extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts Gates Claude session metadata + workspace changes behind resource trust; parallelizes trusted fetches.
extensions/copilot/src/extension/chatSessions/claude/node/test/mockClaudeCodeSdkService.ts Makes listSessions accept an optional directory parameter for Agents mode.
extensions/copilot/src/extension/chatSessions/claude/node/sessionParser/test/claudeCodeSessionService.spec.ts Adds coverage for Agents workspace “list all sessions” behavior; wires new DI dependency.
extensions/copilot/src/extension/chatSessions/claude/node/sessionParser/claudeCodeSessionService.ts Lists all sessions (no dir) when in Agents workspace; adds IAgentSessionsWorkspace dependency.
extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeSdkService.ts Updates SDK wrapper/interface to support listSessions(dir?).
extensions/copilot/src/extension/chatSessions/claude/CLAUDE_SESSION_USER_GUIDE.md Documents trust-gated git metadata/change detection in session list UI.
extensions/copilot/src/extension/chatSessions/claude/AGENTS.md Documents trust gating + concurrency behavior for metadata/changes enrichment.

Copilot's findings

Comments suppressed due to low confidence (2)

extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts:738

  • IWorkspaceService.isResourceTrusted takes a vscode.Uri, but URI.file(session.cwd) is the internal URI type. This should be converted to a vscode.Uri before calling isResourceTrusted (e.g., vscode.Uri.file(session.cwd) or vscode.Uri.from(...)) to avoid type errors and ensure the trust check works correctly.
		if (session.cwd) {
			const isTrusted = await this._workspaceService.isResourceTrusted(URI.file(session.cwd));
			if (isTrusted) {

extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts:775

  • cwdUri is an internal URI, but IWorkspaceService.isResourceTrusted is defined to take a vscode.Uri. Convert cwdUri to a vscode.Uri before checking trust (or adjust the workspace service API to accept the internal URI type consistently). This affects call sites that invoke _buildSessionMetadata(cwd) without passing isTrusted.
	private async _buildSessionMetadata(cwd: string, isTrusted?: boolean): Promise<SessionMetadata> {
		const cwdUri = URI.file(cwd);
		if (!(isTrusted ?? await this._workspaceService.isResourceTrusted(cwdUri))) {
			return { workingDirectoryPath: cwd };
		}
  • Files reviewed: 13/13 changed files
  • Comments generated: 2

@TylerLeonhardt TylerLeonhardt merged commit 8e8f5d8 into main Apr 23, 2026
30 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/disastrous-stingray branch April 23, 2026 22:05
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants