Github Copliot provider allows only 128k token conversations. #1531

Closed
opened 2026-02-16 17:31:25 -05:00 by yindo · 10 comments
Owner

Originally created by @Steinvorth on GitHub (Aug 29, 2025).

Originally assigned to: @thdxr on GitHub.

I have noticed that when using github copilot as my provider i get this error for prompt longer that 128k tokens. this seems weird, since i am using gemini 2.5 pro as my model, but conversations cannot be more than a few messages long because token limit is reached. is there a way to fix that?

Image
Originally created by @Steinvorth on GitHub (Aug 29, 2025). Originally assigned to: @thdxr on GitHub. I have noticed that when using github copilot as my provider i get this error for prompt longer that 128k tokens. this seems weird, since i am using gemini 2.5 pro as my model, but conversations cannot be more than a few messages long because token limit is reached. is there a way to fix that? <img width="836" height="63" alt="Image" src="https://github.com/user-attachments/assets/bc40a9a5-dcdd-4e35-90e4-a0dc505aea4b" />
yindo closed this issue 2026-02-16 17:31:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 29, 2025):

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

  • microsoft/vscode-copilot-release#1551: Similar token limit error with different models - shows how OpenCode handles token limit errors when context exceeds provider limits
  • microsoft/vscode-copilot#6117: Copilot models respond with Bad Request errors after chat - similar pattern of GitHub Copilot provider issues after conversation continues
  • microsoft/vscode-copilot-release#353: Copilot Gemini 2.5-pro authentication/compatibility issues - shows historical issues with Gemini models via GitHub Copilot provider

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 29, 2025): This issue might be a duplicate of existing issues. Please check: - microsoft/vscode-copilot-release#1551: Similar token limit error with different models - shows how OpenCode handles token limit errors when context exceeds provider limits - microsoft/vscode-copilot#6117: Copilot models respond with Bad Request errors after chat - similar pattern of GitHub Copilot provider issues after conversation continues - microsoft/vscode-copilot-release#353: Copilot Gemini 2.5-pro authentication/compatibility issues - shows historical issues with Gemini models via GitHub Copilot provider Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Aug 29, 2025):

I think we need to update models.dev to reflect this

@rekram1-node commented on GitHub (Aug 29, 2025): I think we need to update models.dev to reflect this
Author
Owner

@rekram1-node commented on GitHub (Aug 29, 2025):

Made issue on models.dev to track: https://github.com/sst/models.dev/issues/172

@rekram1-node commented on GitHub (Aug 29, 2025): Made issue on models.dev to track: https://github.com/sst/models.dev/issues/172
Author
Owner

@astrolox commented on GitHub (Aug 30, 2025):

I have encountered the same problem.

I don't see any options for configuring manually context limits, which surprised me. Does this exist?

@astrolox commented on GitHub (Aug 30, 2025): I have encountered the same problem. I don't see any options for configuring manually context limits, which surprised me. Does this exist?
Author
Owner

@rekram1-node commented on GitHub (Aug 30, 2025):

@astrolox there are options for this actually:

"provider": {
    "github-copilot": {
      "models": {
        "gemini-2.5-pro": {
          "limit": {
            "context": 128000,
            "output": 65536
          }
        }
      }
    }
  }

We will need to fix models.dev to accurately portray the limits but you can do this^ as a workaround, annoyingly github copilot doesn't exactly outline the limits for each model

@rekram1-node commented on GitHub (Aug 30, 2025): @astrolox there are options for this actually: ``` "provider": { "github-copilot": { "models": { "gemini-2.5-pro": { "limit": { "context": 128000, "output": 65536 } } } } } ``` We will need to fix models.dev to accurately portray the limits but you can do this^ as a workaround, annoyingly github copilot doesn't exactly outline the limits for each model
Author
Owner

@Steinvorth commented on GitHub (Sep 1, 2025):

Thanks for the help, and for the fast response I will implement this immediately! 💪

@Steinvorth commented on GitHub (Sep 1, 2025): Thanks for the help, and for the fast response I will implement this immediately! 💪
Author
Owner

@art-shen commented on GitHub (Sep 10, 2025):

Makes GitHub Copilot models effectively unusable 😿

@art-shen commented on GitHub (Sep 10, 2025): Makes GitHub Copilot models effectively unusable 😿
Author
Owner

@rekram1-node commented on GitHub (Sep 10, 2025):

@amal I made an issue on models.dev to update the models. if it doesn't have any open prs I will try to jump on that next sorry about delay on this I mentioned to team a few weeks ago

@rekram1-node commented on GitHub (Sep 10, 2025): @amal I made an issue on models.dev to update the models. if it doesn't have any open prs I will try to jump on that next sorry about delay on this I mentioned to team a few weeks ago
Author
Owner

@rekram1-node commented on GitHub (Sep 11, 2025):

I made a PR to models.dev and pinged team to review hopefully it gets shipped soon

@rekram1-node commented on GitHub (Sep 11, 2025): I made a PR to models.dev and pinged team to review hopefully it gets shipped soon
Author
Owner

@rekram1-node commented on GitHub (Sep 11, 2025):

Try restarting opencode or running:

rm ~/.cache/opencode/models.json

and it should be fixed

@rekram1-node commented on GitHub (Sep 11, 2025): Try restarting opencode or running: ``` rm ~/.cache/opencode/models.json ``` and it should be fixed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1531