Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: allow Copilot BYOK passthrough - #28723

Open
ssncferreira wants to merge 3 commits into
mainfrom
fix/aibridge-copilot-byok-passthrough
Open

fix: allow Copilot BYOK passthrough#28723
ssncferreira wants to merge 3 commits into
mainfrom
fix/aibridge-copilot-byok-passthrough

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

Copilot is always BYOK, so requests use the end user's provider credential rather than a shared centralized credential. Restricting Copilot passthrough to an explicit route allowlist does not provide the same security benefit as it does for centralized providers and causes new Copilot endpoints to fail until they are added manually.

Allow all non-bridged Copilot routes to pass through to the configured upstream. More specific bridged inference routes continue to take precedence.

Changes

  • Replace the Copilot passthrough allowlist with a catch-all route.
  • Clarify that providers using centralized credentials should restrict passthrough routes to known-safe operations.
  • Cover known and unknown Copilot passthrough routes.
  • Verify bridged routes take precedence over the passthrough catch-all.

Related to #28494
Related to internal Slack thread.

Note

Generated by Coder Agents on behalf of @ssncferreira.

@ssncferreira
ssncferreira force-pushed the fix/aibridge-copilot-byok-passthrough branch 3 times, most recently from 656486f to f8ee136 Compare September 11, 2026 15:45
@ssncferreira
ssncferreira force-pushed the fix/aibridge-copilot-byok-passthrough branch from f8ee136 to a3ab87f Compare September 11, 2026 15:58
@ssncferreira
ssncferreira marked this pull request as ready for review September 11, 2026 15:59
@coderagents

coderagents Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/ai-gateway/reference.md - The GitHub Copilot section lists a passthrough allowlist (/models(/*), /agents/*, /mcp/*, /.well-known/*) and states "Any route that is not listed above returns 404." With the catch-all passthrough, these listed routes are no longer exhaustive and the 404 claim no longer applies. Update both the list and the "not listed → 404" line to match the new behavior (all non-bridged routes now pass through).

  • docs/ai-coder/ai-gateway/reference.md - This was addressed. The Copilot passthrough section now states that all Copilot routes other than the intercepted ones pass through to the configured upstream, and the stale "not listed → 404" claim is gone. Confirmed accurate against aibridge/provider/copilot.go (PassthroughRoutes() returns the catch-all "/") and the diff. A prior iteration added concrete examples (/models, /_ping, /auto, /agents/*, /mcp/*, /.well-known/*) plus an "AI Gateway authentication is still required" line; this iteration removed both. The catch-all sentence is complete and accurate on its own, so removing the examples creates no gap.

Note

Evidence: searched docs/ for the old literals /_ping, /copilot/auto, /auto, /models(, /agents/, /mcp/, well-known, and passthrough. No page outside docs/reference/ enumerates these Copilot routes, so reference.md was the sole consumer of the allowlist and no stale copy of the old fact persists elsewhere. The providers.md/auth.md conceptual pages describe BYOK semantics but do not enumerate routes, so they need no change.


Automated review via Coder Agents

#doc-check

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@ssncferreira ssncferreira changed the title fix(aibridge): allow Copilot BYOK passthrough fix: allow Copilot BYOK passthrough Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants