[docs] auth: docs: correct /models GET auto API-version claim in auth-matrix - #8442
Merged
lpcox merged 2 commits intoSep 11, 2026
Merged
Conversation
…uth-matrix The auto-API-version table and key-behaviors bullets stated that only three POST endpoints (/auto, /models/session, /models/session/intent) receive an auto-injected X-GitHub-Api-Version header, and asserted 'non-POST requests never receive auto-injected versions.' This contradicts current-main containers/api-proxy/providers/copilot.js: buildCopilotModelsRequest() and the /models GET request-header path unconditionally attach X-GitHub-Api-Version: 2026-07-01 (COPILOT_MODELS_API_VERSION) for GitHub Copilot catalog targets, independent of the POST-gated getDefaultAutoApiVersion() logic. Verified by containers/api-proxy/copilot-adapter-enterprise.test.js and containers/api-proxy/copilot-byok.test.js. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The documentation incorrectly claims unconditional injection, although BYOK-only requests receive no version header.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates Copilot authentication documentation to describe /models GET API-version injection.
Changes:
- Adds
/modelsGET to the version table. - Documents its separate request-header path.
- References implementation tests.
File summaries
| File | Description |
|---|---|
docs/auth-matrix.md |
Documents /models API-version behavior. |
Review details
Suppressed comments (2)
docs/auth-matrix.md:204
- The implementation does not always attach this header for a catalog target:
getAuthHeaders()requires both a GET models path and a non-emptygithubToken, while BYOK-only mode is explicitly supported (copilot-byok.test.js:239-243). Without a GitHub token,getDefaultAutoApiVersion()returns no value for GET, so this blanket statement is false.
- `/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.
docs/auth-matrix.md:208
- This repeats the same unsupported guarantee for BYOK-only mode. On a default catalog target configured only with
COPILOT_PROVIDER_API_KEY,/modelsuses that key but does not receive the API-version header because the special branch requiresgithubToken; qualify the statement accordingly.
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`.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
✅ Copilot review passed with no inline comments. @github-actions[bot] Add the |
Contributor
Author
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit bc05f05 |
lpcox
deleted the
docs-auth-models-api-version-2026-09-11-23dbc77aa9b63d4e
branch
September 11, 2026 16:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git log --all), current-maindocs/auth-matrix.md,docs/authentication-architecture.md,docs/api-proxy-sidecar.md,docs/environment.md,docs/awf-config-spec.md,docs/github_actions.md,README.md; implementation incontainers/api-proxy/providers/copilot.js,containers/api-proxy/providers/copilot-auth.js,containers/api-proxy/providers/auth-headers.js,src/services/api-proxy-env-config.ts; and Jest testscopilot-adapter-enterprise.test.js,copilot-byok.test.js,copilot-auth.test.js. Also verified fix: isolate Actions OIDC from agent container #6894 and Ensure HTTP MCP GitHub OIDC bypasses the AWF agent credential boundary gh-aw#50053, both merged/resolved and already correctly documented acrossdocs/environment.md,docs/auth-matrix.md, anddocs/authentication-architecture.md— no changes needed there./modelsGET auto API-version behavior indocs/auth-matrix.md.Bearerfix, Extract shared auth-header builder for OpenAI and Copilot provider adapters #8226 auth-header-builder refactor) are already fully and correctly reflected indocs/auth-matrix.md; only the/modelsGET API-version gap below was stale.Documentation Changes
docs/auth-matrix.md— Auto API Version Injection section:/modelsGET row (X-GitHub-Api-Version: 2026-07-01) to the auto-version table; it was previously omitted even though the sidecar always sets this header for GitHub Copilot catalog targets./modelsGET behavior, and replaced it with an accurate description:/modelsGET is handled by a separate, unconditional code path (buildCopilotModelsRequest()and the request-header hook incopilot.js), distinct from the POST-gatedgetDefaultAutoApiVersion()logic that governs/auto,/models/session, and/models/session/intent./modelsEndpoint (Special Case)" section with the same corrected version-injection fact and the two Jest test files that assert it.Validation
main:containers/api-proxy/providers/copilot.js(buildCopilotModelsRequest(),getDefaultAutoApiVersion(),COPILOT_MODELS_API_VERSION = '2026-07-01', the/modelsGET request-header branch).containers/api-proxy/copilot-adapter-enterprise.test.js(assertsX-GitHub-Api-Version=2026-07-01on/modelsGET) andcontainers/api-proxy/copilot-byok.test.js(asserts the same version ongetModelsFetchConfig()and distinguishes it from the POST-gated/auto//models/sessioncases).markdownlint-cli2unavailable offline in this sandbox — package registry blocked network egress)."[docs] auth:"in the title via the GitHub MCP search — zero open matches, so this is not a duplicate.Sources
containers/api-proxy/providers/copilot.js,containers/api-proxy/copilot-adapter-enterprise.test.js,containers/api-proxy/copilot-byok.test.jsWarning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
msfeed25.pkgs.visualstudio.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.