Skip to content

[docs] auth: docs: correct /models GET auto API-version claim in auth-matrix - #8442

Merged
lpcox merged 2 commits into
mainfrom
docs-auth-models-api-version-2026-09-11-23dbc77aa9b63d4e
Sep 11, 2026
Merged

[docs] auth: docs: correct /models GET auto API-version claim in auth-matrix#8442
lpcox merged 2 commits into
mainfrom
docs-auth-models-api-version-2026-09-11-23dbc77aa9b63d4e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Documentation Changes

  • docs/auth-matrix.md — Auto API Version Injection section:
    • Added a /models GET 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.
    • Removed the incorrect blanket claim "Non-POST requests never receive auto-injected versions," which directly contradicted the /models GET behavior, and replaced it with an accurate description: /models GET is handled by a separate, unconditional code path (buildCopilotModelsRequest() and the request-header hook in copilot.js), distinct from the POST-gated getDefaultAutoApiVersion() logic that governs /auto, /models/session, and /models/session/intent.
    • Cross-referenced the existing "/models Endpoint (Special Case)" section with the same corrected version-injection fact and the two Jest test files that assert it.

Validation

  • Implementation checked against current main: containers/api-proxy/providers/copilot.js (buildCopilotModelsRequest(), getDefaultAutoApiVersion(), COPILOT_MODELS_API_VERSION = '2026-07-01', the /models GET request-header branch).
  • Tests checked: containers/api-proxy/copilot-adapter-enterprise.test.js (asserts X-GitHub-Api-Version = 2026-07-01 on /models GET) and containers/api-proxy/copilot-byok.test.js (asserts the same version on getModelsFetchConfig() and distinguishes it from the POST-gated /auto//models/session cases).
  • Markdown structure, table formatting, and relative references reviewed manually (markdownlint-cli2 unavailable offline in this sandbox — package registry blocked network egress).
  • Diff reviewed for token/key/JWT values and credential-bearing URLs: none present; only public endpoint paths, header names, and a public API version string were added.
  • Searched open PRs for "[docs] auth:" in the title via the GitHub MCP search — zero open matches, so this is not a duplicate.

Sources

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • msfeed25.pkgs.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "msfeed25.pkgs.visualstudio.com"

See Network Configuration for more information.

Generated by Auth Doctor Updater · copilot · auto · 126.7 AIC · ⊞ 10.7K ·

…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>
@github-actions github-actions Bot added ai-generated documentation Improvements or additions to documentation labels Sep 11, 2026
@lpcox
lpcox requested a balanced review from Copilot September 11, 2026 15:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 /models GET 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-empty githubToken, 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, /models uses that key but does not receive the API-version header because the special branch requires githubToken; 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.

Comment thread docs/auth-matrix.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Copilot review passed with no inline comments.

@github-actions[bot] Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor Author

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-8442 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit bc05f05

@lpcox
lpcox merged commit df6fb1c into main Sep 11, 2026
16 of 17 checks passed
@lpcox
lpcox deleted the docs-auth-models-api-version-2026-09-11-23dbc77aa9b63d4e branch September 11, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants