fix(permissions): use 'approve-once' for Copilot CLI v1.0.54+ contract#1192
Open
bradygaster wants to merge 1 commit into
Open
fix(permissions): use 'approve-once' for Copilot CLI v1.0.54+ contract#1192bradygaster wants to merge 1 commit into
bradygaster wants to merge 1 commit into
Conversation
The Copilot CLI post-v1.0.54 changed the permission handler contract to expect 'approve-once' instead of 'approved'. Update the handler, type definition, and error hint to match the new contract. Closes #1191 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Squad’s permission approval behavior to match the Copilot CLI v1.0.54+ onPermissionRequest contract so tool access is no longer silently blocked.
Changes:
- Extends
SquadPermissionRequestResult.kindto include"approve-once"while keeping"approved"for backward compatibility. - Updates the CLI shell’s default permission handler to return
{ kind: "approve-once" }. - Updates the SDK session-creation error hint to recommend
{ kind: "approve-once" }.
Show a summary per file
| File | Description |
|---|---|
| packages/squad-sdk/src/adapter/types.ts | Adds "approve-once" to the permission result kind union type. |
| packages/squad-sdk/src/adapter/client.ts | Updates the guidance string to reference "approve-once" for approval. |
| packages/squad-cli/src/cli/shell/index.ts | Changes the CLI’s approveAllPermissions handler to return "approve-once". |
| .changeset/fix-permission-contract.md | Adds a patch changeset for both SDK and CLI reflecting the contract fix. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1191 — squad-cli cannot access tools due to Copilot CLI (post-v1.0.54) permission contract change.
Problem
The Copilot CLI v1.0.54+ changed the
onPermissionRequesthandler contract. It now expects{ kind: 'approve-once' }instead of the deprecated{ kind: 'approved' }. The old value is silently ignored, blocking all tool access.Changes
packages/squad-sdk/src/adapter/types.ts— Added'approve-once'to theSquadPermissionRequestResult.kindunion type (kept'approved'for backward compat)packages/squad-cli/src/cli/shell/index.ts— UpdatedapproveAllPermissionshandler to return'approve-once'packages/squad-sdk/src/adapter/client.ts— Updated error message hint to reference'approve-once'Testing
tsc --noEmitpasses)cc @tamirnavot @jonlester for review