Skip to content

Permission approvals fail with "unexpected user permission response: approved" (recurrence of #1133; now reproduces for both shell and read kinds) #2347

Description

@hukovpet

Summary

Following up on #1133 (closed, fixed for kind: "shell"): a narrower recurrence
of the same underlying defect exists specifically for kind: "read" permission
requests (e.g. triggered by the built-in grep/search tool). An
onPermissionRequest callback that returns { kind: "approved" } is echoed
back correctly in the permission.completed event (result: { kind: "approved" }),
but the tool call still fails with the CLI's internal
permission orchestrator internal error: unexpected user permission response: approved.

kind: "shell" permissions work correctly on this same CLI version - this is
isolated to kind: "read".

Environment

  • OS: Windows 11, PowerShell
  • Node: v24.14.1
  • @github/copilot-sdk: 1.0.9
  • @github/copilot CLI: 1.0.80 (confirmed current via copilot update)
  • Models tested: claude-sonnet-5

Repro matrix

Permission kind Approval timing Result
shell near-instant ✅ pass
shell ~4s delay ✅ pass
read near-instant unexpected user permission response: approved
read ~4s delay unexpected user permission response: approved

Minimal reproduction

import { CopilotClient } from "@github/copilot-sdk";

const client = new CopilotClient({ logLevel: "info" });
await client.start();

const session = await client.createSession({
  model: "claude-sonnet-5",
  workingDirectory: process.cwd(),
  onPermissionRequest: () => ({ kind: "approved" }),
});

session.on((e) => {
  if (e.type === "permission.completed" || e.type === "tool.execution_complete") {
    console.log(e.type, JSON.stringify(e.data));
  }
});

// Prompts that make the model use the read/search tool (not a raw shell command).
await session.send("Use the grep/search tool to search for the pattern 'probe' in this directory.");

Observed event sequence

permission.requested  (kind: "read")
permission.completed  {"result":{"kind":"approved"}}
tool.execution_complete  success:false
  error: "Failed to request permission: Error: permission orchestrator internal
          error: unexpected user permission response: approved"

Expected

When onPermissionRequest returns { kind: "approved" } for a kind: "read"
request, the CLI should execute the read/search tool, exactly as it already
does for kind: "shell" on this same CLI version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions