Skip to content

feat(github-copilot(GHE)): route models through advertised responses endpoint - #1707

Merged
Aaronontheweb merged 2 commits into
netclaw-dev:devfrom
Proxicon:feat/github-copilot-responses-api
Jul 28, 2026
Merged

feat(github-copilot(GHE)): route models through advertised responses endpoint#1707
Aaronontheweb merged 2 commits into
netclaw-dev:devfrom
Proxicon:feat/github-copilot-responses-api

Conversation

@Proxicon

Copy link
Copy Markdown
Contributor

Fixes #1706

Summary

GitHub Copilot currently routes every model through /chat/completions, including models whose authenticated /models metadata advertises only /responses.

This change adds provider-local endpoint capability discovery and selects the correct API:

  • /responsesResponsesClient
  • /chat/completions only → existing ChatClient
  • both → prefer /responses
  • neither → fail before inference

No 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.5
  • gpt-5.4-mini
  • gpt-5.3-codex
  • mai-code-1-flash-picker

For each model:

  • GHE token exchange returned HTTP 200
  • tenant /models discovery returned HTTP 200
  • inference completed successfully
  • unsupported_api_for_model was absent
  • fallback was not invoked

Existing gpt-5.4 compatibility remains intact.

Build validation

  • Full solution build: 30 succeeded, 0 failed
  • Linux x64 CLI and daemon publish: passed
  • Container build and deployment: passed
  • Published daemon SHA256 matched the daemon packaged in the container

Test evidence:
image

token exchange → HTTP 200
/models → HTTP 200
LLM streaming call completed
no failover

Live GHE validation evidence

Test environment:

  • GitHub Enterprise OAuth device authentication
  • Tenant-specific Copilot API host returned through endpoints.api
  • Fresh Linux x64 self-contained Netclaw daemon from commit 206fad03
  • Deployed container image digest: sha256:32c8484f1629fe4d5353cafa8b7d4f72e31ff1cc1d58b8c061196fed0ceca0f3
  • Published daemon and image-contained daemon SHA256: 14848BA5753D10AB6010C5D526199370D1BC27D2052DD3724A2EA0E93426323B

Before the fix

Main model Advertised endpoint Previous result
gpt-5.5 /responses HTTP 400 unsupported_api_for_model; incorrectly sent to /chat/completions; fallback invoked
gpt-5.4-mini /responses HTTP 400 unsupported_api_for_model; incorrectly sent to /chat/completions
gpt-5.3-codex /responses HTTP 400 unsupported_api_for_model; incorrectly sent to /chat/completions
mai-code-1-flash-picker Responses-capable model returned by authenticated discovery HTTP 400 unsupported_api_for_model; incorrectly sent to /chat/completions; fallback invoked

Representative failure:

model "gpt-5.5" is not accessible via the /chat/completions endpoint

After the fix

Main model Token exchange Authenticated /models Inference unsupported_api_for_model Fallback invoked Result
gpt-5.5 HTTP 200 HTTP 200 Completed; input 10,543 / output 19 No No PASS
gpt-5.4-mini HTTP 200 HTTP 200 Completed; input 10,551 / output 86 No No PASS
gpt-5.3-codex HTTP 200 HTTP 200 Completed; input 10,546 / output 23 No No PASS
mai-code-1-flash-picker HTTP 200 HTTP 200 Completed; input 10,553 / output 104 No No PASS

Sanitized log evidence

gpt-5.5:

Copilot token exchange: HTTP 200
GET https://copilot-api.<tenant>.ghe.com/models: HTTP 200
LLM streaming call completed in 2127ms (input: 10543, output: 19)
No unsupported_api_for_model error
No "failing over to next candidate" event

gpt-5.4-mini:

Copilot token exchange: HTTP 200
GET https://copilot-api.<tenant>.ghe.com/models: HTTP 200
LLM streaming call completed in 2285ms (input: 10551, output: 86)
No unsupported_api_for_model error
No "failing over to next candidate" event

gpt-5.3-codex:

Copilot token exchange: HTTP 200
GET https://copilot-api.<tenant>.ghe.com/models: HTTP 200
LLM streaming call completed in 3035ms (input: 10546, output: 23)
No unsupported_api_for_model error
No "failing over to next candidate" event

mai-code-1-flash-picker:

Copilot token exchange: HTTP 200
GET https://copilot-api.<tenant>.ghe.com/models: HTTP 200
LLM streaming call completed in 2884ms (input: 10553, output: 104)
No unsupported_api_for_model error
No "failing over to next candidate" event

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.

@Aaronontheweb Aaronontheweb added the providers Provider integrations and capability detection across OpenAI-compatible backends. label Jul 28, 2026

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb
Aaronontheweb merged commit a3817a6 into netclaw-dev:dev Jul 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

providers Provider integrations and capability detection across OpenAI-compatible backends.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(provider): GitHub Copilot routes Responses-only models through /chat/completions

2 participants