Skip to content

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode,DeepSeek Harness and more. Only official website: ccswitch.io

14.3 KB
Raw Blame

CC Switch v4.0.40

This release lets Grok Build's official cards be bound to xAI accounts on the Accounts page, so you can switch between several Grok accounts the same way as with Claude and Codex official cards. The Plugins page supports Antigravity CLI; the provider and model lists in usage statistics gain a cache hit rate; Xiaomi MiMo gets built-in balance and Token Plan quota queries; and account cards on the Accounts page follow the order and visibility of the sidebar apps.

This release also hardens the security checks for deep link MCP imports, usage scripts, SQL import and non-loopback listen addresses, and speeds up the database, local routing, usage sync, session search and the Apps page. Fixes also cover Kimi Code Desktop main-agent usage not being counted; Antigravity output speed being overstated since 4.0.38; Antigravity sessions from T3 Code and standalone ACP not showing up; empty replies from Mistral's official API with thinking on; Kimi native Responses returning 400 on every turn after parallel image-viewing tool calls; WorkBuddy enterprise accounts showing their credits as used up; xAI quota missing from the tray and official accounts shown there as site domains; duplicate skills in the Skills page's "Discover"; the Apps page waiting for version checks before showing installation status; and more.


New

Grok official cards bound to xAI accounts

The Grok Official form in Grok Build has a new "Sign-in method" (#9321, closes #8599): you can pick an xAI account from the Accounts page, "Add or manage xAI accounts", or "Follow Grok CLI sign-in", the same way as with Claude and Codex official cards.

  • Each bound account is a separate card whose name includes the account, and you can add as many as you like; the unbound card is still the original fixed card.
  • When you switch to a bound card, CC Switch first refreshes that account's login, then writes it into Grok CLI's ~/.grok/auth.json, leaving the rest of the file untouched. Nothing is written when Grok CLI is already signed in to that account; a temporary network failure asks you to try again later, and only an account that is actually invalid asks you to sign in again on the Accounts page.
  • Before each switch, the account Grok CLI is signed in to is saved to the Accounts page; switching back to the "Follow Grok CLI sign-in" card restores the account it had before the first switch.
  • When you delete an account on the Accounts page while Grok CLI is using the login CC Switch wrote for it, the original login is restored, or Grok CLI is signed out if the original account is gone too.
  • For bound cards, quota on the card, in usage and in the tray is all queried with that account. When Grok CLI's login has expired, unbound cards query quota with the Accounts page account for the same user instead.

Antigravity CLI plugins

The Plugins page supports Antigravity CLI (#9882, #9885). As with the other apps, it calls agy's own command line: you can browse plugins from the official and partner marketplaces in "Discover", and install, enable, disable, uninstall and update them.

  • Before updating, the version in the marketplace is checked first, and nothing is reinstalled when the plugin is already up to date.
  • When a plugin is in use by a running Antigravity session or background service, you are asked to close it and try again.
  • Plugins installed by the old Antigravity app live in numerically named folders that CC Switch can't update, so you are asked to uninstall them and reinstall from "Discover".

Usage statistics: cache hit rate per provider and model

The "Providers" and "Models" lists in usage statistics have a new "Hit Rate" column after Tokens, so you can see which provider or model is missing the cache. It is calculated the same way as the hit rate in the request log (cache hits ÷ cacheable input), and the rows' cache hits and cacheable input add up to the totals at the top; rows without cacheable input show "—".

Xiaomi MiMo balance and Token Plan quota

Xiaomi MiMo providers have two built-in official queries (closes #9404), so you no longer need a usage script that scrapes the console cookie:

  • Token Plan (keys starting with tp-): shows the used and total quota, and when the current period ends.
  • Balance (keys starting with sk-): shows the available balance (minus the frozen part); a zero balance is not treated as an invalid key.

Accounts page cards follow the sidebar apps

Account cards on the Accounts page follow the app order you drag on the Apps page. A card is hidden only when every app that uses its account is hidden (Copilot, ChatGPT and xAI accounts are also used by providers in Claude Code and other apps); the card a provider form jumps to is always shown.

New presets

Added StringAI.


Changes

  • Faster database and local routing (#9820, #9821): the main database now uses WAL mode; the config, routes, pricing and failover queues that routing reads on every request now come from a cache, and routing's database operations run on separate threads so they no longer tie up the threads handling requests. Forwarding a request copies the conversation one fewer time, and requests that weren't rewritten no longer go through the privacy filter a second time.
  • Faster usage sync (#9817, #9818): session logs of different apps are scanned in parallel; usage scripts run on a separate thread and no longer slow down other requests.
  • Faster session content search (#9827, #9896): one- and two-character searches no longer scan all text; when you keep typing, the previous search that hasn't finished is cancelled. The search index format changed, so the index is rebuilt on the first search after upgrading.
  • Faster Apps page (#9418, #9886, closes #9884): the "Installed" / "Not installed" groups are shown first from the install paths on this machine, without waiting for each tool's version check; all tools' versions are checked at the same time, and each one is shown as soon as it is done.

Security

  • Deep link MCP imports (#9831): the confirmation dialog shows every field of the MCP server (including the working directory, request headers and so on), with high-risk fields highlighted in red. Configs that read local environment variables, run helper commands, point the working directory at a network share, or use a URL that isn't http / https are rejected outright.
  • Usage scripts (#9829): requests sent by scripts no longer follow redirects, can't be sent to CC Switch's own routing port, and read at most 2 MiB of the response; the key, URL and other variables filled into a script are escaped correctly. The usage query URL in a deep link is checked too, and the confirmation dialog warns when it is a private or local address.
  • SQL import (#9832): when importing a SQL backup or a WebDAV / S3 sync snapshot, creating triggers and views is not allowed, files are capped at 512 MiB, and execution is stopped after 30 seconds.
  • Host check on non-loopback listen addresses (#9833): when the routing service listens on 0.0.0.0 / ::, requests from this machine must also pass the Host check that guards against DNS rebinding.

Fixes

  • Kimi Code Desktop main-agent usage wasn't counted (#9505, see #9498): Kimi Code Desktop 1.3.5 changed its session log format, so main-agent usage was skipped and subagent models showed as unknown. Both formats are now read without double counting; after upgrading, old logs are rescanned once to fill in the usage and models that were missed.
  • Antigravity output speed was overstated (#9858): since 4.0.38, requests with long thinking could show tens of thousands of tok/s. Antigravity's output tokens include hidden thinking and its first-token time includes the thinking time, so speed is computed over the full duration again.
  • Antigravity sessions from T3 Code and standalone ACP didn't show up (#9857, see #9838): these sessions now appear in the session list and usage statistics. They have no usable resume command and can't be deleted from CC Switch; the instructions T3 Code wraps around the prompt are removed, so the title shows the original prompt.
  • Mistral's official API returned empty replies with thinking on (see #9902): with thinking on, Mistral's official API (including the third-party models it serves) returns the reply split into thinking and text chunks, which local routing couldn't read, so the reply was empty or had no thinking. Both kinds of chunk are now read in order; requests sent upstream are unchanged.
  • Kimi native Responses kept returning 400 after parallel image viewing (#8825, see #7504): Codex Desktop inserts notices between the results of parallel tool calls, and strict native Responses upstreams such as Kimi drop results that don't directly follow their calls, so every later turn in that session returned 400. Now the batch's results are gathered together first, followed by the inserted notices.
  • WorkBuddy enterprise accounts showed their credits as used up (see #9694): enterprise accounts now query enterprise usage and show the total quota, amount used and expiry time; unlimited accounts show "Unlimited, N used", and when no quota comes back the query is reported as failed instead of showing "Used up (of 0)".
  • xAI quota was missing from the tray (see #9899): xAI OAuth providers in Codex and Claude Code (including Codex "Aggregation" members) now show quota in the tray from the bound xAI account, or from the default account on the Accounts page when unbound, matching the cards in the main window.
  • The tray showed site domains for official accounts (#9863): Codex official cards bound to a managed account, and Codex OAuth, GitHub Copilot and xAI OAuth cards, now show the signed-in account as the tray subtitle (a manual note takes precedence). xAI OAuth cards in the main window show the account too, and the tray updates after you sign in, switch the default account, delete an account or sign out on the Accounts page.
  • Duplicate skills appeared in the Skills page's "Discover": two skills in one repository whose last folder has the same name install into the same folder, and used to show as two rows in "Discover"; now only the one closest to the repository root is shown.
  • The CLI bundled with OpenCode Desktop was offered an npm upgrade (#9099): this CLI's install source is shown as OpenCode Desktop with a note that it updates with the Desktop app, and it is no longer included in "Update All"; separately installed OpenCode upgrades as usual.
  • Streaming events close to the 64 MiB limit were wrongly skipped (#9867): the buffer limit added in 4.0.39 is now checked per event, so a normal event close to the limit is no longer dropped along with the next event in the same chunk.

Upgrade notes

  • If the routing service listens on 0.0.0.0 / :: and you reach it from this machine with a custom hostname (one not ending in .local, .internal or .localhost), you will get 403 after upgrading; enter that hostname in "Connection address" under the "Local routing" settings (this address is also written into client configs). Other devices on the LAN, in WSL or in Docker are not affected.
  • The session content search index is rebuilt on the first search after upgrading, so that first search may be slower if you have many sessions.

Thanks

Thanks to @Owlbay (Grok official cards bound to xAI accounts), @funkpopo (Antigravity plugins, faster Apps page version checks, faster CI, routing Host check), @YUZHEthefool (security hardening, faster database and routing, faster usage sync, faster session search, tray account subtitles), @Chenning-Tao (Kimi Code Desktop usage), @ZhenWang-BIT (Antigravity output speed, T3 Code sessions), @Fansway (Kimi parallel tool calls), @teddyli18000 (OpenCode Desktop CLI upgrade), @wlndysky (Apps page cold start), @allenxu09 (tray account subtitles, review changes), @HaiYangBG1 (streaming buffer limit, code cleanup), @SaladDay (test and code cleanup) for their contributions.

Thanks to @yzw7489757, @Fonsi479, @spy123-1, @Xavier9896, @PorkneckRon, @wintervault, @cxhzzb for issue reports and reproduction details.

For the full technical details, see the CHANGELOG.