Skip to content

Fix compilation errors from PermissionRequestResultKind enum-to-class refactor#21

Merged
edburns merged 3 commits intocopilot/sync-upstream-39-new-commitsfrom
copilot/fix-github-actions-workflow-failure
Mar 24, 2026
Merged

Fix compilation errors from PermissionRequestResultKind enum-to-class refactor#21
edburns merged 3 commits intocopilot/sync-upstream-39-new-commitsfrom
copilot/fix-github-actions-workflow-failure

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

PermissionRequestResultKind was 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:713 called PermissionRequestResultKind.valueOf(String) — only exists on enums
  • RpcHandlerDispatcher.java:196 called .name() on a PermissionRequestResultKind instance — only exists on enums

After 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

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • mvn spotless:apply has been run to format the code
  • mvn clean verify passes locally

Does this introduce a breaking change?

  • Yes
  • No

Original prompt

Fix the failing GitHub Actions workflow "Build & Test / Java SDK Tests (pull_request)".
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 68294676620
Job URL: /github/copilot-sdk-java/actions/runs/23471384285/job/68294676620?pr=20


💬 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.

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
Copilot AI requested a review from edburns March 24, 2026 03:22
@edburns edburns marked this pull request as ready for review March 24, 2026 18:32
Copilot AI review requested due to automatic review settings March 24, 2026 18:32
@edburns edburns merged commit 3da4948 into copilot/sync-upstream-39-new-commits Mar 24, 2026
2 checks passed
@edburns edburns deleted the copilot/fix-github-actions-workflow-failure branch March 24, 2026 18:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CopilotSession to construct PermissionRequestResultKind via its value-class constructor instead of using enum valueOf.
  • Update RpcHandlerDispatcher to compare against NO_RESULT using 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants