mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-06-16 13:34:04 +08:00
084857ce25
Claude Desktop appends a local [1m] marker to the model name when the 1M-context beta is active (e.g. claude-opus-4-8[1m]). The proxy route matcher compared this raw name against clean route IDs, so every match tier failed and the is_claude_safe_model_id guard also blocked the role keyword fallback, surfacing as route_unknown (HTTP 400) when switching to a 1M-capable model mid-conversation. Strip the [1m] suffix inside map_proxy_request_model before lookup so exact/alias/legacy/role matching all see the clean ID, while keeping the original name in the route_unknown error for diagnostics. The upstream request still carries the mapped real model; 1M capability is negotiated via the anthropic-beta header, not the model-name suffix. Fixes #3588
084857ce25
·
2026-06-04 11:40:16 +08:00
History