Update docs and changelogs for GitHub Copilot changes

This commit is contained in:
Mario Zechner 2025-12-15 20:08:06 +01:00
parent c5543f7586
commit 8df24b48ab
3 changed files with 12 additions and 6 deletions

View file

@ -1076,11 +1076,11 @@ const key = getApiKey('openai');
## GitHub Copilot
GitHub Copilot is available as a provider, but requires a special OAuth token that cannot be obtained with just a GitHub personal access token. The token exchange requires GitHub's device OAuth flow.
GitHub Copilot is available as a provider, requiring OAuth authentication via GitHub's device flow.
**Using with `@mariozechner/pi-coding-agent`**: The coding agent implements the full OAuth flow. Use `/login` and select "GitHub Copilot" to authenticate. The token is stored in `~/.pi/agent/oauth.json`.
**Using with `@mariozechner/pi-coding-agent`**: Use `/login` and select "GitHub Copilot" to authenticate. All models are automatically enabled after login. Token stored in `~/.pi/agent/oauth.json`.
**Using standalone**: If you have a valid Copilot OAuth token (e.g., from the coding agent's `oauth.json`), you can use it directly:
**Using standalone**: If you have a valid Copilot OAuth token (e.g., from the coding agent's `oauth.json`):
```typescript
import { getModel, complete } from '@mariozechner/pi-ai';
@ -1094,9 +1094,9 @@ const response = await complete(model, {
});
```
**Note**: The OAuth token expires and needs periodic refresh. The coding agent handles this automatically. For standalone usage, you would need to implement token refresh using the refresh token stored alongside the access token.
**Note**: OAuth tokens expire and need periodic refresh. The coding agent handles this automatically.
Some GitHub Copilot models require explicit enablement before use. If you get "The requested model is not supported" error, enable the model in VS Code: open Copilot Chat, click the model selector, select the model (marked with a warning icon), and click "Enable" to accept the terms.
If you get "The requested model is not supported" error, enable the model manually in VS Code: open Copilot Chat, click the model selector, select the model (warning icon), and click "Enable".
## License