Repository navigation
Update GitHub Copilot npm and permission handling - #313364
Conversation
…ove-once' instead of 'approved'
There was a problem hiding this comment.
Pull request overview
Updates the Copilot CLI integration to a newer @github/copilot SDK version and adjusts how Copilot CLI permission requests are approved, switching from persistent-style approvals (approved) to one-time approvals (approve-once).
Changes:
- Bump
@github/copilotfrom1.0.34to1.0.39. - Update permission handling and related tests to return/expect
{ kind: 'approve-once' }. - Adjust Copilot CLI E2E test setup to use real auth/token flow and simplify session/service scaffolding.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/test/e2e/cli.stest.ts | Refactors CLI E2E harness to use env-based GitHub OAuth token + public CAPI endpoint; simplifies mocks and stream assertions. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/test/copilotcliSession.spec.ts | Updates expectations for the new approve-once permission result kind. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/permissionHelpers.ts | Switches permission handlers to return approve-once and updates confirmation-tool approval result. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts | Forces SDK sessions to require permissions via setPermissionsRequired(true). |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSession.ts | Updates auto-approval and MC permission resolution to use approve-once. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotCli.ts | Prevents duplicate agents by tracking “known” agent source URIs. |
| extensions/copilot/package.json | Updates @github/copilot dependency spec to ^1.0.39. |
| extensions/copilot/package-lock.json | Locks @github/copilot (and platform packages) to 1.0.39. |
Copilot's findings
Files not reviewed (1)
- extensions/copilot/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
extensions/copilot/src/extension/chatSessions/copilotcli/node/permissionHelpers.ts:183
handleWritePermissionstill checksresult.kind === 'approved'before callingtrackEditIfNeeded, but confirmation now returns{ kind: 'approve-once' }. As a result, edits approved via the interactive confirmation path will no longer be tracked (only auto-approved edits are tracked). Update the condition to match the new approval kind (or handle both kinds if backward compatibility is needed).
const result = await invokeConfirmationTool(toolParams, toolParentCallId, toolsService, toolInvocationToken, logService, token);
if (result.kind === 'approved' && editFile) {
await trackEditIfNeeded(editTracker, toolCall, editFile, stream, logService);
}
return result;
- Files reviewed: 7/8 changed files
- Comments generated: 1
|
Copilot Fix the test failures in src/extension/chatSessions/copilotcli/node/test/permissionHelpers.spec.ts |
…fix conditional check Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/6e5d31b2-034c-4c94-8145-c6a5c7c9c81b Co-authored-by: DonJayamanne <[email protected]>
Fixed in 4414174. Two issues were causing the failures:
All 45 tests now pass locally. |
|
Copilot fix the test failures in |
... Fixed in 561b070. The new SDK version added |
Update the GitHub Copilot npm package version and modify permission handling to use 'approve-once' instead of 'approved' for better control over permission requests.