feat(github-copilot(GHE)): route models through advertised responses endpoint - #1707
Merged
Aaronontheweb merged 2 commits intoJul 28, 2026
Merged
Conversation
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.
Fixes #1706
Summary
GitHub Copilot currently routes every model through
/chat/completions, including models whose authenticated/modelsmetadata advertises only/responses.This change adds provider-local endpoint capability discovery and selects the correct API:
/responses→ResponsesClient/chat/completionsonly → existingChatClient/responsesNo model-name or version allowlists are used.
Scope
Changes are limited to the GitHub Copilot provider and focused tests.
This PR does not change shared model contracts, configuration, daemon startup, generic routing, retry/failover behavior, authentication, token exchange, or other providers.
Validation
Live validation against GitHub Enterprise Copilot passed:
gpt-5.5gpt-5.4-minigpt-5.3-codexmai-code-1-flash-pickerFor each model:
/modelsdiscovery returned HTTP 200unsupported_api_for_modelwas absentExisting
gpt-5.4compatibility remains intact.Build validation
Test evidence:

token exchange → HTTP 200
/models → HTTP 200
LLM streaming call completed
no failover
Live GHE validation evidence
Test environment:
endpoints.api206fad03sha256:32c8484f1629fe4d5353cafa8b7d4f72e31ff1cc1d58b8c061196fed0ceca0f314848BA5753D10AB6010C5D526199370D1BC27D2052DD3724A2EA0E93426323BBefore the fix
gpt-5.5/responsesunsupported_api_for_model; incorrectly sent to/chat/completions; fallback invokedgpt-5.4-mini/responsesunsupported_api_for_model; incorrectly sent to/chat/completionsgpt-5.3-codex/responsesunsupported_api_for_model; incorrectly sent to/chat/completionsmai-code-1-flash-pickerunsupported_api_for_model; incorrectly sent to/chat/completions; fallback invokedRepresentative failure:
After the fix
/modelsunsupported_api_for_modelgpt-5.5gpt-5.4-minigpt-5.3-codexmai-code-1-flash-pickerSanitized log evidence
gpt-5.5:gpt-5.4-mini:gpt-5.3-codex:mai-code-1-flash-picker:Result
The live GHE tests demonstrate that endpoint-capability discovery is active and that previously failing Responses-only models now complete inference without falling back to the known
/chat/completions-compatible GPT-5.4 model.