CC Switch v4.0.13

This release lets Claude Desktop, like Claude Code and Codex, choose among three modes at the top of the page: Direct, Routing and Aggregation. In Routing mode the model list follows the routed provider, and in Aggregation mode models from several providers can sit in Desktop's model list at the same time. Codex adds an "Auto Review model" setting, so third-party providers with automatic approval (Approve for me) turned on no longer fail with a 404 by requesting a model most relays don't have; in Aggregation mode you can also choose a separate model and reasoning effort for sub-agents. Switching back to Direct now asks for confirmation first, stating which provider the client will connect to and which file will change. Context windows for GPT-series models are now capped at 272K, so a window set too large no longer keeps the client from compacting until the upstream finally rejects the request. The update button in the Windows portable build now downloads the matching zip directly. The Claude Code Haiku tier can now declare a 1M context too, and presets whose models have a 1M window now have 1M checked by default. It also fixes Codex reporting "duplicate key" when saving its config, Codex remote compaction not working in Routing mode, mode switching hanging for several minutes with many fnm versions installed, and the window freezing on Windows 11, among other issues. For everything new in 4.0, see the v4.0 release notes.


New

Claude Desktop: choose Direct, Routing or Aggregation. Previously each Claude Desktop card decided on its own whether to connect directly or go through model mapping, and starting the mapping service was a separate switch. Desktop now uses the same mode panel as Claude Code, Codex, Gemini CLI and Grok Build, chosen at the top of the page:

Desktop only reads its config at startup, so every time you change the mode, the routed provider or the aggregation members, you need to restart Desktop for it to take effect, and the interface reminds you each time. Desktop's routing has no failover; when you quit CC Switch, Desktop's config stays as it is, so to keep using Routing or Aggregation, CC Switch needs to keep running. If you used a model mapping card before, you are moved into Routing mode automatically after upgrading; see the upgrade notes at the end.

Codex: automatic approval can use a different model. With automatic approval (Approve for me) on, Codex hands every sandbox escalation to an approval model to decide whether it may go ahead, and sends it to the same provider as the main conversation. Third-party cards used to have no way to choose this model: without a model list, Codex requested the official codex-auto-review from the provider, which most relays don't recognize, so it failed with a 404; with a model list, the main model did the approving itself (#8015, #5903, #3855).

Codex Aggregation mode: sub-agents can use their own model. Aggregation mode used to strip the sub-agent model from [agents], so sub-agents could only follow the main model (#8286). Now both the "Use Aggregation for Codex?" confirmation dialog and the new "Aggregation settings" let you choose the "Sub-agent model" and "Sub-agent reasoning effort". No Codex restart is needed; it takes effect in new conversations. If the chosen model is no longer in the aggregation (the member was removed, or that provider became the default), sub-agents temporarily follow the main model and switch back automatically once it is added again.

Claude Code: the Haiku tier can declare 1M too. In "Model Mapping", only the Sonnet, Opus, Fable and sub-agent rows used to offer "Declare 1M", because Haiku models never had a 1M window. Today the Haiku tier often points at a third-party model, and Claude Code treats any model name that does not start with claude- as a 200K window, so without the box it compacts early. Every row can now declare 1M. Routing mode is not affected: the Haiku alias used by routing already counts as 1M.

Presets: Added TokenFactory and Modelflare.

Windows portable build: the update button downloads the zip directly. The portable build already checked for updates at startup, but clicking "Update to vX" only opened the release page, leaving you to find the right zip among dozens of files (#8300). It now directly downloads the portable zip matching your architecture (x64 / ARM64); extract it and replace your existing cc-switch.exe. Settings and data live in .cc-switch under your user folder and are not lost when you replace the file. To avoid being blocked by antivirus software, CC Switch does not replace its own program files itself.

Improvements

Confirmation before switching back to Direct. Entering Routing or Aggregation already had a confirmation dialog, but switching back to Direct took effect the moment you clicked, with only an easy-to-miss "Undo" in the notice. Now the "Back to direct" button, "Back to direct and use" on cards, and the notice shown when the routing service stops all open a confirmation dialog first, stating which provider the client will connect to directly and in which file the address and key will be changed back; when leaving Routing it explains that the routing target, failover queue and settings are kept, and when leaving Aggregation it explains which models will disappear from /model. Errors are shown right in the dialog, and "Undo" is gone.

Codex: "Classic sub-agent tools in aggregation" is on by default. When the main agent and a sub-agent are on different providers, Codex's new sub-agent tools encrypt the task so that only the main agent's provider can read it, and the sub-agent never receives it (#8253). This switch moves from the Settings page into "Aggregation settings" and is now on by default.

GPT model context windows are capped at 272K. models.dev lists the GPT-5.6 and GPT-6 series with the OpenAI API's 1.05M window, but many relays forward through ChatGPT subscriptions, which are limited to 272K, and CC Switch can't tell from the address which kind it is. With the window set too large, the client never compacts until the upstream rejects the request and that turn fails outright; set too small, it merely compacts a little earlier. GPT windows auto-filled when adding a provider are now never larger than 272K, and the GPT windows in the Hermes, OpenClaw, OpenCode, Pi and Codex presets are lowered as well; the Claude Code "Codex" preset that uses a ChatGPT subscription goes from 372K to 272K. Windows smaller than 272K are unchanged.

Presets whose models have a 1M window now have 1M checked by default. Claude Code treats model names it does not recognize as a 200K window, and 23 presets for 1M models such as GLM-5.3, Kimi K3, DeepSeek V4, Qwen3.8, MiniMax-M3, MiMo and LongCat did not declare it, so in direct mode they started auto-compacting around 200K. The tiers that use a 1M model in these presets now have "Declare 1M" checked by default; Kimi For Coding deliberately keeps its 256K compaction window. In Claude Desktop, 12 presets for the same models and 50 presets that relay Claude Sonnet 5 and Opus 5 now declare 1M in the model list. Claude Haiku 4.x only has a 200K window and was mislabeled as 1M by some presets; that is corrected.

Fixes

Upgrade Notes

The database schema is unchanged, still at 20.


Thanks

Thanks to @HEOJUNFO (quoted provider table headers in Codex), @zqtqzy (Codex remote compaction in Routing mode), @xue-ding-e (ending Chat streams at [DONE]), @zhengkaics and @SailingLoong (OpenCode session duration), @Lingbou (usage from paged Codex branched conversations), @hulkbig (fnm path deduplication) and @funkpopo (Windows window freeze) for their contributions.

Thanks to @zhangchuanqiang-cloud, @SRQuan, @vvvss7992, @obsidian0215, @wangding0610, @XinwangTao, @RRRRSH, @YwaQ96, @Tison6, @haveqqq, @cc10143 and @KDB-Wind for reporting issues, providing reproduction details and suggesting fixes.

For the full technical details, see the CHANGELOG.