From 2166591a2a785513bf5190afba4777b266b6b85a Mon Sep 17 00:00:00 2001 From: Dmitriy Vasyura Date: Fri, 27 Nov 2026 00:20:21 -0800 Subject: [PATCH 1/2] Do not persist checkout credentials during Copilot setup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 08788cb934..8b358967be 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -24,6 +24,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 From 98881a836d9449bc919c3aaec645a896db71397b Mon Sep 17 00:00:00 2001 From: Dmitriy Vasyura Date: Fri, 27 Nov 2026 00:32:15 -0800 Subject: [PATCH 2/2] Support the renamed agent workspace API Read isAgentManaged from current VS Code hosts and preserve the agent window behavior on 1.148, which exposes the previous name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../vscode.proposed.agentSessionsWorkspace.d.ts | 12 ++++++++---- src/github/pullRequestOverview.ts | 4 ++-- src/github/utils.ts | 5 +++++ src/test/github/utils.test.ts | 13 ++++++++++++- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/@types/vscode.proposed.agentSessionsWorkspace.d.ts b/src/@types/vscode.proposed.agentSessionsWorkspace.d.ts index 278e4ccb7a..ebc1c4211d 100644 --- a/src/@types/vscode.proposed.agentSessionsWorkspace.d.ts +++ b/src/@types/vscode.proposed.agentSessionsWorkspace.d.ts @@ -8,11 +8,15 @@ declare module 'vscode' { export namespace workspace { /** - * Indicates whether the current workspace is an agent sessions workspace. + * Whether the editor manages the workspace for agent sessions, rather than the user + * opening it. A workspace that the user opened is not agent-managed, even when agents + * work in it. * - * Agent sessions workspace is a special workspace used for AI agent interactions - * where the window is dedicated to agent session management. + * The {@linkcode workspace.workspaceFolders workspace folders} of an agent-managed + * workspace follow the active agent session and can change when the user switches + * sessions. Sessions can span projects, so resources outside the current folders can + * still be part of the user's work. */ - export const isAgentSessionsWorkspace: boolean; + export const isAgentManaged: boolean; } } diff --git a/src/github/pullRequestOverview.ts b/src/github/pullRequestOverview.ts index 9f9d0e9534..8bac894cd8 100644 --- a/src/github/pullRequestOverview.ts +++ b/src/github/pullRequestOverview.ts @@ -46,7 +46,7 @@ import { branchPicks, pickEmail, reviewersQuickPick } from './quickPicks'; import type { RepositoriesManager } from './repositoriesManager'; import { addressCommentsInSession, fixChecksInSession } from './sessionPrompts'; import { getStackRecommendation, StackRecommendation } from './stackRecommendation'; -import { getIssueOrURLExpression, getPullRequestBranchLabels, parseIssueExpressionOutput, parseReviewers, processDiffLinks, processPermalinks } from './utils'; +import { getIssueOrURLExpression, getPullRequestBranchLabels, isAgentManagedWorkspace, parseIssueExpressionOutput, parseReviewers, processDiffLinks, processPermalinks } from './utils'; import { ApproveWorkflowRunsArgs, ApproveWorkflowRunsReply, CancelCodingAgentReply, ChangeBaseReply, ChangeReviewersReply, CreateRecommendedStackArgs, DeleteReviewResult, MergeArguments, MergeMethodMenuContext, MergeResult, PullRequest, PullRequestPreview, ReadyForReviewAndMergeContext, ReadyForReviewContext, ReviewCommentContext, ReviewType, SubmitReviewArgs, UnresolvedIdentity, UnstackAllResult, UpdateStackAutoMergeArgs } from './views'; import { debounce } from '../common/async'; import { COPILOT_ACCOUNTS, IComment } from '../common/comment'; @@ -692,7 +692,7 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel(EXPERIMENTAL_OVERVIEW_TABS, false), stack: initialStack, stackLoaded: false, diff --git a/src/github/utils.ts b/src/github/utils.ts index 8256f23536..8fbfb4cc74 100644 --- a/src/github/utils.ts +++ b/src/github/utils.ts @@ -2042,6 +2042,11 @@ export function isInCodespaces(): boolean { return vscode.env.remoteName === 'codespaces' && vscode.env.uiKind === vscode.UIKind.Web; } +export function isAgentManagedWorkspace(workspace: { isAgentManaged?: boolean; isAgentSessionsWorkspace?: boolean }): boolean { + // VS Code 1.148 exposes the previous name of the proposal. + return workspace.isAgentManaged ?? workspace.isAgentSessionsWorkspace ?? false; +} + export function generateGravatarUrl(gravatarId: string | undefined, size: number = 200): string | undefined { return !!gravatarId ? `https://www.gravatar.com/avatar/${gravatarId}?s=${size}&d=retro` : undefined; } diff --git a/src/test/github/utils.test.ts b/src/test/github/utils.test.ts index 5a492a97c7..1e1418b505 100644 --- a/src/test/github/utils.test.ts +++ b/src/test/github/utils.test.ts @@ -7,7 +7,7 @@ import { default as assert } from 'assert'; import * as vscode from 'vscode'; import { createSandbox, SinonSandbox } from 'sinon'; import { AccountType, isITeam, reviewerLabel } from '../../github/interface'; -import { getPRFetchQuery, getPullRequestBranchLabels, insertNewCommitsSinceReview, parseGraphQLIssue, parseGraphQLComment, parseCombinedTimelineEvents, sanitizeIssueTitle, variableSubstitution } from '../../github/utils'; +import { getPRFetchQuery, getPullRequestBranchLabels, insertNewCommitsSinceReview, isAgentManagedWorkspace, parseGraphQLIssue, parseGraphQLComment, parseCombinedTimelineEvents, sanitizeIssueTitle, variableSubstitution } from '../../github/utils'; import { IssueModel } from '../../github/issueModel'; import { GitHubRef } from '../../common/githubRef'; import { CommitEvent, EventType, ReviewEvent, TimelineEvent } from '../../common/timelineEvent'; @@ -16,6 +16,17 @@ import { GitHubRepository } from '../../github/githubRepository'; describe('utils', () => { + describe('isAgentManagedWorkspace', () => { + it('uses the current flag even when it is false', () => { + assert.strictEqual(isAgentManagedWorkspace({ isAgentManaged: true }), true); + assert.strictEqual(isAgentManagedWorkspace({ isAgentManaged: false, isAgentSessionsWorkspace: true }), false); + }); + + it('recognizes an agent workspace on VS Code 1.148', () => { + assert.strictEqual(isAgentManagedWorkspace({ isAgentSessionsWorkspace: true }), true); + }); + }); + describe('getPullRequestBranchLabels', () => { const sameOwner = { base: { owner: 'owner', ref: 'main' }, head: { owner: 'owner', ref: 'feature' } }; const fork = { base: { owner: 'owner', ref: 'main' }, head: { owner: 'contributor', ref: 'feature' } };