豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Copilot CLI Plan exit approval#4315

Merged
DonJayamanne merged 2 commits intomainfrom
don/excess-yak
Mar 10, 2026
Merged

Copilot CLI Plan exit approval#4315
DonJayamanne merged 2 commits intomainfrom
don/excess-yak

Conversation

@DonJayamanne
Copy link
Copy Markdown
Collaborator

No description provided.

@DonJayamanne DonJayamanne self-assigned this Mar 10, 2026
@DonJayamanne DonJayamanne marked this pull request as ready for review March 10, 2026 04:58
Copilot AI review requested due to automatic review settings March 10, 2026 04:58
@DonJayamanne DonJayamanne enabled auto-merge March 10, 2026 04:58
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 10, 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

This PR updates the Copilot CLI chat session flow to handle plan-exit approval and permission prompts via core confirmation tools (through IToolsService) rather than via per-session permission handlers.

Changes:

  • Add handling for exit_plan_mode.requested in CopilotCLISession, showing a confirmation prompt and responding to the SDK with approval/denial.
  • Remove the old attachPermissionHandler wiring from the VS Code participant contribution and shift permission prompting to requestPermission(...) using IToolsService.
  • Update unit/e2e tests to validate confirmation-tool invocation and new session/command behaviors (e.g., /compact, yielding/steering).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/e2e/cli.stest.ts Introduces a test IToolsService to auto-approve confirmations and asserts confirmation invocations instead of session permission handlers.
src/extension/chatSessions/vscode-node/test/copilotCLIChatSessionParticipant.spec.ts Adds coverage for slash-command mapping and yielding behavior; adjusts mock clearing.
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts Removes participant-level permission handler attachment (permission prompting now handled in-session).
src/extension/chatSessions/copilotcli/node/test/copilotcliSession.spec.ts Updates permission-related tests to use FakeToolsService confirmation results; adds /compact and steering-after-failure tests.
src/extension/chatSessions/copilotcli/node/copilotcliSession.ts Implements exit-plan-mode approval via core confirmation tool; routes permission requests through requestPermission(...).
Comments suppressed due to low confidence (1)

src/extension/chatSessions/copilotcli/node/copilotcliSession.ts:343

  • invokeTool is called with CancellationToken.None in the exit_plan_mode.requested handler. Since this listener is registered inside handleRequestImpl, it has access to the request's token; using None prevents cancellation/timeout from propagating and can leave the confirmation UI hanging after the request is cancelled. Pass the active request token instead.
					const result = await this._toolsService.invokeTool(ToolName.CoreConfirmationTool, {
						input: params,
						toolInvocationToken: this._toolInvocationToken,
					}, CancellationToken.None);

Comment thread src/extension/chatSessions/copilotcli/node/copilotcliSession.ts
Comment thread test/e2e/cli.stest.ts
mjbvz
mjbvz previously approved these changes Mar 10, 2026
@DonJayamanne DonJayamanne added this pull request to the merge queue Mar 10, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 10, 2026
@DonJayamanne DonJayamanne added this pull request to the merge queue Mar 10, 2026
@DonJayamanne DonJayamanne removed this pull request from the merge queue due to a manual request Mar 10, 2026
@DonJayamanne DonJayamanne enabled auto-merge March 10, 2026 08:03
@DonJayamanne DonJayamanne disabled auto-merge March 10, 2026 09:03
@DonJayamanne DonJayamanne added this pull request to the merge queue Mar 10, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 10, 2026
@DonJayamanne DonJayamanne added this pull request to the merge queue Mar 10, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 10, 2026
@DonJayamanne DonJayamanne added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit de88a81 Mar 10, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the don/excess-yak branch March 10, 2026 11:31
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.

4 participants