Skip to content

fix: GitHub Copilot Claude models have wrong context limits and missing thinking variants #20317

Closed as not planned

Description

@MoonFuji

Bug

GitHub Copilot Claude models report incorrect context window sizes and only expose a single thinking variant instead of adaptive effort levels.

Context window sizes are wrong

models.dev (the upstream data source opencode uses) has incorrect context and output values for several Claude models when accessed via the GitHub Copilot provider. For example:

Model models.dev says Correct (Anthropic docs)
claude-opus-4.6 context=144k, output=64k context=1M, output=128k
claude-sonnet-4.6 context=200k, output=32k context=1M, output=64k
claude-haiku-4.5 context=144k, output=32k context=200k, output=64k
claude-opus-4.5 context=160k, output=32k context=200k, output=32k
claude-sonnet-4.5 context=144k, output=32k context=200k, output=64k
claude-sonnet-4 context=216k, output=32k context=200k, output=16k
claude-opus-41 context=80k, output=32k context=200k, output=32k

Thinking variants are missing

The variants() function in transform.ts has a @ai-sdk/github-copilot case that returns only a single hardcoded thinking variant for Claude models. Direct Anthropic Claude models correctly expose low/medium/high/max adaptive effort levels — GitHub Copilot Claude models should too.

How to reproduce

  1. Configure opencode with a GitHub Copilot subscription
  2. Select any Claude model (e.g. claude-opus-4.6)
  3. Observe the reported context window is wrong (144k vs 1M)
  4. Observe only one thinking toggle is shown instead of low/medium/high/max

Expected behavior

  • Correct context/output limits per Anthropic's official documentation
  • Adaptive thinking variants (low/medium/high/max) for claude-opus-4.6 and claude-sonnet-4.6; high/max for other Claude models via Copilot

References

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 31, 2026
  2. github-actions commented on Mar 31, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. added a commit that references this issue on Mar 31, 2026
    65eedde
  4. mugnimaestra commented on Apr 1, 2026

    @mugnimaestra
    Contributor

    I believe that github copilot claude models have some custom adjustment for the context window (they don't have the 1M token window yet I guess?)

    but it's true that I saw that in copilot cli the reasoning effort are put in low/med/high now

    and turns out different account type of github copilot has different context window

    it needs to run opencode models --refresh to get the latest info from copilot API

    Image

    see anomalyco/models.dev#1136 (comment) for reference

  5. keith-pw commented on Apr 1, 2026

    @keith-pw

    Observing this same issue. I suppose we wont get 1M context but it should be whats shown in VS Code Copilot:

    Image
  6. IlyaMaksheev commented on Apr 3, 2026

    @IlyaMaksheev

    Any solution to that? I also experience that.

  7. keith-pw commented on Apr 4, 2026

    @keith-pw

    Looks like this now works as expected. Shows 200k context for Opus 4.6 for me.

    Note that the limits vary depending on your GHCP subscription - trial accounts for instance have a 144k context window for Opus 4.6.

    Opencode Desktop + GHCP Enterprise Pro plan:

    Image
  8. Mapleshade20 commented on Apr 8, 2026

    @Mapleshade20

    Copilot's context window size is smaller than Anthropic official. You can check it out in VSCode.

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions