Commit e8b1c58
committed
fix(copilot): map hyphen-style Claude model names to dot-style upstream IDs
Clients (Claude Code, Cursor, etc.) request Claude models with hyphen-only
IDs like 'claude-haiku-4-5', but GitHub Copilot publishes them with dots
(e.g. 'claude-haiku-4.5'). Without alias mapping, requests fail with:
502 unknown provider for model claude-haiku-4-5
Three additions:
1. internal/config/oauth_model_alias_defaults.go (new): static defaults
mapping dot IDs to hyphen aliases for the 6 known Claude Copilot
models, plus GitHubCopilotAliasesFromModels() helper for dynamic
alias generation from fetched model lists.
2. internal/config/config.go SanitizeOAuthModelAlias: inject the
github-copilot defaults if the user has not configured any
github-copilot aliases. Runs before the existing dedup pass.
3. sdk/cliproxy/auth/oauth_model_alias.go OAuthModelAliasChannel: add
'github-copilot' to the list of channels where aliases are honored.
Previously fell to the default branch and aliases were ignored.
Origin: ported from the archived CLIProxyAPIPlus fork's
internal/config/oauth_model_alias_defaults.go (Kiro defaults skipped).1 parent d376402 commit e8b1c58
3 files changed
Lines changed: 62 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
833 | | - | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
834 | 853 | | |
835 | 854 | | |
836 | 855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| |||
0 commit comments