Skip to content

fix: correct github-copilot model limits to match Copilot API#1246

Open
Nepomuceno wants to merge 1 commit intoanomalyco:devfrom
Nepomuceno:fix/github-copilot-model-limits
Open

fix: correct github-copilot model limits to match Copilot API#1246
Nepomuceno wants to merge 1 commit intoanomalyco:devfrom
Nepomuceno:fix/github-copilot-model-limits

Conversation

@Nepomuceno
Copy link

Summary

Corrects token limits for 6 models in the github-copilot provider to match the authoritative values from the Copilot API (GET https://api.githubcopilot.com/models).

This PR only fixes limits — no models are added or removed.

Changes

Model Field Before After (Copilot API) Delta
claude-haiku-4.5 context 144,000 200,000 +56,000
input 128,000 136,000 +8,000
output 32,000 64,000 +32,000
claude-opus-4.5 context 160,000 200,000 +40,000
input 128,000 168,000 +40,000
claude-opus-4.6 context 144,000 200,000 +56,000
input 128,000 168,000 +40,000
output 64,000 32,000 -32,000
claude-sonnet-4.5 context 144,000 200,000 +56,000
input 128,000 168,000 +40,000
claude-sonnet-4.6 input 128,000 168,000 +40,000
gpt-5.2 context 264,000 400,000 +136,000
input 128,000 272,000 +144,000
output 64,000 128,000 +64,000

How the correct values were verified

curl -s "https://api.githubcopilot.com/models" \
  -H "Authorization: Bearer $(gh auth token)" \
  -H "Copilot-Integration-Id: vscode-chat"

Each model in the response includes:

"limits": {
    "max_context_window_tokens": ...,   // → limit.context
    "max_prompt_tokens": ...,           // → limit.input
    "max_output_tokens": ...            // → limit.output
}

Impact

The under-reported limits cause tools like OpenCode to trigger context compaction 40K–136K tokens earlier than necessary, significantly degrading the user experience especially for Claude and GPT-5.2 models.

Fixes #858

Update token limits for 6 models in the github-copilot provider to
match the authoritative values from the Copilot API endpoint
(GET https://api.githubcopilot.com/models).

Models fixed:
- claude-haiku-4.5: ctx 144K→200K, input 128K→136K, output 32K→64K
- claude-opus-4.5: ctx 160K→200K, input 128K→168K
- claude-opus-4.6: ctx 144K→200K, input 128K→168K, output 64K→32K
- claude-sonnet-4.5: ctx 144K→200K, input 128K→168K
- claude-sonnet-4.6: input 128K→168K
- gpt-5.2: ctx 264K→400K, input 128K→272K, output 64K→128K

The under-reported limits cause tools like OpenCode to trigger context
compaction 40K-136K tokens earlier than necessary.

Fixes anomalyco#858
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.

GitHub Copilot Claude model limits are inaccurate — missing max_prompt_tokens and wrong context values

1 participant