Skip to content

fix(sse): preserve Copilot discovered endpoint routing - #15337

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
zebrajaeger:fix/copilot-sse-endpoint-routing
Oct 6, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
zebrajaeger:fix/copilot-sse-endpoint-routing

Conversation

@zebrajaeger

Copy link
Copy Markdown
Contributor

Summary

  • Fixes incorrect endpoint selection for newly imported GitHub Copilot models that only support the Responses API. These models could previously fall back to /chat/completions and fail with 400 ... not accessible via the <path>.
  • Preserves advertised endpoints as supportedEndpoints and sets targetFormat: "openai-responses" for Responses-only models.
  • Normalizes endpoint paths for the existing synced-model schema and public model catalog.
  • Preserves existing routing for chat-capable models and the Claude/Gemini Responses-endpoint safeguards. No blanket GPT-version heuristic is introduced.

Related Issues

  • No linked issue.

Validation

Validation follows the
Contribution Golden Path:

  • Change type: provider / routing
  • Focused tests and category gates from the golden path
    • All four focused GitHub test suites pass: 42 tests total.
    • Additional provider category gates have not been run locally.
  • npm run lint
    • Targeted ESLint and Prettier checks for all changed files passed, along with the commit hooks.
  • Reconciled with the current active release base; focused checks rerun afterward
    • Based on release/v3.8.52. Focused tests passed again after local integration.
    • A fresh reconciliation with the current remote release base is still pending.
  • Production-code changes include a new or updated automated test in this PR
  • SonarQube is temporarily opt-in while the private project has no quota; it is not a PR gate.

Additional commands run:

  • npm run typecheck:core — passed.
  • npm run test:coverage — coverage thresholds met; exited with code 1 due to failures elsewhere in the full test run, including missing better-sqlite3 and failing Windows certificate stubs.
  • npm run test:vitest — MCP audit failures; these were also reproduced on the unchanged base branch.

Production build validation and full CI approval are pending.

Tests Added Or Updated

  • tests/unit/github-copilot-model-discovery.test.ts — updated:
    • Preservation and normalization of Responses-only endpoint metadata.
    • Nested endpoint declarations and deduplication.
    • Conservative behavior when metadata is incomplete.
  • tests/unit/github-copilot-discovered-routing.test.ts — added:
    • Discovery → synced-model persistence → runtime format resolution → GitHub executor URL.
    • Responses-only, chat-only, dual-endpoint, and metadata-free models.
    • Claude/Gemini safeguards and VS Code model-catalog compatibility.

The existing suites in github-copilot-custom-model-target-format.test.ts and executor-github.test.ts were also run successfully.

Coverage Notes

The production change is limited to
open-sse/services/githubCopilotModels.ts.

Report Statements Lines Functions Branches
Changed module 79.40% 79.40% 75.00% 80.00%
Overall report 80.80% 80.80% 82.97% 79.76%

All measured categories exceed the 60% minimum.
The full coverage gate is nevertheless not green because of the test failures noted above.

A before/after coverage comparison was not performed; no coverage improvement over the base is claimed.

Reviewer Notes

  • No database migrations, new dependencies, feature flags, or credential changes.
  • Previously imported GitHub models must be re-imported to populate the endpoint metadata that was formerly discarded.
  • Endpoint selection remains provider-scoped and metadata-driven.
  • Local OpenCode configuration changes are not included in this PR.

@diegosouzapw
diegosouzapw merged commit cee37af into diegosouzapw:release/v3.8.52 Oct 6, 2026
3 checks passed
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