Skip to content

Commit c9241f1

Browse files
Copilotedburns
andauthored
Address PR #122 review feedback: ensureProxyAlive, Javadoc constants, advanced.md table
Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/a4ec83e7-4677-4d1f-a323-5de8dbfa2ce2 Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
1 parent bab45d3 commit c9241f1

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/main/java/com/github/copilot/sdk/json/PermissionHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
* // Check the permission kind
2121
* if ("dangerous-action".equals(request.getKind())) {
2222
* // Deny dangerous actions
23-
* return CompletableFuture.completedFuture(new PermissionRequestResult().setKind("user-denied"));
23+
* return CompletableFuture
24+
* .completedFuture(new PermissionRequestResult().setKind(PermissionRequestResultKind.REJECTED));
2425
* }
2526
*
2627
* // Approve other requests
27-
* return CompletableFuture.completedFuture(new PermissionRequestResult().setKind("user-approved"));
28+
* return CompletableFuture
29+
* .completedFuture(new PermissionRequestResult().setKind(PermissionRequestResultKind.APPROVED));
2830
* };
2931
* }</pre>
3032
*

src/site/markdown/advanced.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,10 +753,10 @@ The `PermissionRequestResultKind` class provides well-known constants for common
753753

754754
| Constant | Value | Meaning |
755755
|---|---|---|
756-
| `PermissionRequestResultKind.APPROVED` | `"approved"` | The permission was approved |
757-
| `PermissionRequestResultKind.DENIED_BY_RULES` | `"denied-by-rules"` | Denied by policy rules |
758-
| `PermissionRequestResultKind.DENIED_COULD_NOT_REQUEST_FROM_USER` | `"denied-no-approval-rule-and-could-not-request-from-user"` | No rule and user could not be prompted |
759-
| `PermissionRequestResultKind.DENIED_INTERACTIVELY_BY_USER` | `"denied-interactively-by-user"` | User denied interactively |
756+
| `PermissionRequestResultKind.APPROVED` | `"approve-once"` | The permission was approved for this one instance |
757+
| `PermissionRequestResultKind.REJECTED` | `"reject"` | The permission was denied interactively by the user |
758+
| `PermissionRequestResultKind.USER_NOT_AVAILABLE` | `"user-not-available"` | Denied because user confirmation was unavailable |
759+
| `PermissionRequestResultKind.NO_RESULT` | `"no-result"` | No permission decision was made (protocol v3 only) |
760760

761761
You can also pass a raw string to `setKind(String)` for custom or extension values. Use
762762
[`PermissionHandler.APPROVE_ALL`](apidocs/com/github/copilot/sdk/json/PermissionHandler.html) to approve all

src/test/java/com/github/copilot/sdk/E2ETestContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ public CopilotClient createClient(CopilotClientOptions options) {
324324
*/
325325
public void setCopilotUserByToken(String token, String login, String copilotPlan, String apiUrl,
326326
String telemetryUrl, String analyticsTrackingId) throws IOException, InterruptedException {
327+
ensureProxyAlive();
327328
proxy.setCopilotUserByToken(token, login, copilotPlan, apiUrl, telemetryUrl, analyticsTrackingId);
328329
}
329330

0 commit comments

Comments
 (0)