Files
CLIProxyAPIPlus/internal
kunish 578c312660 fix(copilot): lower static Claude context limits and expose them to Claude Code
The Copilot API enforces per-account prompt token limits (128K individual,
168K business) that are lower than the total context window (200K). When
the dynamic /models API fetch fails or returns no capabilities.limits,
the static fallback of 200K exceeds the real enforced limit, causing
intermittent "prompt token count exceeds the limit" errors.

Two complementary fixes:

1. Lower static Copilot Claude model ContextLength from 200000 to 128000
   (the conservative default matching defaultCopilotContextLength). Dynamic
   API limits override this when available.

2. Add context_length and max_completion_tokens to Claude-format model
   responses so Claude Code CLI can learn the actual Copilot limit instead
   of relying on its built-in 1M context configuration.
2026-04-08 17:02:53 +08:00
..
2026-04-07 18:23:31 +08:00
2026-04-04 11:40:03 +08:00
2026-04-04 11:40:03 +08:00
2026-04-02 21:31:21 +08:00
2026-04-07 18:23:31 +08:00
2026-04-02 10:35:13 +08:00
2026-03-25 10:14:14 +08:00
2026-04-02 21:31:21 +08:00