Skip to content

Commit 6dba2c5

Browse files
joshspicerCopilot
andcommitted
Clarify Java managed approval handling
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 2f6d52e commit 6dba2c5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

java/src/main/java/com/github/copilot/rpc/PermissionHandler.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
* <pre>{@code
1919
* PermissionHandler handler = (request, invocation) -> {
2020
* if (Boolean.TRUE.equals(request.getManagedApprovalRequired())) {
21-
* return CompletableFuture.completedFuture(PermissionRequestResult.noResult());
21+
* // Obtain an explicit human decision before approving this request.
22+
* return requestHumanApproval(request);
2223
* }
2324
*
2425
* // Check the permission kind
@@ -33,6 +34,11 @@
3334
* .completedFuture(new PermissionRequestResult().setKind(PermissionRequestResultKind.APPROVED));
3435
* };
3536
* }</pre>
37+
* <p>
38+
* Event-based permission dispatch can use
39+
* {@link PermissionRequestResult#noResult()} to let another connected client
40+
* answer a pending request. Legacy protocol-v2 callbacks require a decision and
41+
* cannot abstain.
3642
*
3743
* <p>
3844
* A pre-built handler that approves all requests is available as

0 commit comments

Comments
 (0)