mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-25 17:22:27 +08:00
docs(release): add v4.0.7 release notes
This commit is contained in:
1 parent
fda103e9b1
commit
790ed8009d
4 files changed
+207
No files matched your search
@@ -0,0 +1,58 @@
|
||||
# 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](https://github.com/farion1231/cc-switch/blob/main/docs/release-notes/v4.0.4-en.md).
|
||||
|
||||
---
|
||||
|
||||
## New
|
||||
|
||||
**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%.
|
||||
|
||||
**Old Codex sessions can be compressed.** Codex has a feature still under development that compresses session files untouched for more than 7 days; compressed files take about one sixth of the original space, and Codex decompresses them automatically when you continue those sessions. Turn on "Compress old Codex sessions" under "Settings → App config → Codex", and the current size of the session directory is shown next to it. The switch edits Codex's `config.toml` directly, needs a recent version of Codex, and takes effect after Codex restarts; once it is on, Codex shows a notice about under-development features every time it starts. Codex's background service may also compress sessions on its own, whether or not this switch is on. CC Switch used to recognize only uncompressed session files, so compressed sessions disappeared from the session list and their usage was not imported. Session management, usage statistics and session history migration can now all read compressed sessions; the list just does not show a preview of their last reply.
|
||||
|
||||
**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
|
||||
|
||||
- **Plus and Team workspaces under the same OpenAI account could not be switched between in Codex.** 4.0 identified Codex's official sign-in by user only, so a different workspace of the same person was treated as "already signed in to this account": `auth.json` was not rewritten and no restart prompt appeared. Stashed sign-in information was also kept per user, so the several workspaces of one person ended up as a single copy. Sign-ins are now identified by "user + workspace", the same way Codex itself decides whether the account has changed. After upgrading, the stashed sign-in information is sorted out automatically, and workspaces that had been merged away come back on the official cards; accounts that have already signed out are not restored.
|
||||
- **When a Codex provider's address was written at the top level of `config.toml`, editing and saving deleted the address.** For such configs, the API address showed as empty in the editor; after saving, the address was deleted and Routing reported "Codex Provider 缺少 base_url 配置" (base_url missing); in Direct mode, switching to it also sent requests to OpenAI's official address. The top-level address is now moved into `[model_providers.custom]`, so the editor shows it and saving keeps it. The form no longer generates this layout either.
|
||||
- **On Windows, when the user name contained Chinese or other non-ASCII characters, upgrading tools on the "Apps" page failed** with "The system cannot find the path specified." "Open Terminal" on Claude Code provider cards also could not read the temporary configuration, so Claude Code started with the default configuration without reporting an error; the same happened when the project directory contained Chinese characters. The cause was that the batch files CC Switch generates were written in UTF-8, while `cmd.exe` read them using the console code page. The upgrade script now switches to UTF-8 first, which only affects its own hidden window; "Open Terminal" does not switch the code page (that would change the settings of your own terminal) and instead no longer writes these paths directly into the batch file.
|
||||
- **When Codex continued an old third-party session under the official provider, the error told you to restart.** When continuing a session, Codex keeps the provider the session was created with, so a third-party session always points to local routing, and restarting Codex does not help. The error now explains that this is an old third-party session and that you need to start a new one; it only tells you to restart when Codex really has not reread its configuration.
|
||||
- **Claude's 1-hour cache writes were billed at the 5-minute price.** A 1-hour cache write costs 2x the input price and a 5-minute one 1.25x; everything used to be billed at the 5-minute price, which undercounted quite a bit. Proxy logs and Claude Code session imports now price them separately.
|
||||
- **Cache hits showed as 0 for some OpenAI-compatible relay services.** Some relays always write `cache_read_input_tokens` as 0 and put the real hit count in `prompt_cache_hit_tokens`; CC Switch used to stop looking once it read 0, so cache hits showed as 0 and uncached input was overcounted. It now moves on to the next field when it sees 0. This rule applies when Claude Code is routed to OpenAI Chat format, and when Codex and Grok Build use upstreams in Chat format.
|
||||
- **Usage from Codex session imports had no cache writes.** Cache writes for GPT-5.6 and GPT-6 were priced as regular input; they are now recorded separately.
|
||||
- **Costs for Claude Sonnet 5.5 and Haiku 5.5 were recorded as 0.** The built-in pricing table now includes these two models.
|
||||
- **On the "Claude" tab of "Usage", a provider configured in both Claude Code and Claude Desktop showed up as two identical rows**, and switching apps left the old rows behind.
|
||||
- **In the extra options of OpenCode and MiniMax Code, editing one option changed the types of other values you had not touched.** For example, the strings `"123"` and `"false"` were saved as a number or a boolean. Untouched values now stay as they were, and an option can no longer be renamed to an existing name.
|
||||
- **Turning "Send User-Agent" on or off in OpenClaw deleted all other custom request headers.** Only User-Agent is changed now.
|
||||
- **The "火山 Agent Plan" (Volcengine Agent Plan) preset for Pi and MiniMax Code used the Coding Plan address**, so Agent Plan keys did not work. It now uses Agent Plan's own address, and a new "火山 Coding Plan" preset is added.
|
||||
|
||||
**Other:**
|
||||
- The Chinese guide to Aggregation mode and the user manual in all three languages cover two more common Codex questions: subagents cannot read their tasks after switching to a different provider, and after the official 5-hour quota runs out, `/model` is locked to Luna Reserve, which you can work around by temporarily setting a third-party provider as the default.
|
||||
- The description of "Unified Codex session history" now applies only to Codex CLI: after its update, the Codex desktop app already shows sessions from all providers, so if you only use the desktop app you don't need to turn it on.
|
||||
|
||||
## 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](https://github.com/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](https://github.com/Chaoqi31) (reporting and fixing pricing for Claude's 1-hour cache writes and for cache writes in Codex session imports), [@Yanxcyan](https://github.com/Yanxcyan) (Claude Sonnet 5.5 / Haiku 5.5 pricing, the 火山 Agent Plan preset), [@hulkbig](https://github.com/hulkbig) (reporting and fixing OpenClaw custom request headers being deleted), [@Railgun-wiki](https://github.com/Railgun-wiki) (reporting and fixing duplicate rows in usage statistics) and [@funkpopo](https://github.com/funkpopo) (scrolling the settings page to the app config entry) for their contributions.
|
||||
|
||||
Thanks to [@yleo888](https://github.com/yleo888), [@harvey500](https://github.com/harvey500), [@friendlzw](https://github.com/friendlzw), [@burningimlam](https://github.com/burningimlam), [@JinLin-Yu](https://github.com/JinLin-Yu), [@winter-maple](https://github.com/winter-maple), [@SamPheng](https://github.com/SamPheng), [@cjmarklll](https://github.com/cjmarklll), [@LeenixP](https://github.com/LeenixP) and [@EMnian](https://github.com/EMnian) for reporting issues and making suggestions.
|
||||
|
||||
For the full technical details, see the [CHANGELOG](https://github.com/farion1231/cc-switch/blob/main/CHANGELOG.md).
|
||||
@@ -0,0 +1,58 @@
|
||||
# CC Switch v4.0.7
|
||||
|
||||
### 4.0 正式版の 3 回目の修正リリース
|
||||
|
||||
同じ OpenAI アカウントの Plus と Team のワークスペースを 4.0 で切り替えられなかった問題を修正しました。利用枠は 3.x と同じく「使用済み」で表示することもでき、「設定 → 一般 → 外観」で切り替えられます。Codex の古いセッションを CC Switch から圧縮できるようになり、セッション管理と使用量統計も圧縮後のセッションを読み込めます。直接接続とルーティングを切り替えた後にも CC Switch が Codex の再起動を案内するようになり、Windows ではこの案内が初めて表示されるようになりました。使用量統計では、Claude の 1 時間キャッシュ書き込みの料金や一部の中継サービスのキャッシュヒットなど、計算を誤っていた箇所をいくつか修正しました。4.0 の更新内容の全体は [v4.0 リリースノート](https://github.com/farion1231/cc-switch/blob/main/docs/release-notes/v4.0.4-ja.md) をご覧ください。
|
||||
|
||||
---
|
||||
|
||||
## 新機能
|
||||
|
||||
**利用枠を「使用済み」で表示できるように。** 4.0 では各枠の利用枠を「残り x%」の表示に変えましたが、3.x の「使用済み x%」に慣れている方や、Codex 自身の表記に合わせたい方もいるため、設定で選べるようにしました。「設定 → 一般 → 外観 → 残量の表示」で「残り」(デフォルト)または「使用済み」を選ぶと、プロバイダーカード、「アカウント」ページ、トレイの表示がそれに合わせて変わります。切り替わるのは各枠のパーセンテージだけで、残高、Codex Credits、リセット回数は常に残りを表示し、使い切った枠はこれまでどおり「使い切り」と表示します。色と「残りわずか」の通知は引き続き残りで判断するため、使用済み 94% は残り 6% と同じくオレンジ色です。展開後のプログレスバーの長さは表示している数字に合わせ、使用済み 30% なら 30% 分を描きます。
|
||||
|
||||
**Codex の古いセッションを圧縮できるように。** Codex には、7 日以上更新のないセッションファイルを圧縮して保存する開発中の機能があり、圧縮後のサイズは元のおよそ 6 分の 1 になります。圧縮したセッションで会話を続けると、Codex が自動的に展開します。「設定 → アプリ設定 → Codex」で「Codex の古いセッションを圧縮」をオンにでき、その横にセッションディレクトリの現在の使用量が表示されます。このスイッチは Codex の `config.toml` を直接変更するもので、新しめのバージョンの Codex が必要です。Codex を再起動すると有効になり、オンにすると Codex は起動するたびに開発中の機能についての通知を表示します。このスイッチのオン・オフに関係なく、Codex のバックグラウンドサービスが自分でセッションを圧縮することもあります。これまで CC Switch は圧縮されていないセッションファイルしか認識せず、圧縮されたセッションはセッション一覧から消え、使用量も取り込まれませんでした。現在はセッション管理、使用量統計、セッション履歴の移行のいずれも圧縮後のセッションを読み込めます。ただし、一覧にはそれらのセッションの最後の返信のプレビューが表示されません。
|
||||
|
||||
**直接接続とルーティングを切り替えた後にも、Codex の再起動を案内するように。** すでに開いている Codex は、起動時に読み込んだモデル一覧を使い続けています。これまでは集約モードでしか確認しておらず、直接接続とルーティングを切り替えた後は、モデル一覧が変わっても案内しませんでした。現在は 3 つのモードすべてで確認します。案内を閉じた後にモデル一覧がまた変わると、案内が再び表示されます。
|
||||
|
||||
**Windows でも Codex の再起動の案内が表示されるように。** これまでは Codex が動いているかどうかをシステムのプロセス一覧を読んで判断していましたが、この方法は Windows では使えず、モデル一覧とアカウントの案内はどちらも表示されず、再起動ボタンも常にバックグラウンドサービスが動いていないと表示していました。現在 Windows では、Codex のバックグラウンドサービス自身が記録しているプロセス ID で動作中かどうかを判断し、動作中と確認できたときだけ再起動ボタンを表示します。CC Switch は Windows では Codex のデスクトップ版やエディター拡張機能を検出できないため、モデル一覧やログイン中のアカウントが前回案内を閉じたときと異なっていれば、「切り替え前から開いている Codex は、以前のアカウントやモデル一覧を使い続けている可能性があります」と案内します。これらのクライアントを開いていなければ、そのまま案内を閉じてかまいません。アップグレード直後にこの案内が表示されることはありません。
|
||||
|
||||
**各アプリのページのメニューから「設定ディレクトリ」を開くと、設定ページがそのアプリの項目までスクロールするようになりました**。項目の枠線が 2 回点滅します。スクロール中にご自身でスクロールしたりクリックしたりするとすぐに止まり、システムで動きを減らす設定がオンのときはアニメーションなしで直接移動します。
|
||||
|
||||
## 修正
|
||||
|
||||
- **同じ OpenAI アカウントの Plus と Team のワークスペースを、Codex で切り替えられなかった問題。** 4.0 では Codex の公式ログインをユーザー単位でしか識別していなかったため、同じ人の別のワークスペースが「このアカウントにはすでにログインしている」とみなされ、`auth.json` が書き換えられず、再起動の案内も表示されませんでした。ログイン情報を一時保存するときもユーザー単位で記録していたため、同じ人の複数のワークスペースは 1 つ分しか残りませんでした。現在は「ユーザー + ワークスペース」で識別し、Codex 自身がアカウントの変更を判断する方法と同じになりました。アップグレード後、一時保存したログイン情報は自動で整理され、まとめられてしまったワークスペースは公式カードから取り戻せます。ログアウト済みのアカウントは復元されません。
|
||||
- **Codex プロバイダーのアドレスが `config.toml` の最上位に書かれていると、編集して保存したときにアドレスが削除されていた問題。** こうした設定ではエディターの「API エンドポイント」が空で表示され、保存するとアドレスが削除されて、ルーティングで「Codex Provider 缺少 base_url 配置」(base_url の設定がない)というエラーになっていました。直接接続モードでは、このプロバイダーに切り替えると OpenAI 公式のアドレスにつながっていました。現在は最上位のアドレスを `[model_providers.custom]` に移すため、エディターに表示され、保存しても残ります。フォームもこの書き方を生成しなくなりました。
|
||||
- **Windows のユーザー名に日本語や中国語などの非 ASCII 文字が含まれていると、「アプリ」ページでツールのアップグレードに失敗していた問題**。「指定されたパスが見つかりません」と表示されていました。Claude Code のプロバイダーカードの「ターミナルを開く」も一時的な設定を読み込めず、Claude Code はエラーを出さずにデフォルトの設定で起動していました。プロジェクトのディレクトリに日本語や中国語が含まれる場合も同様です。原因は、CC Switch が生成するバッチファイルを UTF-8 で書き込んでいたのに、`cmd.exe` はコンソールのコードページで読み込んでいたことです。現在はアップグレードスクリプトが最初に UTF-8 に切り替えます。この切り替えはスクリプト自身の非表示ウィンドウの中でだけ有効です。「ターミナルを開く」ではコードページを切り替えず(切り替えるとご自身のターミナルの設定が変わってしまうため)、これらのパスをバッチファイルに直接書き込まないようにしました。
|
||||
- **Codex で公式プロバイダーのまま古いサードパーティのセッションを続けると、再起動を求めるエラーが表示されていた問題。** Codex はセッションを続けるとき、セッション作成時のプロバイダーを引き継ぐため、サードパーティのセッションは常にローカルルーティングを指したままで、Codex を再起動しても解決しません。現在はエラーで、これが古いサードパーティのセッションであり、新しいセッションを始める必要があることを説明します。Codex が実際に設定を読み直していない場合にだけ、再起動を案内します。
|
||||
- **Claude の 1 時間キャッシュ書き込みが 5 分の料金で計算されていた問題。** 1 時間キャッシュ書き込みの単価は入力料金の 2 倍、5 分は 1.25 倍ですが、これまではすべて 5 分として計算していたため、かなり少なく計上されていました。現在はルーティングのリクエストログと Claude Code のセッションの取り込みのどちらでも、分けて計算します。
|
||||
- **一部の OpenAI 互換の中継サービスで、キャッシュヒットが 0 と表示されていた問題。** 中継サービスによっては `cache_read_input_tokens` を常に 0 にして、実際のヒット数を `prompt_cache_hit_tokens` に入れています。これまでは 0 を読んだ時点で探すのをやめていたため、キャッシュヒットが 0 と表示され、ヒットしなかった入力も多めに計上されていました。現在は 0 のときは次のフィールドも確認します。Claude Code をルーティング経由で OpenAI Chat 形式に変換する場合と、Codex、Grok Build で Chat 形式の上流を使う場合は、いずれもこのルールで読み取ります。
|
||||
- **Codex のセッションから取り込んだ使用量に、キャッシュ書き込みが含まれていなかった問題。** GPT-5.6 と GPT-6 のキャッシュ書き込みが通常の入力として計算されていましたが、現在は別に記録します。
|
||||
- **Claude Sonnet 5.5 と Haiku 5.5 の費用が 0 と記録されていた問題。** 内蔵の料金表にこの 2 つのモデルを追加しました。
|
||||
- **「使用量」の「Claude」ページで、同じプロバイダーを Claude Code と Claude Desktop の両方で設定していると、同じ記録が 2 行表示されていた問題**。アプリを切り替えた後も古い行が残っていました。
|
||||
- **OpenCode と MiniMax Code の追加オプションで、1 つを編集すると、変更していないほかの値の型が変わっていた問題。** たとえば文字列の `"123"`、`"false"` が数値や真偽値として保存されていました。現在は変更していない値はそのまま残り、名前を既存の名前に変更することもできなくなりました。
|
||||
- **OpenClaw で「User-Agent を送信」をオン・オフすると、ほかのカスタムリクエストヘッダーがすべて削除されていた問題。** 現在は User-Agent の 1 項目だけを変更します。
|
||||
- **Pi と MiniMax Code の「火山 Agent Plan」プリセットが Coding Plan のアドレスを使っていた問題**。そのため Agent Plan の Key が使えませんでした。現在は Agent Plan 専用のアドレスを使い、新たに「火山 Coding Plan」プリセットも追加しました。
|
||||
|
||||
**その他:**
|
||||
- 中国語版の集約モードガイドと 3 言語のユーザーマニュアルに、Codex のよくある質問を 2 つ追加しました。サブエージェントが別のプロバイダーに切り替わるとタスクを読めない問題と、公式の 5 時間枠を使い切った後に `/model` が Luna Reserve に固定される問題です。後者はサードパーティのプロバイダーを一時的にデフォルトにすると回避できます。
|
||||
- 「Codex セッション履歴を統一」の説明を、Codex CLI だけを対象とする内容に変更しました。Codex のデスクトップ版は更新後、すべてのプロバイダーのセッションを表示できるようになったため、デスクトップ版だけを使う場合はオンにする必要はありません。
|
||||
|
||||
## アップグレードに関する注意
|
||||
|
||||
**データベースの構造は変わっていません。** バージョンは 20 のままです。
|
||||
|
||||
**アップグレード後、Claude のキャッシュ書き込みの費用が高くなります。** 1 時間キャッシュを使っている場合(Claude Code のメインセッションは通常これに当たります)、新しい記録のキャッシュ書き込みは正しい料金で計算されるため、1 日あたりの費用がアップグレード前より一段高くなります。これは以前の計上が少なすぎたためで、値上げではありません。アップグレード前の記録は再計算しません。
|
||||
|
||||
**Claude Sonnet 5.5 と Haiku 5.5 でこれまで 0 と記録されていた費用**は、起動時に新しい料金で再計算されます。Haiku 5.5 は 10 万トークン以内の料金だけで計算するため、それより長いプロンプトは少なめに計上されます。
|
||||
|
||||
**追加済みの「火山 Agent Plan」プロバイダー(Pi、MiniMax Code)は自動では変更されません**。「API エンドポイント」の `/api/coding/v3` を `/api/plan/v3` に変更するか、削除して新しいプリセットで追加し直してください。
|
||||
|
||||
---
|
||||
|
||||
## 謝辞
|
||||
|
||||
[@ggbdpq](https://github.com/ggbdpq)(中継サービスのキャッシュヒットが 0 と表示される問題、OpenCode の追加オプションの型が変わる問題、直接接続とルーティングの切り替え後の再起動の案内)、[@Chaoqi31](https://github.com/Chaoqi31)(Claude の 1 時間キャッシュ書き込みの料金計算と、Codex のセッション取り込みでのキャッシュ書き込みの報告と修正)、[@Yanxcyan](https://github.com/Yanxcyan)(Claude Sonnet 5.5 / Haiku 5.5 の料金、火山 Agent Plan プリセット)、[@hulkbig](https://github.com/hulkbig)(OpenClaw のカスタムリクエストヘッダーが削除される問題の報告と修正)、[@Railgun-wiki](https://github.com/Railgun-wiki)(使用量統計の重複行の報告と修正)、[@funkpopo](https://github.com/funkpopo)(設定ページでアプリ設定の項目までスクロール)の貢献に感謝します。
|
||||
|
||||
問題の報告や提案をしてくださった [@yleo888](https://github.com/yleo888)、[@harvey500](https://github.com/harvey500)、[@friendlzw](https://github.com/friendlzw)、[@burningimlam](https://github.com/burningimlam)、[@JinLin-Yu](https://github.com/JinLin-Yu)、[@winter-maple](https://github.com/winter-maple)、[@SamPheng](https://github.com/SamPheng)、[@cjmarklll](https://github.com/cjmarklll)、[@LeenixP](https://github.com/LeenixP)、[@EMnian](https://github.com/EMnian) にも感謝します。
|
||||
|
||||
技術的な詳細は [CHANGELOG](https://github.com/farion1231/cc-switch/blob/main/CHANGELOG.md) をご覧ください。
|
||||
@@ -0,0 +1,58 @@
|
||||
# CC Switch v4.0.7
|
||||
|
||||
### 4.0 正式版的第三个修复版本
|
||||
|
||||
同一个 OpenAI 账号下的 Plus 和 Team 工作区,在 4.0 里切不过去,这个版本修好了。额度可以改回 3.x 那样显示「已用」,在「设置 → 通用 → 外观」里切换。Codex 的历史会话可以在 CC Switch 里打开压缩,会话管理和用量统计也能读取压缩后的会话。直连和路由互相切换后,CC Switch 也会提示重启 Codex;Windows 上第一次能看到这条提示。用量统计这次修了几处算错的地方,包括 Claude 1 小时缓存写入的价格和部分中转站的缓存命中。4.0 完整的更新内容请见 [v4.0 发布说明](https://github.com/farion1231/cc-switch/blob/main/docs/release-notes/v4.0.4-zh.md)。
|
||||
|
||||
---
|
||||
|
||||
## 新增
|
||||
|
||||
**额度可以显示「已用」。** 4.0 把各档额度都改成了「剩余 x%」,有人习惯 3.x 的「已用 x%」,也有人希望和 Codex 自己的写法一致,所以做成了设置。在「设置 → 通用 → 外观 → 额度显示」选「剩余」(默认)或「已用」,供应商卡片、授权中心和托盘都会跟着变。只有各档的百分比会换,余额、Codex Credits 和重置次数始终显示剩余,用完的档位仍然显示「已用完」。颜色和「快用完」提醒仍然按剩余算,已用 94% 和剩余 6% 一样是橙色。展开后的进度条长度跟着显示的数字走,已用 30% 就画 30%。
|
||||
|
||||
**可以压缩 Codex 的历史会话。** Codex 有一个还在开发中的功能,会把 7 天以上没动过的会话文件压缩保存,压缩后大约只占原来的六分之一,在这些会话上继续对话时 Codex 会自动解压。在「设置 → 应用配置 → Codex」打开「压缩 Codex 历史会话」,旁边会显示会话目录当前的占用。这个开关直接改 Codex 的 `config.toml`,需要较新版本的 Codex,重启 Codex 后生效;打开后 Codex 每次启动会显示一条开发中功能的提示。Codex 的后台服务也可能自行压缩会话,跟这个开关开没开无关。以前 CC Switch 只认未压缩的会话文件,压缩后的会话会从会话列表里消失,用量也不会导入。现在会话管理、用量统计和会话历史迁移都能读取压缩后的会话,只是列表里不显示它们最后一条回复的预览。
|
||||
|
||||
**直连和路由互相切换后,也会提示重启 Codex。** 已经打开的 Codex 还在用启动时读到的模型列表。以前只在聚合模式下检查,直连和路由互相切换后,即使模型列表变了也不会提示。现在三种模式都会检查。关掉提示后如果模型列表又变了,提示会再次出现。
|
||||
|
||||
**Windows 上也能看到重启 Codex 的提示了。** 以前判断 Codex 有没有在运行,靠读系统进程列表,这个方法在 Windows 上用不了,模型列表和账号的提示都不会出现,重启按钮也总是说后台服务没在运行。现在 Windows 上按 Codex 后台服务自己记录的进程号判断它是否在运行,只在确认它在运行时提供重启按钮。CC Switch 在 Windows 上看不到 Codex 桌面版和编辑器插件,所以只要模型列表或登录账号和你上次关掉提示时不一样,就会提示「切换前就开着的 Codex 可能还在用之前的账号或模型列表」;这些客户端没开着的话,直接关掉提示就行。刚升级时不会弹出这条提示。
|
||||
|
||||
**从应用页菜单打开「配置目录」时,设置页会滚到这个应用的条目**,并让它的边框闪两下。滚动途中你自己滚动或点击,会马上停止;系统开启了减少动态效果时直接跳过去。
|
||||
|
||||
## 修复
|
||||
|
||||
- **同一个 OpenAI 账号下的 Plus 和 Team 工作区,在 Codex 里切不过去。** 4.0 只按用户来认 Codex 的官方登录,同一个人的不同工作区被当成「已经登录了这个账号」,`auth.json` 不会改写,也不会提示重启。暂存登录信息时也按用户记,同一个人的几个工作区只剩一份。现在按「用户 + 工作区」来认,和 Codex 自己判断账号有没有变的方式一致。升级后会自动整理暂存的登录信息,被合并掉的工作区会从官方卡片里找回来;已经登出的账号不会被恢复。
|
||||
- **Codex 供应商的地址写在 `config.toml` 顶层时,编辑保存会把地址删掉。** 这类配置在编辑器里请求地址显示为空,保存后地址被删除,路由报「Codex Provider 缺少 base_url 配置」;直连模式下切过去还会走到 OpenAI 官方地址。现在会把顶层地址整理到 `[model_providers.custom]` 里,编辑器能显示,保存也会保留。表单也不再生成这种写法。
|
||||
- **Windows 用户名里有中文等非 ASCII 字符时,在「应用」页升级工具失败**,提示「系统找不到指定的路径」。Claude Code 供应商卡片上的「打开终端」也会读不到临时配置,Claude Code 不报错,直接用默认配置启动;项目目录带中文时也一样。原因是 CC Switch 生成的批处理文件按 UTF-8 写入,`cmd.exe` 却按控制台代码页读。升级脚本现在会先切换到 UTF-8,这一步只在它自己的隐藏窗口里生效;「打开终端」不切换代码页(那会改掉你自己终端的设置),改为不把这些路径直接写进批处理文件。
|
||||
- **Codex 在官方供应商下继续旧的第三方会话时,报错提示让你重启。** Codex 继续会话时会沿用会话创建时的供应商,第三方会话会一直指向本地路由,重启 Codex 也没用。现在报错会说明这是旧的第三方会话,需要新开会话;只有确实是 Codex 没有重新读取配置时,才提示重启。
|
||||
- **Claude 的 1 小时缓存写入按 5 分钟的价格计费。** 1 小时缓存写入的单价是输入价的 2 倍,5 分钟的是 1.25 倍,以前一律按 5 分钟算,少算了不少。现在代理日志和 Claude Code 会话导入都会分开计价。
|
||||
- **部分 OpenAI 兼容中转站的缓存命中显示为 0。** 有的中转站把 `cache_read_input_tokens` 固定写成 0,真实命中数放在 `prompt_cache_hit_tokens` 里,以前读到 0 就不往下找了,缓存命中显示为 0,未命中的输入也被多算。现在遇到 0 会接着看下一个字段。Claude Code 经路由转 OpenAI Chat 格式、Codex 和 Grok Build 使用 Chat 格式的上游时都按这个规则读。
|
||||
- **Codex 会话导入的用量里没有缓存写入。** GPT-5.6 和 GPT-6 的缓存写入被按普通输入计价,现在会单独记录。
|
||||
- **Claude Sonnet 5.5 和 Haiku 5.5 的费用记为 0。** 内置定价表补上了这两个模型。
|
||||
- **用量统计「Claude」页里,同一个供应商在 Claude Code 和 Claude Desktop 里都配置过时,会出现两行一样的记录**,切换应用后还会留下旧的行。
|
||||
- **OpenCode 和 MiniMax Code 的额外选项,编辑其中一项后,其他没动过的值类型会变。** 比如字符串 `"123"`、`"false"` 被存成数字或布尔值。现在没改过的值保持原样,改名时也不能改成已有的名字。
|
||||
- **OpenClaw 打开或关闭「发送 User-Agent」时,其他自定义请求头全被删掉。** 现在只改 User-Agent 这一项。
|
||||
- **Pi 和 MiniMax Code 的「火山 Agent Plan」预设用的是 Coding Plan 的地址**,Agent Plan 的 Key 用不了。现在改用 Agent Plan 自己的地址,另外新增「火山 Coding Plan」预设。
|
||||
|
||||
**其他:**
|
||||
- 中文版聚合模式指南和三语用户手册补充了两个 Codex 常见问题:子 agent 换到另一家供应商后读不到任务,以及官方 5 小时额度用完后 `/model` 被锁定在 Luna Reserve,暂时把第三方供应商设为默认可以绕开。
|
||||
- 「统一 Codex 会话历史」的说明改为只针对 Codex CLI:Codex 桌面版更新后已经能显示所有供应商的会话,只用桌面版的话不需要打开。
|
||||
|
||||
## 升级说明
|
||||
|
||||
**数据库结构没有变化**,仍然是 20。
|
||||
|
||||
**Claude 的缓存写入费用升级后会变高。** 用 1 小时缓存时(Claude Code 主会话通常就是),新记录的缓存写入按正确的价格计算,每天的费用会比升级前高一截。这是以前少算了,不是涨价;升级前的记录不会重算。
|
||||
|
||||
**Claude Sonnet 5.5 和 Haiku 5.5 以前记为 0 的费用**,会在启动时按新价格补算。Haiku 5.5 只按 10 万 token 以内的价格计算,更长的提示词会少算。
|
||||
|
||||
**已经添加过的「火山 Agent Plan」供应商(Pi、MiniMax Code)不会自动修改**,请把请求地址里的 `/api/coding/v3` 改成 `/api/plan/v3`,或者删掉后用新预设重新添加。
|
||||
|
||||
---
|
||||
|
||||
## 致谢
|
||||
|
||||
感谢 [@ggbdpq](https://github.com/ggbdpq)(中转站缓存命中显示为 0、OpenCode 额外选项类型被改、直连和路由切换后的重启提示)、[@Chaoqi31](https://github.com/Chaoqi31)(报告并修复 Claude 1 小时缓存写入计价、Codex 会话导入缓存写入)、[@Yanxcyan](https://github.com/Yanxcyan)(Claude Sonnet 5.5 / Haiku 5.5 定价、火山 Agent Plan 预设)、[@hulkbig](https://github.com/hulkbig)(报告并修复 OpenClaw 自定义请求头被删)、[@Railgun-wiki](https://github.com/Railgun-wiki)(报告并修复用量统计重复行)、[@funkpopo](https://github.com/funkpopo)(设置页滚到应用配置条目)的贡献。
|
||||
|
||||
感谢 [@yleo888](https://github.com/yleo888)、[@harvey500](https://github.com/harvey500)、[@friendlzw](https://github.com/friendlzw)、[@burningimlam](https://github.com/burningimlam)、[@JinLin-Yu](https://github.com/JinLin-Yu)、[@winter-maple](https://github.com/winter-maple)、[@SamPheng](https://github.com/SamPheng)、[@cjmarklll](https://github.com/cjmarklll)、[@LeenixP](https://github.com/LeenixP)、[@EMnian](https://github.com/EMnian) 报告问题和提出建议。
|
||||
|
||||
完整的技术细节请见 [CHANGELOG](https://github.com/farion1231/cc-switch/blob/main/CHANGELOG.md)。
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"version": "4.0.7",
|
||||
"items": [
|
||||
{
|
||||
"type": "fix",
|
||||
"zh": "修复 Codex 切不了同一账号的 Plus 和 Team 工作区",
|
||||
"zh-TW": "修復 Codex 切換不了同一帳號的 Plus 和 Team 工作區",
|
||||
"en": "Fixed switching between Plus and Team workspaces of the same OpenAI account in Codex",
|
||||
"ja": "Codex で同じアカウントの Plus と Team ワークスペースを切り替えられない問題を修正"
|
||||
},
|
||||
{
|
||||
"type": "new",
|
||||
"zh": "额度可以改为显示「已用」,在设置 → 通用 → 外观里切换",
|
||||
"zh-TW": "額度可以改為顯示「已用」,在設定 → 一般 → 外觀中切換",
|
||||
"en": "Quotas can show what is used instead of what is left (Settings → General → Appearance)",
|
||||
"ja": "利用枠を「使用済み」で表示できるように(設定 → 一般 → 外観)"
|
||||
},
|
||||
{
|
||||
"type": "new",
|
||||
"zh": "可以压缩 Codex 历史会话,压缩后的会话照常显示和统计用量",
|
||||
"zh-TW": "可以壓縮 Codex 歷史對話,壓縮後的對話照常顯示並統計用量",
|
||||
"en": "Old Codex sessions can be compressed, and still show up with their usage counted",
|
||||
"ja": "Codex の古いセッションを圧縮でき、圧縮後も一覧表示と使用量の集計が可能に"
|
||||
},
|
||||
{
|
||||
"type": "fix",
|
||||
"zh": "修复 Claude 1 小时缓存写入少算费用、部分中转站缓存命中显示为 0",
|
||||
"zh-TW": "修復 Claude 1 小時快取寫入費用少算、部分中轉站快取命中顯示為 0",
|
||||
"en": "Fixed under-billed Claude 1-hour cache writes and cache hits showing 0 on some relays",
|
||||
"ja": "Claude 1 時間キャッシュ書き込みの過少計上と一部中継のキャッシュヒット 0 表示を修正"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user