Skip to content

fix(permissions): use 'approve-once' for Copilot CLI v1.0.54+ contract#1192

Open
bradygaster wants to merge 1 commit into
devfrom
squad/1191-fix-cli-permission-contract
Open

fix(permissions): use 'approve-once' for Copilot CLI v1.0.54+ contract#1192
bradygaster wants to merge 1 commit into
devfrom
squad/1191-fix-cli-permission-contract

Conversation

@bradygaster
Copy link
Copy Markdown
Owner

@bradygaster bradygaster commented May 29, 2026

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 onPermissionRequest handler 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 the SquadPermissionRequestResult.kind union type (kept 'approved' for backward compat)
  • packages/squad-cli/src/cli/shell/index.ts — Updated approveAllPermissions handler to return 'approve-once'
  • packages/squad-sdk/src/adapter/client.ts — Updated error message hint to reference 'approve-once'

Testing

  • SDK type-checks clean (tsc --noEmit passes)
  • CLI shell file type-checks clean against updated SDK dist
  • No test files reference the old value

cc @tamirnavot @jonlester for review

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>
Copilot AI review requested due to automatic review settings May 29, 2026 21:02
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

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.kind to 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

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.

[bug] squad-cli cannot access tools due to Copilot CLI (post-v1.0.54) permission contract change

2 participants