Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/auth-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,17 @@ For GitHub Copilot catalog targets, the sidecar auto-selects appropriate `x-gith
| `/auto` | POST | `2026-08-01` | Copilot Auto inference endpoint |
| `/models/session` | POST | `2025-07-16` | Model session initialization |
| `/models/session/intent` | POST | `2025-07-16` | Model session intent parsing |
| `/models` | GET | `2026-07-01` | Model catalog listing (see below); applied for GitHub Copilot catalog targets when `COPILOT_GITHUB_TOKEN` is available, via a path separate from the POST method check |

**Key behaviors:**
- Auto-injection applies only to GitHub Copilot targets (`*.githubcopilot.com`); BYOK and non-Copilot targets are unaffected.
- If the request already includes an `x-github-api-version` header (case-insensitive), it is preserved and auto-injection is skipped.
- If the request already includes an `x-github-api-version` header (case-insensitive), it is preserved and auto-injection is skipped — this applies to the POST endpoints above (`getDefaultAutoApiVersion()` in `copilot.js`).
- POST requests to other endpoints do not receive auto-injected versions; callers must specify versions for other endpoints if needed.
- Non-POST requests never receive auto-injected versions.
- `/models` GET is handled by a separate, unconditional code path (`buildCopilotModelsRequest()` and the request-header hook in `copilot.js`), not by the POST-gated `getDefaultAutoApiVersion()` logic above — it always attaches `X-GitHub-Api-Version: 2026-07-01` for GitHub Copilot catalog targets.

### `/models` Endpoint (Special Case)

The `/models` endpoint prefers `COPILOT_GITHUB_TOKEN` (GitHub OAuth) over BYOK keys when both are configured, because model listing is a GitHub platform feature. However, when no GitHub token is available (typical for direct-BYOK/custom targets), `/models` will use the BYOK credential.
The `/models` endpoint prefers `COPILOT_GITHUB_TOKEN` (GitHub OAuth) over BYOK keys when both are configured, because model listing is a GitHub platform feature. However, when no GitHub token is available (typical for direct-BYOK/custom targets), `/models` will use the BYOK credential. For GitHub Copilot catalog targets, `/models` GET requests always receive `X-GitHub-Api-Version: 2026-07-01` (`COPILOT_MODELS_API_VERSION` in `copilot.js`), verified by `copilot-adapter-enterprise.test.js` and `copilot-byok.test.js`.

### BYOK (Bring Your Own Key)

Expand Down
Loading