mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-25 17:22:27 +08:00
fix(proxy): report routed switches without unconditional restart prompts (#8378)
Route switches now return what was actually applied (remembered / route / stack) and whether the client configuration was rewritten, and the success toast is built from that instead of always asking Codex / Gemini CLI / Grok Build users to restart. A restart hint is shown only when client files changed. Direct-mode switches serialize unchanged. Fixes #8347.
This commit is contained in:
1 parent
d23cee4c11
commit
5cc94b8dac
21 files changed
+602
-33
No files matched your search
@@ -143,9 +143,9 @@ When switching providers in routing mode:
|
||||
|
||||
1. In the "Routing" tab, click "Route here" on a provider card (with failover on, adjust the queue instead; see [4.3 Failover](./4.3-failover.md))
|
||||
2. The routing service immediately uses the new provider to forward requests
|
||||
3. **No need to restart the CLI tool**
|
||||
3. **No need to restart the CLI tool if its configuration is unchanged**
|
||||
|
||||
This is a major advantage of routing mode: provider switching takes effect instantly. After switching Codex, Gemini CLI, or Grok Build, the interface still prompts you to restart; while routing, you can skip the restart as long as the switch doesn't change the model.
|
||||
After a route switch, new requests use the new provider; requests already in progress are unchanged. The success notification distinguishes the route change from client configuration updates: changing only the upstream needs no restart. If client configuration also changes, restart Codex, Gemini CLI, or Grok Build to load that configuration.
|
||||
|
||||
In routing mode, switching changes only the provider that routing uses; the direct provider stays the same, is labeled "Direct" on its card, and is what you return to when you leave routing. If what the new provider writes to the config file (the local address, model name, etc.) is the same as before, switching doesn't touch the config file; if it differs (for example, a different model name), CC Switch updates the config file first, and Codex, Gemini CLI, and Grok Build then need a restart to use the new model.
|
||||
|
||||
|
||||
@@ -143,9 +143,9 @@ CC Switch を終了するときも、まず設定ファイルを直接接続の
|
||||
|
||||
1. 「ルーティング」タブでプロバイダーカードの「ここへ転送」をクリック(フェイルオーバー有効時は、キューで調整します。[4.3 フェイルオーバー](./4.3-failover.md) を参照)
|
||||
2. ルーティングサービスが新しいプロバイダーを使用してリクエストを即座に転送
|
||||
3. **CLI ツールの再起動は不要**
|
||||
3. **クライアント設定が変わらない場合、CLI ツールの再起動は不要**
|
||||
|
||||
これがルーティングモードの大きなメリットです:プロバイダーの切り替えが即座に反映されます。Codex、Gemini CLI、Grok Build を切り替えた後も画面には再起動の案内が表示されますが、ルーティング中で、切り替えによってモデルが変わらない限り、再起動しなくても構いません。
|
||||
ルーティング先を切り替えると、以降の新しいリクエストは新しいプロバイダーを使用します。処理中のリクエストは変わりません。成功通知では、ルーティング先の変更とクライアント設定の更新を区別します。接続先だけの変更なら再起動は不要です。クライアント設定も更新された場合は、Codex、Gemini CLI、Grok Build を再起動して更新後の設定を読み込んでください。
|
||||
|
||||
ルーティングモードで切り替わるのは、ルーティングが使うプロバイダーだけです。直接接続のプロバイダーはそのまま残り、カードに「直接接続」と表示され、ルーティングを抜けるとそのプロバイダーに戻ります。新しいプロバイダーが設定ファイルに書き込む内容(ローカルアドレス、モデル名など)が以前と同じであれば、切り替えても設定ファイルは変更されません。異なる場合(モデル名が違うなど)は、CC Switch が先に設定ファイルを更新します。このとき Codex、Gemini CLI、Grok Build は、新しいモデルを使うために再起動が必要です。
|
||||
|
||||
|
||||
@@ -143,9 +143,9 @@ GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:15721
|
||||
|
||||
1. 在「路由」标签里点击供应商卡片上的「路由到此」(故障转移开启时,改在队列里调整,见 [4.3 故障转移](./4.3-failover.md))
|
||||
2. 路由立即使用新供应商转发请求
|
||||
3. **无需重启 CLI 工具**
|
||||
3. **客户端配置未改变时,无需重启 CLI 工具**
|
||||
|
||||
这是路由模式的一大优势:切换供应商即时生效。切换 Codex、Gemini CLI 或 Grok Build 后,界面仍会提示重启;路由时,只要切换没有改变模型,就可以不重启。
|
||||
路由目标切换后,后续新请求会使用新供应商,正在进行的请求不变。成功提示会区分路由切换和客户端配置更新:只改变上游时无需重启;如果同时更新了客户端配置,Codex、Gemini CLI、Grok Build 需要重启才能加载这些配置。
|
||||
|
||||
路由模式下切换的只是路由使用的供应商,直连供应商保持不变,卡片上标「直连」,退出路由后回到它。如果新供应商写进配置文件的内容(本地地址、模型名等)和原来一样,切换时不会改动配置文件;不一样时(比如模型名不同),CC Switch 会先更新配置文件,这时 Codex、Gemini CLI、Grok Build 需要重启才能用上新模型。
|
||||
|
||||
|
||||
Reference in new issue
Block a user