diff --git a/CHANGELOG.md b/CHANGELOG.md index 76acaca..05a7a37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). ## [Unreleased] +### Added +- `:no-result` permission outcome — extensions can attach to sessions without actively answering permission requests by returning `{:kind :no-result}` from their `:on-permission-request` handler. On v3 protocol, the `handlePendingPermissionRequest` RPC is skipped; on v2, an error is propagated to the CLI (upstream PR #802). ## [0.1.32.0] - 2026-03-12 ### Added (upstream sync) diff --git a/doc/reference/API.md b/doc/reference/API.md index 246382a..673683c 100644 --- a/doc/reference/API.md +++ b/doc/reference/API.md @@ -1318,6 +1318,9 @@ fields like `:full-command-text`, `:commands`, and `:possible-paths`. ;; Deny after user interaction (optional feedback) {:kind :denied-interactively-by-user :feedback "Not allowed"} + +;; Extension declines to answer (another handler may respond) +{:kind :no-result} ``` #### `approve-all` diff --git a/src/github/copilot_sdk/client.clj b/src/github/copilot_sdk/client.clj index 633e217..2bf0aec 100644 --- a/src/github/copilot_sdk/client.clj +++ b/src/github/copilot_sdk/client.clj @@ -247,7 +247,9 @@ (defn- handle-v3-permission-requested! "Handle v3 permission.requested broadcast event. Calls the session's permission handler and responds via the - session.permissions.handlePendingPermissionRequest RPC method." + session.permissions.handlePendingPermissionRequest RPC method. + When the handler returns :no-result, the RPC call is skipped + so the extension does not answer this permission request." [client session-id event] (let [data (:data event) request-id (:request-id data) @@ -257,13 +259,15 @@ (try (let [perm-response (