Skip to content

Commit 2f6d52e

Browse files
joshspicerCopilot
andcommitted
Align managed permission documentation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent c2c3abd commit 2f6d52e

5 files changed

Lines changed: 9 additions & 8 deletions

File tree

nodejs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ The handler must return one of the `PermissionDecision` shapes (or `{ kind: "no-
920920
| `"approve-permanently"` | Allow this request and persist the approval across sessions (currently used for URL domains) | `domain` (URL domain to approve) |
921921
| `"reject"` | Deny the request | `feedback?` (optional string surfaced to the agent) |
922922
| `"user-not-available"` | Deny the request because no user is available to confirm it ||
923-
| `"no-result"` | Leave the request unanswered (only valid with protocol v1; rejected by protocol v2 servers) | |
923+
| `"no-result"` | Suppress this SDK client's response so another connected client can answer the pending request ||
924924

925925
### Resuming Sessions
926926

python/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,8 @@ async def on_permission_request(
845845

846846
The handler returns a ``PermissionRequestResult``, which is an alias for
847847
``PermissionDecision | PermissionNoResult`` (the generated wire-level
848-
union of every decision variant, plus a small sentinel for v1 servers).
848+
union of every decision variant, plus a sentinel that suppresses this SDK
849+
client's response).
849850
Approval decisions are present-tense — they describe the decision to
850851
apply, not the past-tense outcome reported back on `permission.completed`
851852
session events.
@@ -855,7 +856,7 @@ session events.
855856
| `PermissionDecisionApproveOnce()` | Allow this single request |
856857
| `PermissionDecisionReject(feedback="…")` | Deny the request (optional feedback string forwarded to the LLM) |
857858
| `PermissionDecisionUserNotAvailable()` | Deny the request because no user is available to confirm it (the default) |
858-
| `PermissionNoResult()` | Leave the request unanswered (only valid with protocol v1; rejected by protocol v2 servers) |
859+
| `PermissionNoResult()` | Suppress this SDK client's response so another connected client can answer the pending request |
859860

860861
Several richer variants (``PermissionDecisionApproveForSession``,
861862
``PermissionDecisionApproveForLocation``, ``PermissionDecisionApprovePermanently``,

python/copilot/session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ class PermissionNoResult:
353353

354354
# The decision returned by a permission handler. Identical shape to the wire
355355
# ``PermissionDecision`` discriminated union, plus a :class:`PermissionNoResult`
356-
# sentinel for v1 servers. Construct via the generated variant classes:
356+
# sentinel that suppresses this SDK client's response. Construct via the
357+
# generated variant classes:
357358
# ``PermissionDecisionApproveOnce()``, ``PermissionDecisionReject(feedback=...)``,
358359
# etc. The ``kind`` discriminator is baked in as a ``ClassVar`` default by
359360
# codegen, so callers must not pass it.

rust/src/handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ pub trait AutoModeSwitchHandler: Send + Sync + 'static {
280280

281281
/// A [`PermissionHandler`] that approves requests when managed settings are disabled.
282282
///
283-
/// Requests that require managed approval remain pending for an explicit human
284-
/// decision.
283+
/// When managed settings are enabled, the handler logs an error and returns a
284+
/// user-not-available decision.
285285
#[derive(Debug, Clone)]
286286
pub struct ApproveAllHandler;
287287

rust/src/permission.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ use crate::types::{PermissionRequestData, RequestId, SessionId};
2323
/// are disabled.
2424
///
2525
/// When managed settings are enabled, the handler logs an error and returns a
26-
/// user-not-available decision. Requests that require managed approval remain
27-
/// pending for an explicit human decision.
26+
/// user-not-available decision.
2827
pub fn approve_all() -> Arc<dyn PermissionHandler> {
2928
Arc::new(PolicyHandler {
3029
policy: Policy::ApproveAll,

0 commit comments

Comments
 (0)