Skip to content

Commit 806a67f

Browse files
committed
Fix syntax for onPermissionRequest parameter in createSession method calls
1 parent 24623f6 commit 806a67f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/guides/setup/bundled-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const client = new CopilotClient({
7272
cliPath: path.join(__dirname, "vendor", "copilot"),
7373
});
7474

75-
const session = await client.createSession({ model: "gpt-4.1" }, onPermissionRequest: async () => ({ kind: "approved" }),);
75+
const session = await client.createSession({ model: "gpt-4.1", onPermissionRequest: async () => ({ kind: "approved" }) });
7676
const response = await session.sendAndWait({ prompt: "Hello!" });
7777
console.log(response?.data.content);
7878

docs/guides/setup/local-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The default configuration requires no options at all:
3737
import { CopilotClient } from "@github/copilot-sdk";
3838

3939
const client = new CopilotClient();
40-
const session = await client.createSession({ model: "gpt-4.1" }, onPermissionRequest: async () => ({ kind: "approved" }),);
40+
const session = await client.createSession({ model: "gpt-4.1", onPermissionRequest: async () => ({ kind: "approved" }) });
4141

4242
const response = await session.sendAndWait({ prompt: "Hello!" });
4343
console.log(response?.data.content);

nodejs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ By default, sessions use **infinite sessions** which automatically manage contex
446446

447447
```typescript
448448
// Default: infinite sessions enabled with default thresholds
449-
const session = await client.createSession({ model: "gpt-5" }, onPermissionRequest: async () => ({ kind: "approved" }) );
449+
const session = await client.createSession({ model: "gpt-5", onPermissionRequest: async () => ({ kind: "approved" }) });
450450

451451
// Access the workspace path for checkpoints and files
452452
console.log(session.workspacePath);
@@ -479,7 +479,7 @@ When enabled, sessions emit compaction events:
479479
### Multiple Sessions
480480

481481
```typescript
482-
const session1 = await client.createSession({ model: "gpt-5" }, onPermissionRequest: async () => ({ kind: "approved" }) );
482+
const session1 = await client.createSession({ model: "gpt-5", onPermissionRequest: async () => ({ kind: "approved" }) });
483483
const session2 = await client.createSession({ model: "claude-sonnet-4.5", onPermissionRequest: async () => ({ kind: "approved" }) });
484484

485485
// Both sessions are independent

0 commit comments

Comments
 (0)