Skip to content

Commit a10ffef

Browse files
CR fixes
1 parent 9e30e31 commit a10ffef

8 files changed

Lines changed: 15 additions & 14 deletions

File tree

docs/auth/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Use an OAuth GitHub App to authenticate users through your application and pass
110110
**How it works:**
111111
1. User authorizes your OAuth GitHub App
112112
2. Your app receives a user access token (`gho_` or `ghu_` prefix)
113-
3. Pass the token to the SDK via `githubToken` option
113+
3. Pass the token to the SDK via `gitHubToken` option
114114

115115
**SDK Configuration:**
116116

@@ -121,7 +121,7 @@ Use an OAuth GitHub App to authenticate users through your application and pass
121121
import { CopilotClient } from "@github/copilot-sdk";
122122

123123
const client = new CopilotClient({
124-
githubToken: userAccessToken, // Token from OAuth flow
124+
gitHubToken: userAccessToken, // Token from OAuth flow
125125
useLoggedInUser: false, // Don't use stored CLI credentials
126126
});
127127
```
@@ -299,7 +299,7 @@ BYOK allows you to use your own API keys from model providers like Azure AI Foun
299299

300300
When multiple authentication methods are available, the SDK uses them in this priority order:
301301

302-
1. **Explicit `githubToken`** - Token passed directly to SDK constructor
302+
1. **Explicit `gitHubToken`** - Token passed directly to SDK constructor
303303
2. **HMAC key** - `CAPI_HMAC_KEY` or `COPILOT_HMAC_KEY` environment variables
304304
3. **Direct API token** - `GITHUB_COPILOT_API_TOKEN` with `COPILOT_API_URL`
305305
4. **Environment variable tokens** - `COPILOT_GITHUB_TOKEN``GH_TOKEN``GITHUB_TOKEN`

docs/setup/backend-services.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Pass individual user tokens when creating sessions. See [GitHub OAuth](./github-
290290
app.post("/chat", authMiddleware, async (req, res) => {
291291
const client = new CopilotClient({
292292
cliUrl: "localhost:4321",
293-
githubToken: req.user.githubToken,
293+
gitHubToken: req.user.githubToken,
294294
useLoggedInUser: false,
295295
});
296296

docs/setup/github-oauth.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ sequenceDiagram
2626
GH-->>App: Access token (gho_xxx)
2727
2828
App->>SDK: Create client with token
29-
SDK->>CLI: Start with githubToken
29+
SDK->>CLI: Start with gitHubToken
3030
CLI->>API: Request (as user)
3131
API-->>CLI: Response
3232
CLI-->>SDK: Result
@@ -124,7 +124,7 @@ import { CopilotClient } from "@github/copilot-sdk";
124124
// Create a client for an authenticated user
125125
function createClientForUser(userToken: string): CopilotClient {
126126
return new CopilotClient({
127-
githubToken: userToken,
127+
gitHubToken: userToken,
128128
useLoggedInUser: false, // Don't fall back to CLI login
129129
});
130130
}
@@ -373,7 +373,7 @@ For GitHub Enterprise Managed Users, the flow is identical — EMU users authent
373373
// No special SDK configuration needed for EMU
374374
// Enterprise policies are enforced server-side by GitHub
375375
const client = new CopilotClient({
376-
githubToken: emuUserToken, // Works the same as regular tokens
376+
gitHubToken: emuUserToken, // Works the same as regular tokens
377377
useLoggedInUser: false,
378378
});
379379
```
@@ -438,7 +438,7 @@ const clients = new Map<string, CopilotClient>();
438438
function getClientForUser(userId: string, token: string): CopilotClient {
439439
if (!clients.has(userId)) {
440440
clients.set(userId, new CopilotClient({
441-
githubToken: token,
441+
gitHubToken: token,
442442
useLoggedInUser: false,
443443
}));
444444
}

docs/troubleshooting/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The Copilot SDK communicates with the CLI via JSON-RPC protocol. Features must b
5555
| Create workspace file | `session.rpc.workspace.createFile()` | Create file in workspace |
5656
| **Authentication** | | |
5757
| Get auth status | `getAuthStatus()` | Check login state |
58-
| Use token | `githubToken` option | Programmatic auth |
58+
| Use token | `gitHubToken` option | Programmatic auth |
5959
| **Connectivity** | | |
6060
| Ping | `client.ping()` | Health check with server timestamp |
6161
| Get server status | `client.getStatus()` | Protocol version and server info |

docs/troubleshooting/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ var client = new CopilotClient(new CopilotClientOptions
268268

269269
```typescript
270270
const client = new CopilotClient({
271-
githubToken: process.env.GITHUB_TOKEN,
271+
gitHubToken: process.env.GITHUB_TOKEN,
272272
});
273273
```
274274
</details>

nodejs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ new CopilotClient(options?: CopilotClientOptions)
8686
- `useStdio?: boolean` - Use stdio transport instead of TCP (default: true)
8787
- `logLevel?: string` - Log level (default: "info")
8888
- `autoStart?: boolean` - Auto-start server (default: true)
89-
- `githubToken?: string` - GitHub token for authentication. When provided, takes priority over other auth methods.
90-
- `useLoggedInUser?: boolean` - Whether to use logged-in user for authentication (default: true, but false when `githubToken` is provided). Cannot be used with `cliUrl`.
89+
- `gitHubToken?: string` - GitHub token for authentication. When provided, takes priority over other auth methods.
90+
- `useLoggedInUser?: boolean` - Whether to use logged-in user for authentication (default: true, but false when `gitHubToken` is provided). Cannot be used with `cliUrl`.
9191
- `telemetry?: TelemetryConfig` - OpenTelemetry configuration for the CLI process. Providing this object enables telemetry — no separate flag needed. See [Telemetry](#telemetry) below.
9292
- `onGetTraceContext?: TraceContextProvider` - Advanced: callback for linking your application's own OpenTelemetry spans into the same distributed trace as the CLI's spans. Not needed for normal telemetry collection. See [Telemetry](#telemetry) below.
9393

python/e2e/testharness/context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import shutil
1010
import tempfile
1111
from pathlib import Path
12+
from typing import Any
1213

1314
from copilot import CopilotClient
1415
from copilot.client import SubprocessConfig
@@ -145,7 +146,7 @@ def client(self) -> CopilotClient:
145146
raise RuntimeError("Context not set up. Call setup() first.")
146147
return self._client
147148

148-
async def set_copilot_user_by_token(self, token: str, response: dict) -> None:
149+
async def set_copilot_user_by_token(self, token: str, response: dict[str, Any]) -> None:
149150
"""Register a per-token response for the /copilot_internal/user endpoint."""
150151
if not self._proxy:
151152
raise RuntimeError("Proxy not started")

test/harness/replayingCapiProxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class ReplayingCapiProxy extends CapturingHttpProxy {
6060
* Per-token responses for `/copilot_internal/user` endpoint.
6161
* Key is the Bearer token (without "Bearer " prefix), value is the response body.
6262
* When a request arrives with `Authorization: Bearer <token>`, the matching response is returned.
63-
* If no match is found, a default response is returned.
63+
* If no match is found, a 401 Unauthorized response is returned.
6464
*/
6565
private copilotUserByToken = new Map<string, CopilotUserResponse>();
6666

0 commit comments

Comments
 (0)