mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-26 01:34:51 +08:00
docs(release): expand the Codex session compression section in v4.0.7 notes
Explain how the switch maps to config.toml, when Codex actually compresses sessions, how resuming and CC Switch's session list and usage handle compressed rollouts, and what to watch out for (Codex version, startup notice, turning it off, other tools that read .jsonl). Move it to the top of the new features.
This commit is contained in:
1 parent
0b8662a411
commit
1f786dadd0
3 files changed
+30
-6
No files matched your search
@@ -8,9 +8,17 @@ Plus and Team workspaces under the same OpenAI account could not be switched bet
|
||||
|
||||
## 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 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.
|
||||
|
||||
**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.
|
||||
- **How to turn it on:** Turn on "Compress old Codex sessions" under "Settings → App config → Codex"; next to it, CC Switch shows how much space the `sessions` and `archived_sessions` directories currently take up in total. The switch edits Codex's `config.toml` directly: turning it on writes, under `[features]`, the line `local_thread_store_compression = true`, and turning it off deletes that line; CC Switch does not store this setting separately.
|
||||
- **When compression happens:** Nothing is compressed right away. Each time Codex starts, it compresses session files untouched for more than 7 days in the background into `.jsonl.zst` files with the same name, then deletes the originals. In testing, compressed files take about one sixth of the original space.
|
||||
- **Continuing old sessions:** Just continue them in Codex as usual; Codex first decompresses the session back to its original format.
|
||||
- **In CC Switch:** Compressed sessions still appear in the session list, can be viewed and deleted, and their usage is counted as usual, without being counted twice before and after compression. To keep the list quick to open even with many sessions, CC Switch reads only the beginning of each compressed file, so these sessions do not show a preview of their last reply, and their last active time is taken from the file's modification time.
|
||||
- **Things to note:** This needs a recent version of Codex and takes effect after Codex restarts. It is a Codex feature still under development, so once it is on, Codex shows a notice every time it starts. Turning the switch off stops new sessions from being compressed; sessions already compressed stay as they are and are only decompressed when you continue them in Codex. Other tools that read `.jsonl` session files directly may not be able to read 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.
|
||||
|
||||
|
||||
@@ -8,9 +8,17 @@
|
||||
|
||||
## 新機能
|
||||
|
||||
**利用枠を「使用済み」で表示できるように。** 4.0 では各枠の利用枠を「残り x%」の表示に変えましたが、3.x の「使用済み x%」に慣れている方や、Codex 自身の表記に合わせたい方もいるため、設定で選べるようにしました。「設定 → 一般 → 外観 → 残量の表示」で「残り」(デフォルト)または「使用済み」を選ぶと、プロバイダーカード、「アカウント」ページ、トレイの表示がそれに合わせて変わります。切り替わるのは各枠のパーセンテージだけで、残高、Codex Credits、リセット回数は常に残りを表示し、使い切った枠はこれまでどおり「使い切り」と表示します。色と「残りわずか」の通知は引き続き残りで判断するため、使用済み 94% は残り 6% と同じくオレンジ色です。展開後のプログレスバーの長さは表示している数字に合わせ、使用済み 30% なら 30% 分を描きます。
|
||||
**Codex の古いセッションを圧縮できるように。** Codex は各セッションを `~/.codex/sessions` の下にすべて記録しており、よく使うとこのディレクトリが数十 GB まで膨らみます。Codex 自身には開発中の圧縮機能があり、デフォルトではオフです。今回 CC Switch にそのスイッチを追加し、圧縮後のセッションも読み込めるようにしました。
|
||||
|
||||
**Codex の古いセッションを圧縮できるように。** Codex には、7 日以上更新のないセッションファイルを圧縮して保存する開発中の機能があり、圧縮後のサイズは元のおよそ 6 分の 1 になります。圧縮したセッションで会話を続けると、Codex が自動的に展開します。「設定 → アプリ設定 → Codex」で「Codex の古いセッションを圧縮」をオンにでき、その横にセッションディレクトリの現在の使用量が表示されます。このスイッチは Codex の `config.toml` を直接変更するもので、新しめのバージョンの Codex が必要です。Codex を再起動すると有効になり、オンにすると Codex は起動するたびに開発中の機能についての通知を表示します。このスイッチのオン・オフに関係なく、Codex のバックグラウンドサービスが自分でセッションを圧縮することもあります。これまで CC Switch は圧縮されていないセッションファイルしか認識せず、圧縮されたセッションはセッション一覧から消え、使用量も取り込まれませんでした。現在はセッション管理、使用量統計、セッション履歴の移行のいずれも圧縮後のセッションを読み込めます。ただし、一覧にはそれらのセッションの最後の返信のプレビューが表示されません。
|
||||
- **有効にする方法:** 「設定 → アプリ設定 → Codex」で「Codex の古いセッションを圧縮」をオンにします。その横に `sessions` と `archived_sessions` の 2 つのディレクトリが現在合計でどれだけの容量を使っているかが表示されます。このスイッチは Codex の `config.toml` を直接変更します。オンにすると `[features]` の下に `local_thread_store_compression = true` を書き込み、オフにするとこの行を削除します。CC Switch がこの設定を別に保存することはありません。
|
||||
- **圧縮されるタイミング:** オンにしてもすぐには圧縮されません。Codex は起動するたびに、7 日以上更新のないセッションファイルをバックグラウンドで同じ名前の `.jsonl.zst` に圧縮し、元のファイルを削除します。実測では、圧縮後のサイズは元のおよそ 6 分の 1 です。
|
||||
- **古いセッションを続けるには:** これまでどおり Codex で続けるだけです。Codex がまずそのセッションを元の形式に展開します。
|
||||
- **CC Switch での扱い:** 圧縮されたセッションもこれまでどおりセッション一覧に表示され、閲覧や削除ができます。使用量も通常どおり集計され、圧縮の前後で二重に計算されることもありません。セッションが多くても一覧をすばやく開けるよう、CC Switch は圧縮ファイルの先頭だけを読み込むため、これらのセッションには最後の返信のプレビューが表示されず、最終アクティブ時刻にはファイルの更新日時を使います。
|
||||
- **注意点:** 新しめのバージョンの Codex が必要で、変更後は Codex を再起動すると有効になります。Codex でまだ開発中の機能のため、オンにすると Codex は起動するたびに通知を表示します。スイッチをオフにすると新しいセッションは圧縮されなくなりますが、圧縮済みのセッションはそのまま残り、Codex で続けたときにだけ展開されます。`.jsonl` のセッションファイルを直接読み込むほかのツールでは、圧縮後のセッションを読み込めないことがあります。
|
||||
|
||||
このスイッチをオンにしなくても、Codex のバックグラウンドサービスが自分でセッションを圧縮することがあります。これまで CC Switch は圧縮されていないセッションファイルしか認識しなかったため、こうしたセッションはセッション一覧から消え、使用量も取り込まれませんでしたが、現在はどちらも正常に読み込めます。
|
||||
|
||||
**利用枠を「使用済み」で表示できるように。** 4.0 では各枠の利用枠を「残り x%」の表示に変えましたが、3.x の「使用済み x%」に慣れている方や、Codex 自身の表記に合わせたい方もいるため、設定で選べるようにしました。「設定 → 一般 → 外観 → 残量の表示」で「残り」(デフォルト)または「使用済み」を選ぶと、プロバイダーカード、「アカウント」ページ、トレイの表示がそれに合わせて変わります。切り替わるのは各枠のパーセンテージだけで、残高、Codex Credits、リセット回数は常に残りを表示し、使い切った枠はこれまでどおり「使い切り」と表示します。色と「残りわずか」の通知は引き続き残りで判断するため、使用済み 94% は残り 6% と同じくオレンジ色です。展開後のプログレスバーの長さは表示している数字に合わせ、使用済み 30% なら 30% 分を描きます。
|
||||
|
||||
**直接接続とルーティングを切り替えた後にも、Codex の再起動を案内するように。** すでに開いている Codex は、起動時に読み込んだモデル一覧を使い続けています。これまでは集約モードでしか確認しておらず、直接接続とルーティングを切り替えた後は、モデル一覧が変わっても案内しませんでした。現在は 3 つのモードすべてで確認します。案内を閉じた後にモデル一覧がまた変わると、案内が再び表示されます。
|
||||
|
||||
|
||||
@@ -8,9 +8,17 @@
|
||||
|
||||
## 新增
|
||||
|
||||
**额度可以显示「已用」。** 4.0 把各档额度都改成了「剩余 x%」,有人习惯 3.x 的「已用 x%」,也有人希望和 Codex 自己的写法一致,所以做成了设置。在「设置 → 通用 → 外观 → 额度显示」选「剩余」(默认)或「已用」,供应商卡片、授权中心和托盘都会跟着变。只有各档的百分比会换,余额、Codex Credits 和重置次数始终显示剩余,用完的档位仍然显示「已用完」。颜色和「快用完」提醒仍然按剩余算,已用 94% 和剩余 6% 一样是橙色。展开后的进度条长度跟着显示的数字走,已用 30% 就画 30%。
|
||||
**可以压缩 Codex 的历史会话。** Codex 会把每个会话完整记录在 `~/.codex/sessions` 下,用得多的话这个目录会涨到几十 GB。Codex 自己有一个还在开发中的压缩功能,默认关闭;CC Switch 这次加了开关,并且能读取压缩后的会话。
|
||||
|
||||
**可以压缩 Codex 的历史会话。** Codex 有一个还在开发中的功能,会把 7 天以上没动过的会话文件压缩保存,压缩后大约只占原来的六分之一,在这些会话上继续对话时 Codex 会自动解压。在「设置 → 应用配置 → Codex」打开「压缩 Codex 历史会话」,旁边会显示会话目录当前的占用。这个开关直接改 Codex 的 `config.toml`,需要较新版本的 Codex,重启 Codex 后生效;打开后 Codex 每次启动会显示一条开发中功能的提示。Codex 的后台服务也可能自行压缩会话,跟这个开关开没开无关。以前 CC Switch 只认未压缩的会话文件,压缩后的会话会从会话列表里消失,用量也不会导入。现在会话管理、用量统计和会话历史迁移都能读取压缩后的会话,只是列表里不显示它们最后一条回复的预览。
|
||||
- **怎么打开:** 在「设置 → 应用配置 → Codex」打开「压缩 Codex 历史会话」,旁边会显示 `sessions` 和 `archived_sessions` 两个目录当前一共占多少空间。这个开关直接改 Codex 的 `config.toml`:打开时写入 `[features]` 下的 `local_thread_store_compression = true`,关闭时删掉这一行,CC Switch 不另外保存这个设置。
|
||||
- **压缩什么时候发生:** 打开后不会马上压缩。Codex 每次启动时会在后台把 7 天以上没动过的会话文件压成同名的 `.jsonl.zst`,再删掉原文件。实测压缩后大约只占原来的六分之一。
|
||||
- **继续旧会话:** 照常在 Codex 里继续就行,Codex 会先把这个会话解压回原来的格式。
|
||||
- **在 CC Switch 里:** 压缩过的会话照常出现在会话列表里,可以查看和删除,用量照常统计,压缩前后也不会重复计算。为了在会话很多时也能很快打开列表,CC Switch 只读压缩文件的开头,所以这些会话不显示最后一条回复的预览,最后活跃时间取文件的修改时间。
|
||||
- **需要注意:** 需要较新版本的 Codex,改完要重启 Codex 才生效。这是 Codex 还在开发中的功能,打开后 Codex 每次启动都会显示一条提示。关闭开关后不再压缩新的会话,已经压缩的会话保持原样,只有在 Codex 里继续时才会被解压。其他直接读取 `.jsonl` 会话文件的工具可能读不到压缩后的会话。
|
||||
|
||||
即使不打开这个开关,Codex 的后台服务也可能自己压缩会话。以前 CC Switch 只认未压缩的会话文件,这些会话会从会话列表里消失,用量也不会导入,现在都能正常读取。
|
||||
|
||||
**额度可以显示「已用」。** 4.0 把各档额度都改成了「剩余 x%」,有人习惯 3.x 的「已用 x%」,也有人希望和 Codex 自己的写法一致,所以做成了设置。在「设置 → 通用 → 外观 → 额度显示」选「剩余」(默认)或「已用」,供应商卡片、授权中心和托盘都会跟着变。只有各档的百分比会换,余额、Codex Credits 和重置次数始终显示剩余,用完的档位仍然显示「已用完」。颜色和「快用完」提醒仍然按剩余算,已用 94% 和剩余 6% 一样是橙色。展开后的进度条长度跟着显示的数字走,已用 30% 就画 30%。
|
||||
|
||||
**直连和路由互相切换后,也会提示重启 Codex。** 已经打开的 Codex 还在用启动时读到的模型列表。以前只在聚合模式下检查,直连和路由互相切换后,即使模型列表变了也不会提示。现在三种模式都会检查。关掉提示后如果模型列表又变了,提示会再次出现。
|
||||
|
||||
|
||||
Reference in new issue
Block a user