fix(permissions): use 'approve-once' for Copilot CLI v1.0.54+ contract#1192
fix(permissions): use 'approve-once' for Copilot CLI v1.0.54+ contract#1192bradygaster wants to merge 2 commits 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>
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
|
@bradygaster 2 suggestions after reviewing:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@tamirdresher - did any of @jonlester's contributions fail to make it into that superceded pr? just making sure we got all my old boss' ideas. :) |
|
@bradygaster — your old boss''s instincts were good, but neither suggestion made it into #1200. What did land: your original The The Both are worth doing. I''ll open two follow-up issues and tag you and @jonlester — Jon can claim one if he wants to follow through on his own suggestions. |
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