Fix compilation errors from PermissionRequestResultKind enum-to-class refactor#21
Merged
edburns merged 3 commits intocopilot/sync-upstream-39-new-commitsfrom Mar 24, 2026
Conversation
…onstructor/getValue Co-authored-by: edburns <75821+edburns@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/bd5aed59-ed6b-446f-b070-7f09633c74cd
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions workflow for Java SDK Tests
Fix compilation errors from PermissionRequestResultKind enum-to-class refactor
Mar 24, 2026
…github-actions-workflow-failure
3da4948
into
copilot/sync-upstream-39-new-commits
2 checks passed
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes compilation regressions caused by refactoring PermissionRequestResultKind from an enum to a value class by updating remaining enum-only call sites in the Java SDK’s permission handling flow.
Changes:
- Update
CopilotSessionto constructPermissionRequestResultKindvia its value-class constructor instead of using enumvalueOf. - Update
RpcHandlerDispatcherto compare againstNO_RESULTusing the value-class string value with case-insensitive semantics.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/java/com/github/copilot/sdk/CopilotSession.java | Replaces enum-style conversion with new PermissionRequestResultKind(result.getKind()) in permission handler execution. |
| src/main/java/com/github/copilot/sdk/RpcHandlerDispatcher.java | Replaces enum-style .name() comparison with a getValue()-based, case-insensitive comparison for NO_RESULT. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PermissionRequestResultKindwas refactored from a Java enum to a value class, but two call sites still used enum-only methods, breaking compilation.Before the change?
CopilotSession.java:713calledPermissionRequestResultKind.valueOf(String)— only exists on enumsRpcHandlerDispatcher.java:196called.name()on aPermissionRequestResultKindinstance — only exists on enumsAfter the change?
valueOf(result.getKind())→new PermissionRequestResultKind(result.getKind())NO_RESULT.name().equals(result.getKind())→NO_RESULT.getValue().equalsIgnoreCase(result.getKind())(preserves the class's case-insensitive comparison semantics)Pull request checklist
mvn spotless:applyhas been run to format the codemvn clean verifypasses locallyDoes this introduce a breaking change?
Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.