Summary
We consume Copilot programmatically via @github/copilot-sdk. The SDK declares @github/copilot as a dependency with a non-pinned range, so a fresh install pulls the latest CLI — currently 1.0.35. With CLI 1.0.35, the very first shell tool invocation fails with unexpected user permission response, even though our onPermissionRequest callback returns { kind: 'approved' }.
Forcing the CLI back to @github/copilot@1.0.34 (with the same SDK version) makes the problem disappear, so the regression appears to be CLI-side. Because most SDK consumers won't pin the transitive CLI version, anyone doing a clean install today picks up the broken combination by default.
Environment
- OS: Windows 11, PowerShell
- Node: 25.8.1
- Consumer: Node app using
@github/copilot-sdk (no direct CLI usage)
- Models tested:
gpt-5-mini (and others)
Repro matrix
In each case, only @github/copilot-sdk was added as a direct dependency; the CLI was either left to install transitively or explicitly pinned to confirm the cause.
@github/copilot-sdk |
@github/copilot (transitive) |
Result |
| 0.2.0 |
1.0.34 (pinned) |
✅ pass |
| 0.2.2 |
1.0.34 (pinned) |
✅ pass |
| 0.2.2 |
1.0.35 (latest, default) |
❌ unexpected user permission response |
| 0.3.0-preview.0 |
1.0.35 (latest, default) |
❌ unexpected user permission response |
The SDK version is not the determining factor — the CLI version is.
Minimal reproduction (SDK only)
import { CopilotClient } from '@github/copilot-sdk';
const client = new CopilotClient({ logLevel: 'info' });
await client.start();
const session = await client.createSession({
model: 'gpt-5-mini',
workingDirectory: process.cwd(),
onPermissionRequest: () => ({ kind: 'approved' }),
});
session.on('event', (e) => {
if (e.type === 'tool.execution_complete' && e.error) {
console.log('error:', e.error);
}
});
await session.sendAndWait(
"Run one shell command: `echo permission-probe`. Do not ask follow-up questions."
);
await client.stop();
Observed event sequence with the SDK + transitively installed CLI 1.0.35:
tool.execution_start: powershell (call_xxx)
tool.execution_complete error: unexpected user permission response
With the CLI pinned to 1.0.34 (same SDK code, same callback), the tool runs to completion.
Expected
When an SDK consumer's onPermissionRequest returns { kind: 'approved' }, the CLI should execute the requested tool.
Actual
The CLI rejects the SDK's approval payload with unexpected user permission response, failing the tool call on the very first attempt.
Workaround
SDK consumers must explicitly pin @github/copilot@1.0.34 alongside the SDK. Without an explicit pin, fresh installs pick up the broken CLI version.
Summary
We consume Copilot programmatically via
@github/copilot-sdk. The SDK declares@github/copilotas a dependency with a non-pinned range, so a fresh install pulls the latest CLI — currently1.0.35. With CLI1.0.35, the very first shell tool invocation fails withunexpected user permission response, even though ouronPermissionRequestcallback returns{ kind: 'approved' }.Forcing the CLI back to
@github/copilot@1.0.34(with the same SDK version) makes the problem disappear, so the regression appears to be CLI-side. Because most SDK consumers won't pin the transitive CLI version, anyone doing a clean install today picks up the broken combination by default.Environment
@github/copilot-sdk(no direct CLI usage)gpt-5-mini(and others)Repro matrix
In each case, only
@github/copilot-sdkwas added as a direct dependency; the CLI was either left to install transitively or explicitly pinned to confirm the cause.@github/copilot-sdk@github/copilot(transitive)unexpected user permission responseunexpected user permission responseThe SDK version is not the determining factor — the CLI version is.
Minimal reproduction (SDK only)
Observed event sequence with the SDK + transitively installed CLI 1.0.35:
With the CLI pinned to 1.0.34 (same SDK code, same callback), the tool runs to completion.
Expected
When an SDK consumer's
onPermissionRequestreturns{ kind: 'approved' }, the CLI should execute the requested tool.Actual
The CLI rejects the SDK's approval payload with
unexpected user permission response, failing the tool call on the very first attempt.Workaround
SDK consumers must explicitly pin
@github/copilot@1.0.34alongside the SDK. Without an explicit pin, fresh installs pick up the broken CLI version.