Skip to content

Commit c41594b

Browse files
joshspicerCopilot
andcommitted
Clarify permission failure diagnostics
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 0762739 commit c41594b

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

nodejs/src/session.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,11 @@ export class CopilotSession {
703703
if (this.disconnected) {
704704
return;
705705
}
706-
console.error("Permission handler failed", error);
706+
console.error("Permission handler failed", {
707+
sessionId: this.sessionId,
708+
requestId,
709+
error,
710+
});
707711
try {
708712
await this.rpc.permissions.handlePendingPermissionRequest({
709713
requestId,

python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ session events.
857857
| `PermissionDecisionApproveOnce()` | Allow this single request |
858858
| `PermissionDecisionReject(feedback="…")` | Deny the request (optional feedback string forwarded to the LLM) |
859859
| `PermissionDecisionUserNotAvailable()` | Deny the request because no user is available to confirm it (the default) |
860-
| `PermissionNoResult()` | Suppress this SDK client's response so another connected client can answer the pending request |
860+
| `PermissionNoResult()` | During event-based dispatch, suppress this SDK client's response so another connected client can answer the pending request; legacy direct callbacks cannot abstain |
861861

862862
Several richer variants (``PermissionDecisionApproveForSession``,
863863
``PermissionDecisionApproveForLocation``, ``PermissionDecisionApprovePermanently``,

python/copilot/session.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,11 @@ class SystemMessageCustomizeConfig(TypedDict, total=False):
342342

343343
@dataclass
344344
class PermissionNoResult:
345-
"""Sentinel returned by a permission handler to leave the request unanswered.
345+
"""Sentinel that leaves an event-dispatched permission request unanswered.
346346
347-
The SDK suppresses its response so another connected client, such as a
348-
human-facing host, can answer the pending request.
347+
During event-based permission dispatch, the SDK suppresses its response so
348+
another connected client, such as a human-facing host, can answer the pending
349+
request. Legacy direct callbacks require a concrete decision and cannot abstain.
349350
"""
350351

351352
kind: Literal["no-result"] = "no-result"

0 commit comments

Comments
 (0)