Skip to content

[BUG]: 0.3.0-java.2: permission.completed cannot deserialize approve-once in PermissionCompletedKind #126

Description

@bytehaufen

What happened?

I ran into what looks like an internal enum mismatch in copilot-sdk-java:0.3.0-java.2.

After updating only the Java SDK version, tool calls started failing during permission handling.

What happens

The SDK sends the new permission result kind approve-once, but later fails when deserializing the corresponding permission.completed event because com.github.copilot.sdk.generated.PermissionCompletedKind does not recognize that value.

This leads to errors like:

Error: Unhandled permission result kind: [object Object]

Environment

  • copilot-sdk-java:0.3.0-java.2
  • CLI version unchanged from the previously working setup
  • Java app running inside Eclipse RCP / OSGi

Reproduction

  1. Update to copilot-sdk-java:0.3.0-java.2
  2. Use the normal permission approval flow, for example PermissionHandler.APPROVE_ALL
  3. Trigger a tool call that requires permission
  4. Observe the permission flow fail when the permission.completed event is processed

Expected behavior

The SDK should consistently handle the new permission result kinds end-to-end.

If PermissionRequestResultKind.APPROVED now maps to approve-once, then PermissionCompletedKind should also accept approve-once.

Actual behavior

The request side uses the new value:

PermissionRequestResultKind.APPROVED = "approve-once"

but the generated event enum still only accepts old values such as:

  • approved
  • approved-for-session
  • approved-for-location

and rejects approve-once.

Temporary workaround

For now, I can avoid the failure by not using PermissionHandler.APPROVE_ALL and instead returning the legacy value manually:

.setOnPermissionRequest((_, _) ->
    CompletableFuture.completedFuture(
        new PermissionRequestResult()
            .setKind(new PermissionRequestResultKind("approved"))
    )
)

That keeps the flow working on my side.

Versions

copilot-sdk-java:0.3.0-java.2

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions