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.
Summary
Following up on #1133 (closed, fixed for
kind: "shell"): a narrower recurrenceof the same underlying defect exists specifically for
kind: "read"permissionrequests (e.g. triggered by the built-in
grep/search tool). AnonPermissionRequestcallback that returns{ kind: "approved" }is echoedback correctly in the
permission.completedevent (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 isisolated to
kind: "read".Environment
@github/copilot-sdk: 1.0.9@github/copilotCLI: 1.0.80 (confirmed current viacopilot update)claude-sonnet-5Repro matrix
shellshellreadunexpected user permission response: approvedreadunexpected user permission response: approvedMinimal reproduction
Observed event sequence
Expected
When
onPermissionRequestreturns{ kind: "approved" }for akind: "read"request, the CLI should execute the read/search tool, exactly as it already
does for
kind: "shell"on this same CLI version.