CC Switch v4.0.7

The third fix release for 4.0 stable

Plus and Team workspaces under the same OpenAI account could not be switched between in 4.0; this release fixes that. Quotas can show "Used" again as in 3.x; switch it under "Settings → General → Appearance". Old Codex sessions can now be compressed from CC Switch, and session management and usage statistics can also read the compressed sessions. Switching between Direct and Routing now also prompts you to restart Codex, and this prompt shows up on Windows for the first time. This release also fixes several miscalculations in usage statistics, including the price of Claude's 1-hour cache writes and cache hits for some relay services. For everything new in 4.0, see the v4.0 release notes.


New

Old Codex sessions can be compressed. Codex records every session in full under ~/.codex/sessions, and with heavy use this directory can grow to tens of GB. Codex has its own compression feature that is still under development and off by default; this release adds a switch for it in CC Switch, and CC Switch can now read the compressed sessions.

Even without this switch, Codex's background service may compress sessions on its own. CC Switch used to recognize only uncompressed session files, so these sessions disappeared from the session list and their usage was not imported; they are now read normally.

Quotas can show "Used". 4.0 changed every quota tier to "x% left". Some people are used to the "x% used" of 3.x, and some want it to match how Codex itself words it, so it is now a setting. Under "Settings → General → Appearance → Quota display", choose "Left" (the default) or "Used"; provider cards, "Accounts" and the tray all follow it. Only the per-tier percentages change; balances, Codex Credits and reset counts always show what is left, and a tier that has run out still shows "Used up". Colors and the "almost out" warning are still based on what is left, so 94% used is orange just like 6% left. The length of the progress bar in the expanded view follows the number shown: 30% used draws 30%.

Switching between Direct and Routing also prompts you to restart Codex. A Codex that is already open keeps using the model list it read at startup. The check used to run only in Aggregation mode, so switching between Direct and Routing gave no prompt even when the model list changed. All three modes are now checked. If you dismiss the prompt and the model list changes again, the prompt comes back.

The prompt to restart Codex now shows up on Windows too. CC Switch used to tell whether Codex was running by reading the system process list, which does not work on Windows, so neither the model list prompt nor the account prompt appeared, and the restart button always said the background service was not running. On Windows, CC Switch now checks whether Codex's background service is running by the process ID the service records itself, and offers the restart button only when it is confirmed to be running. CC Switch cannot see the Codex desktop app or editor extensions on Windows, so whenever the model list or the signed-in account differs from when you last dismissed the prompt, it shows "Codex apps that were open before the switch may still use the previous account or model list"; if those clients are not open, just dismiss the prompt. This prompt does not appear right after upgrading.

Opening "Config directory" from the menu on an app page now scrolls the settings page to that app's entry, and its border flashes twice. Scrolling or clicking yourself during the scroll stops it right away; when reduced motion is turned on in the system, it jumps there directly.

Fixes

Other:

Upgrade Notes

The database schema is unchanged, still at 20.

Claude cache write costs go up after upgrading. With 1-hour caching (which Claude Code's main session usually uses), cache writes in new records are priced correctly, so daily costs will be noticeably higher than before the upgrade. They were undercounted before; this is not a price increase, and records from before the upgrade are not recalculated.

Costs for Claude Sonnet 5.5 and Haiku 5.5 that were recorded as 0 are recalculated at startup with the new prices. Haiku 5.5 is priced only at the rate for prompts up to 100K tokens, so longer prompts are undercounted.

Existing "火山 Agent Plan" providers (Pi, MiniMax Code) are not changed automatically; change /api/coding/v3 in the API address to /api/plan/v3, or delete them and add them again from the new preset.


Thanks

Thanks to @ggbdpq (cache hits showing as 0 for relay services, OpenCode extra option types being changed, the restart prompt after switching between Direct and Routing), @Chaoqi31 (reporting and fixing pricing for Claude's 1-hour cache writes and for cache writes in Codex session imports), @Yanxcyan (Claude Sonnet 5.5 / Haiku 5.5 pricing, the 火山 Agent Plan preset), @hulkbig (reporting and fixing OpenClaw custom request headers being deleted), @Railgun-wiki (reporting and fixing duplicate rows in usage statistics) and @funkpopo (scrolling the settings page to the app config entry) for their contributions.

Thanks to @yleo888, @harvey500, @friendlzw, @burningimlam, @JinLin-Yu, @winter-maple, @SamPheng, @cjmarklll, @LeenixP and @EMnian for reporting issues and making suggestions.

For the full technical details, see the CHANGELOG.