-
Notifications
You must be signed in to change notification settings - Fork 985
Add no-result permission handling for extensions #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b0c1b8e
9ae7eac
42474eb
5e31212
f1681db
1cb363a
0938b0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -51,6 +51,8 @@ import ( | |||||
| "github.com/github/copilot-sdk/go/rpc" | ||||||
| ) | ||||||
|
|
||||||
| const noResultPermissionV2Error = "permission handlers cannot return 'no-result' when connected to a protocol v2 server" | ||||||
|
||||||
| const noResultPermissionV2Error = "permission handlers cannot return 'no-result' when connected to a protocol v2 server" | |
| const noResultPermissionV2Error = "Permission handlers cannot return 'no-result' when connected to a protocol v2 server." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ func TestPermissionRequestResultKind_Constants(t *testing.T) { | |
| {"DeniedByRules", PermissionRequestResultKindDeniedByRules, "denied-by-rules"}, | ||
| {"DeniedCouldNotRequestFromUser", PermissionRequestResultKindDeniedCouldNotRequestFromUser, "denied-no-approval-rule-and-could-not-request-from-user"}, | ||
| {"DeniedInteractivelyByUser", PermissionRequestResultKindDeniedInteractivelyByUser, "denied-interactively-by-user"}, | ||
| {"NoResult", PermissionRequestResultKind("no-result"), "no-result"}, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cross-SDK Consistency: Go is missing behavioral tests for the TypeScript has comprehensive tests:
Python has:
Suggestion: Add tests in Go to verify:
This ensures the behavior is tested and won't regress. |
||
| } | ||
|
|
||
| for _, tt := range tests { | ||
|
|
@@ -42,6 +43,7 @@ func TestPermissionRequestResult_JSONRoundTrip(t *testing.T) { | |
| {"DeniedByRules", PermissionRequestResultKindDeniedByRules}, | ||
| {"DeniedCouldNotRequestFromUser", PermissionRequestResultKindDeniedCouldNotRequestFromUser}, | ||
| {"DeniedInteractivelyByUser", PermissionRequestResultKindDeniedInteractivelyByUser}, | ||
| {"NoResult", PermissionRequestResultKind("no-result")}, | ||
| {"Custom", PermissionRequestResultKind("custom")}, | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cross-SDK Consistency: .NET is missing behavioral tests for the
no-resultpermission outcome.TypeScript has comprehensive tests:
test/client.test.ts: "does not respond to v3 permission requests when handler returns no-result"test/client.test.ts: "throws when a v2 permission handler returns no-result"Python has:
test_client.py: "test_v2_permission_adapter_rejects_no_result"Suggestion: Add tests to verify:
new PermissionRequestResultKind("no-result"),HandlePendingPermissionRequestAsyncis NOT calledno-result, it throwsInvalidOperationExceptionwith messageCopilotClient.NoResultPermissionV2ErrorMessageExample test structure: