Skip to content

copilotcli: Enhance permission handling in Copilot CLI#310359

Merged
DonJayamanne merged 6 commits intomainfrom
don/fragile-kite
Apr 16, 2026
Merged

copilotcli: Enhance permission handling in Copilot CLI#310359
DonJayamanne merged 6 commits intomainfrom
don/fragile-kite

Conversation

@DonJayamanne
Copy link
Copy Markdown
Contributor

Improve permission handling by ensuring deferred repository hooks are loaded during session creation in the Copilot CLI. This change enhances the overall functionality and responsiveness of the CLI. Testing can be done by initiating sessions and verifying that the hooks are correctly loaded.

Copilot AI review requested due to automatic review settings April 16, 2026 00:54
@DonJayamanne DonJayamanne self-assigned this Apr 16, 2026
@DonJayamanne DonJayamanne reopened this Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Screenshot Changes

Base: f58e28cd Current: f4023132

Changed (13)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Dark
Before After
before after
agentSessionsViewer/CompletedRead/Dark
Before After
before after
agentSessionsViewer/CompletedRead/Light
Before After
before after
agentSessionsViewer/FailedWithDuration/Dark
Before After
before after
agentSessionsViewer/FailedWithDuration/Light
Before After
before after
agentSessionsViewer/WithDiffChanges/Dark
Before After
before after
agentSessionsViewer/WithDiffChanges/Light
Before After
before after
agentSessionsViewer/WithFileChangesList/Dark
Before After
before after
agentSessionsViewer/WithFileChangesList/Light
Before After
before after
agentSessionsViewer/CloudProvider/Dark
Before After
before after
agentSessionsViewer/CloudProvider/Light
Before After
before after
agentSessionsViewer/BackgroundProvider/Dark
Before After
before after
agentSessionsViewer/BackgroundProvider/Light
Before After
before after

blocks-ci screenshots changed

Replace the contents of test/componentFixtures/blocks-ci-screenshots.md with:

Updated blocks-ci-screenshots.md
<!-- auto-generated by CI — do not edit manually -->

#### editor/codeEditor/CodeEditor/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/cb32a3e854b5734fe5aaca2318f2e0a42ee821b05ea97883ea42c5ba95edb3c3)

#### editor/codeEditor/CodeEditor/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/42624fbba5e0db7f32c224b5eb9c5dd3b08245697ae2e7d2a88be0d7c287129b)

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 improves Copilot CLI session initialization and refactors permission handling by moving most permission-decision logic out of CopilotCLISession into dedicated helpers. It also ensures deferred repository hooks are loaded as part of session creation/get, which should make repo-related functionality available earlier in CLI sessions.

Changes:

  • Load deferred repository hooks during both session creation and session retrieval.
  • Refactor permission handling into dedicated handle*Permission functions and introduce pure builders for shell/MCP confirmation params.
  • Update unit tests to target the new pure builders and keep requiresFileEditconfirmation coverage.
Show a summary per file
File Description
extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts Loads deferred repo hooks during createSession and getSession.
extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSession.ts Replaces in-class permission handling with calls into permissionHelpers handlers.
extensions/copilot/src/extension/chatSessions/copilotcli/node/permissionHelpers.ts Adds handler functions for read/write/shell/mcp permissions and shared invocation logic.
extensions/copilot/src/extension/chatSessions/copilotcli/node/test/permissionHelpers.spec.ts Updates tests to cover new pure param builders; removes broader mapping tests.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 5

@DonJayamanne DonJayamanne marked this pull request as ready for review April 16, 2026 02:02
@DonJayamanne DonJayamanne enabled auto-merge (squash) April 16, 2026 02:09
@DonJayamanne DonJayamanne merged commit 1f63695 into main Apr 16, 2026
25 of 26 checks passed
@DonJayamanne DonJayamanne deleted the don/fragile-kite branch April 16, 2026 02:37
@vs-code-engineering vs-code-engineering bot added this to the 1.117.0 milestone Apr 16, 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