copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

I’m seeing a model entitlement mismatch in Copilot CLI.

Open LiShiPeng-666 opened this issue 8 months ago • 10 comments

Describe the bug

The same GitHub account can use Claude models in VS Code and on GitHub.com, but in Copilot CLI /model shows Claude models only under Upgrade with the message: “Your subscription does not include these models.”

Affected version

GitHub Copilot CLI 1.0.12

Steps to reproduce the behavior

 1. Open Copilot CLI 2. Run /model 3. Available only shows GPT models 4. Switch to Upgrade and Claude models appear there 5. --model claude-sonnet-4.5 returns: `Model "claude-sonnet-4.5" from --model flag is not available.

I reproduced this again after a fresh isolated login using a new config directory, so this does not appear to be caused by local cache or stale login state.

Expected behavior

Claude models should be available in Copilot CLI as they are for the same account in VS Code and on GitHub.com.

Additional context

 Environment:

  • GitHub Copilot CLI 1.0.12
  • Windows 11
  • Windows Terminal

LiShiPeng-666 avatar Mar 30 '26 02:03 LiShiPeng-666

I can reproduce the same entitlement mismatch on another Windows machine, and I have additional evidence that this is not caused by local cache or a stale login.

Additional reproduction details:

  • OS: Windows 11 / Windows Terminal
  • Same GitHub account is confirmed to have an active Copilot Pro+ subscription on GitHub.com
  • Reproduced on:
  • Re-authenticating with copilot login does not fix it
  • Reproducing with a completely clean config dir also does not fix it:
    • copilot login --config-dir C:\Users\Administrator\.copilot-isolated
    • copilot -p "reply with ok" --model claude-sonnet-4.5 --allow-all-tools -s --config-dir C:\Users\Administrator\.copilot-isolated
  • Using GH_TOKEN=(gh auth token) also reproduces, so it is not specific to the Copilot CLI stored credential path
  • In the exact same environment, gpt-5.4 works, while claude-sonnet-4.5 fails immediately with:
Error: Model "claude-sonnet-4.5" from --model flag is not available.

Relevant sanitized log excerpt from the clean config reproduction:

2026-04-01T20:16:50.563Z [DEBUG] ExP headers: ... github_copilotcli_copilotplan=individual_pro
2026-04-01T20:16:55.366Z [DEBUG] Successfully listed 13 models
2026-04-01T20:16:55.366Z [WARNING] Model 'claude-sonnet-4.5' from CLI argument is not available. Falling back to next option.
2026-04-01T20:16:55.367Z [ERROR] Model "claude-sonnet-4.5" from --model flag is not available.

This is the key mismatch: the account owner confirms Pro+ on GitHub.com, but the CLI session is being classified as individual_pro and only receives 13 models.

I also found an older diagnostic log on the same machine where the CLI had a 23-model /models response that included the Claude models, so this looks like a backend entitlement / model-catalog sync problem rather than a local configuration problem.

For reference, the older diagnostic log showed:

Using cached /models response for https://api.individual.githubcopilot.com (23 models)
Listed models: ... claude-sonnet-4.5 ... claude-opus-4.5 ... claude-haiku-4.5 ...

So from this machine we have now verified all of the following without resolving the issue:

  1. normal copilot login
  2. fully isolated --config-dir
  3. GH_TOKEN auth via gh auth token
  4. stable + older + prerelease CLI versions

This strongly suggests the problem is on the entitlement/model-routing side, not local state.

zbl1998-sdjn avatar Apr 01 '26 20:04 zbl1998-sdjn

I can reproduce the same entitlement mismatch on another Windows machine, and I have additional evidence that this is not caused by local cache or a stale login.

Additional reproduction details:

  • OS: Windows 11 / Windows Terminal
  • Same GitHub account is confirmed to have an active Copilot Pro+ subscription on GitHub.com
  • Reproduced on:
  • Re-authenticating with copilot login does not fix it
  • Reproducing with a completely clean config dir also does not fix it:
    • copilot login --config-dir C:\Users\Administrator\.copilot-isolated
    • copilot -p "reply with ok" --model claude-sonnet-4.5 --allow-all-tools -s --config-dir C:\Users\Administrator\.copilot-isolated
  • Using GH_TOKEN=(gh auth token) also reproduces, so it is not specific to the Copilot CLI stored credential path
  • I also tested a brand new fine-grained PAT with Copilot Requests permission:
    • copilot -p "reply with ok" --model gpt-5.4 --allow-all-tools -s -> ok
    • copilot -p "reply with ok" --model claude-sonnet-4.5 --allow-all-tools -s -> Error: Model "claude-sonnet-4.5" from --model flag is not available.
  • In the exact same environment, gpt-5.4 works, while claude-sonnet-4.5 fails immediately with:
Error: Model "claude-sonnet-4.5" from --model flag is not available.

Relevant sanitized log excerpt from the clean config reproduction:

2026-04-01T20:16:50.563Z [DEBUG] ExP headers: ... github_copilotcli_copilotplan=individual_pro
2026-04-01T20:16:55.366Z [DEBUG] Successfully listed 13 models
2026-04-01T20:16:55.366Z [WARNING] Model 'claude-sonnet-4.5' from CLI argument is not available. Falling back to next option.
2026-04-01T20:16:55.367Z [ERROR] Model "claude-sonnet-4.5" from --model flag is not available.

This is the key mismatch: the account owner confirms Pro+ on GitHub.com, but the CLI session is being classified as individual_pro and only receives 13 models.

I also found an older diagnostic log on the same machine where the CLI had a 23-model /models response that included the Claude models, so this looks like a backend entitlement / model-catalog sync problem rather than a local configuration problem.

For reference, the older diagnostic log showed:

Using cached /models response for https://api.individual.githubcopilot.com (23 models)
Listed models: ... claude-sonnet-4.5 ... claude-opus-4.5 ... claude-haiku-4.5 ...

So from this machine we have now verified all of the following without resolving the issue:

  1. normal copilot login
  2. fully isolated --config-dir
  3. GH_TOKEN auth via gh auth token
  4. a brand new fine-grained PAT with Copilot Requests
  5. stable + older + prerelease CLI versions

This strongly suggests the problem is on the entitlement/model-routing side, not local state.

zbl1998-sdjn avatar Apr 01 '26 21:04 zbl1998-sdjn

I ran into the same problem. Maybe it's related to Anthropic’s restrictions on users from China.

jarrettcccccc avatar Apr 14 '26 06:04 jarrettcccccc

不是的我已经完美解决了

zbl1998-sdjn avatar Apr 14 '26 06:04 zbl1998-sdjn

不是的我已经完美解决了

能分享一下解决方案吗

jarrettcccccc avatar Apr 14 '26 06:04 jarrettcccccc

可以的兄弟,请稍等。我总结一下

zbl1998-sdjn avatar Apr 14 '26 06:04 zbl1998-sdjn

  1. 复现与定位:写最小复现脚本,抓堆栈、打印中间张量 shape/值,加入断言定位出错层。
  2. 权重/格式修补:修正 gguf/ggml 转换脚本(QKV 顺序、转置、map 字段),补加量化 dequant 映射与 dtype cast 回退。
  3. 算子实现修正:调整 conv1d/linear 的 reshape/stride/transpose,修正 QKV split/permute 和 rotary embedding 的索引逻辑。
  4. 数值稳定性:统一 LayerNorm eps、在关键累加用 float32 或混合精度,避免 NaN/Inf。
  5. KV cache 与 mask:修正 cache 分配与 shape(order=batch,heads,seq,head_dim)、mask dtype/广播规则。
  6. Tokenizer 对齐:替换/同步 vocab/merges,增加 unknown/fallback 映射。
  7. 回归与验证:添加单元/端到端回归测试、CPU/GPU smoke test、性能监控样例。

zbl1998-sdjn avatar Apr 14 '26 06:04 zbl1998-sdjn

  1. 复现与定位:写最小复现脚本,抓堆栈、打印中间张量 shape/值,加入断言定位出错层。
  2. 权重/格式修补:修正 gguf/ggml 转换脚本(QKV 顺序、转置、map 字段),补加量化 dequant 映射与 dtype cast 回退。
  3. 算子实现修正:调整 conv1d/linear 的 reshape/stride/transpose,修正 QKV split/permute 和 rotary embedding 的索引逻辑。
  4. 数值稳定性:统一 LayerNorm eps、在关键累加用 float32 或混合精度,避免 NaN/Inf。
  5. KV cache 与 mask:修正 cache 分配与 shape(order=batch,heads,seq,head_dim)、mask dtype/广播规则。
  6. Tokenizer 对齐:替换/同步 vocab/merges,增加 unknown/fallback 映射。
  7. 回归与验证:添加单元/端到端回归测试、CPU/GPU smoke test、性能监控样例。

。。。不对吧

jarrettcccccc avatar Apr 14 '26 07:04 jarrettcccccc

我尝试过很多办法,这是我让copilot 给我总结他怎么干的,总体来说需要一个补丁来绕过一个什么机制,但是只对当前版本生效,还需要对这个补丁进行自适应升级,才能跟上版本有Claude系列模型显示。这是目前我发现最有用的

zbl1998-sdjn avatar Apr 14 '26 07:04 zbl1998-sdjn

在 Copilot CLI v1.0.36 上复现 —— 疑似基于 IP 地区的模型过滤

我遇到了类似问题,但定位到了更具体的原因:在中国大陆、不使用代理的情况下,Claude 模型完全不出现(连"升级"标签下也没有)。

  • 环境: Copilot CLI v1.0.36,Linux
  • 不挂代理(中国 IP): /model 只显示包含 GPT 在内的 7 个 GPT 模型,没有任何 Claude
  • 挂上 HTTPS 代理(非中国出口 IP): 所有 Claude 模型立即出现(Sonnet 4/4.5/4.6、Haiku 4.5、Opus 4.5/4.6)
  • 账号、配置、会话均未做任何变更,唯一差异是出口 IP

这说明 GitHub 后端可能根据客户端 IP 地区过滤可用模型,而非仅依据订阅/权限。来自中国大陆的请求似乎会被屏蔽 Claude 模型。

临时解决方案: 启动 copilot 前设置 HTTPS_PROXY 环境变量。

zhouqt avatar Apr 26 '26 03:04 zhouqt