Skip to content

[FEATURE]: Request GitHub Copilot auto model routing API access + chat.model plugin hook #20235

Closed as not planned

Description

@fastdrumr

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Request GitHub to grant opencode access to the Copilot auto model routing API (/models/session).

VS Code's Copilot extension has a server-side auto model selection feature that uses ML to classify prompt complexity and route to the best model. The API endpoints are:

  • POST /models/session — creates an auto-mode session, returns available models and a session token
  • POST /models/session/intent — per-turn routing, returns ranked candidate models based on prompt analysis

This API is currently restricted to first-party OAuth clients (VS Code's client ID). When opencode's client ID (Ov23li8tweQw6odWQebz) calls these endpoints, it gets a 404.

Why this matters:

What's needed:
The opencode team already has an official partnership with GitHub for Copilot support. Requesting access to the /models/session and /models/session/intent endpoints for opencode's OAuth client ID would enable native auto model selection matching VS Code's experience.

Additionally, a chat.model plugin hook would allow the community to implement model routing as external plugins regardless of API access. Proposed signature:

"chat.model": async (incoming: {
  sessionID: string
  agent: string
  model: Provider.Model
  provider: Provider.Info
  message: MessageV2.User
}, output: {
  model: Provider.Model
}) => void

This would enable auto model selection, cost-based routing, A/B testing, and fallback chains as external plugins.

Activity

  1. changed the title [-][FEATURE]: Add chat.model plugin hook for dynamic model selection[/-] [+][FEATURE]: Request GitHub Copilot auto model routing API access + chat.model plugin hook[/+] on Mar 31, 2026
  2. pljones commented on Apr 4, 2026

    @pljones

    I'd expect this to be beneficial to the provider, too -- reducing unnecessary load on expensive models, so long as the "Auto" pre-filter load isn't overly expensive and the ML review is accurate.

    Ideally, this would be available to free tier users, too, for the same reason.

  3. mathomp4 commented on Apr 21, 2026

    @mathomp4

    @fastdrumr Thanks for adding and looking at this. I'd love to use GitHub Copilot "Auto" with Opencode. Indeed, that's one main reason I've been testing copilot-cli since they added it there, but I just like Opencode more!

  4. tarizer commented on Apr 26, 2026

    @tarizer

    This is more important now that GitHub copilot has a weekly limit that can only be bypassed by using auto mode.

  5. notcooler commented on Apr 26, 2026

    @notcooler

    Is this added or not

  6. Johannbr commented on Apr 27, 2026

    @Johannbr

    This is more important now that GitHub copilot has a weekly limit that can only be bypassed by using automation.

    Yes, this feature is getting important when using Github Copilot provider, because of the weekly limit.

  7. Thijmen commented on Jun 3, 2026

    @Thijmen

    @thdxr Is the project open to receive a PR that enables this?

  8. m0wer commented on Jun 11, 2026

    @m0wer

    Here's a (temporary) alternative: #25239 (comment)

  9. github-actions commented on Aug 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  10. mu88 commented on Aug 31, 2026

    @mu88

    this is still an issue, please reopen

  11. SebbeJohansson commented on Aug 31, 2026

    @SebbeJohansson

    +1 on reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions