From 04af87bc7b4fba50b5530a6bdc9d956e118fea7f Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 21 May 2026 09:42:44 +0800 Subject: [PATCH] docs: document Codex Chat provider support in changelog and manual Backfill the empty [Unreleased] CHANGELOG section with the Codex Chat Completions feature (Chat-to-Responses bridge, 23 third-party presets, model mapping table, Stream Check routing, error-envelope conversion, "custom" history bucket) plus the community fixes landed since v3.15.0. Update the zh/en/ja user manual: split the Codex preset tables by upstream protocol (native Responses vs Chat Completions), add a "Codex Local Routing and Model Mapping" section covering the Needs Local Routing toggle and the model catalog, and note Chat-format probing in the Stream Check guide. Manual wording matches the live UI strings. --- CHANGELOG.md | 37 +++++++++++ docs/user-manual/en/2-providers/2.1-add.md | 61 +++++++++++++++++-- docs/user-manual/en/4-proxy/4.5-model-test.md | 2 + docs/user-manual/ja/2-providers/2.1-add.md | 61 +++++++++++++++++-- docs/user-manual/ja/4-proxy/4.5-model-test.md | 2 + docs/user-manual/zh/2-providers/2.1-add.md | 61 +++++++++++++++++-- docs/user-manual/zh/4-proxy/4.5-model-test.md | 2 + 7 files changed, 214 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34a851568..ff31efd37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- **Codex Chat Completions Routing**: Codex providers can now be served by upstreams that only speak the OpenAI Chat Completions API. CC Switch's local proxy converts Codex's outgoing Responses requests into Chat Completions and rebuilds the Chat response (both JSON and SSE) back into Responses shape, preserving `reasoning_content`, inline `` blocks, streamed reasoning summaries, tool calls, and `previous_response_id` follow-ups. A bounded Codex Chat history cache restores tool calls before their tool outputs. +- **23 Codex Third-Party Provider Presets with Chat Routing**: Enabled Chat Completions routing with explicit model catalogs for major Chinese/Asian providers — DeepSeek, Zhipu GLM (+ en), Kimi, Kimi For Coding, MiniMax (+ en), StepFun (+ en), Baidu Qianfan Coding Plan, Bailian, ModelScope, Longcat, BaiLing, Xiaomi MiMo (+ Token Plan), Volcengine Agentplan, BytePlus, DouBao Seed, SiliconFlow (+ en), Novita AI, and Nvidia. Each preset declares its context window so the UI can size the model-mapping rows. +- **Codex Model Mapping Table**: Codex provider forms now expose a model catalog (model + display name + context window per row) that is the single source of truth for the upstream model list, projected to `~/.codex/cc-switch-model-catalog.json`. +- **Codex Chat Providers in Stream Check**: Stream Check now probes Chat-format Codex providers against `/chat/completions` with a Chat-shaped body instead of `/v1/responses`, and aligns its URL fallback order with the production `CodexAdapter` (origin-only base URLs hit `/v1/` first) so a non-404 error on the bare path no longer flags a working provider as down. +- **Xiaomi MiMo Token Plan Presets**: Added Xiaomi MiMo Token Plan presets with specs aligned to the official documentation (#2803). +- **Claude Desktop Official Preset**: Added a Claude Desktop Official preset that restores the native Claude Desktop login, plus a localized Claude Desktop user guide (en / zh / ja). + +### Changed + +- **Codex Third-Party Providers Unified into a "custom" History Bucket**: Codex filters resume history by `model_provider`, so switching between provider-specific ids made past sessions appear to vanish. All third-party providers now normalize to a single stable `custom` bucket (reserved built-in ids like `openai` / `ollama` are preserved), with a one-shot device migration that rewrites historical JSONL sessions and the `state_5.sqlite` threads table and backs up originals under `~/.cc-switch/backups/codex-history-provider-migration-v1/`. +- **Codex Provider Form Simplified**: Removed the API Format selector from the Codex form (`wire_api` is always `responses`, so the selector misleadingly implied a protocol change); the model mapping table is now the only source of truth with no hidden default entries, and the form notes that a Codex restart is required after catalog changes since `model_catalog_json` is loaded at startup. Only the "Needs Local Routing" toggle remains. +- **Codex Local Routing Toggle Hints Rewritten**: Reframed the OFF / ON hints as action guidance (when to enable) rather than scenario descriptions, synced across zh / en / ja. +- **Homebrew Official Cask Installation**: Installation simplified to `brew install --cask cc-switch` now that CC Switch is in the official Homebrew repository; the personal-tap requirement was removed from all READMEs. + +### Fixed + +- **Codex Chat Error Responses Converted to Responses Envelope**: The Codex Chat-to-Responses bridge previously passed upstream error bodies through untouched, leaving Codex clients unable to recognize MiniMax `base_resp`, raw OpenAI Chat errors, or plain-text / HTML error pages. Errors are now regularized into the standard `{error: {message, type, code, param}}` envelope with the original HTTP status preserved; non-JSON bodies are wrapped and truncated to 1KB at a UTF-8 char boundary. Also fixed a pre-existing append-vs-insert bug that emitted a duplicate `Content-Type` header on rewritten JSON bodies. +- **Codex Mid-Stream System Messages Collapsed**: MiniMax's OpenAI-compatible endpoint strict-rejects any non-leading `system` message (error 2013). All `system` fragments are now collapsed into a single leading message (joined in original order), losslessly for permissive backends too. +- **Codex Model Catalog Wiped After Restart**: Editing the active Codex provider triggered a live read that omitted `modelCatalog`, so a subsequent save silently destroyed user-configured model mappings. Live reads now reverse-parse the on-disk catalog projection to round-trip the same shape the save path writes. +- **Codex Model Catalog Infinite Render Loop**: Broke a bidirectional sync cycle between the catalog table and its parent state that caused severe UI jittering when adding or editing entries. +- **Codex Chat Preserves User-Selected Catalog Model**: A model the client selects from the catalog (e.g. via `/model`) is no longer overwritten by `config.toml`'s default model. +- **Codex Chat Reasoning and Cache Stability**: Restored a unique call-id fallback when Codex omits or rewrites `previous_response_id`, stopped deriving cache identity from `previous_response_id`, and canonicalized parseable JSON string payloads in tool conversions for stable prefix-cache reuse. +- **Managed-Account Claude Takeover Auth**: Managed-account providers (GitHub Copilot / Codex OAuth) now drop token env keys and write only the `ANTHROPIC_API_KEY` placeholder when taking over Claude Live config, with an outbound guard that refuses to send the `PROXY_MANAGED` placeholder upstream. +- **Gemini Native Tool-Call Robustness**: Fixed `functionResponse.name` resolution (422) and `thought_signature` replay (400) for synthesized tool-call IDs in long multi-turn sessions (#2814). +- **Session Log Subagent Token Accounting**: `collect_jsonl_files()` now scans subagent JSONL logs that were previously missed, so subagent token usage is counted in session cost (session-log mode only) (#2821). +- **Skills Install by Key**: Installing from skills.sh search results now uses the unique key instead of the directory name, so skills that share a directory name install the correct one (#2784); also fixed a skill sync copy fallback (#2791). +- **Usage Price Input Precision**: Reduced the price input step to 0.0001 so sub-cent costs like DeepSeek cache reads can be entered (#2793, closes #2503). +- **Ghostty Clean Window Launch**: Ghostty now opens a single clean window instead of cloning existing tabs, and other terminals open a new window via `open -na` (#2801, closes #2798). +- **Codex mise Detection**: Fixed Codex mise environment detection (#2822). +- **useEffect Race Condition**: Added an active-flag pattern to App.tsx effects to prevent listener leaks on unmount, and guarded against storing `undefined` language in localStorage (#2827). + +### Removed + +- **LionCC Sponsor and Presets**: Removed the LionCC sponsor entry and LionCCAPI presets across READMEs, provider configs, and locales (icon asset retained). + ## [3.15.0] - 2026-05-16 Development since v3.14.1 focuses on a dedicated Claude Desktop surface with third-party provider switching through a proxy gateway, a large reverse-proxy hardening pass (reliability, retries, cache, takeover, Gemini/Vertex/Codex paths), expansion of the third-party provider preset catalog (BytePlus / Volcengine / ClaudeAPI / ClaudeCN / RunAPI / RelaxyCode / PatewayAI / Baidu Qianfan), role-based model mapping with a 1M context flag, Codex OAuth live model discovery, and a long tail of usage, OAuth, Codex, and session quality-of-life fixes. diff --git a/docs/user-manual/en/2-providers/2.1-add.md b/docs/user-manual/en/2-providers/2.1-add.md index fc2d7cc00..2aadaeefb 100644 --- a/docs/user-manual/en/2-providers/2.1-add.md +++ b/docs/user-manual/en/2-providers/2.1-add.md @@ -68,6 +68,10 @@ See [2.6 Claude Desktop](./2.6-claude-desktop.md) for the full workflow. #### Codex Presets +Codex presets fall into two groups by upstream protocol. + +**Native Responses protocol** (direct connection or standard proxy forwarding): + | Preset Name | Description | |-------------|-------------| | OpenAI Official | Log in with an OpenAI official account | @@ -75,11 +79,32 @@ See [2.6 Claude Desktop](./2.6-claude-desktop.md) for the full workflow. | AiHubMix | AiHubMix aggregation service | | DMXAPI | DMXAPI proxy service | | PackyCode | PackyCode proxy service | -| Cubence | Cubence service | -| AIGoCode | AIGoCode service | -| RightCode | RightCode service | -| AICodeMirror | AICodeMirror service | | OpenRouter | Aggregation routing service | +| Cubence / AIGoCode / RightCode / AICodeMirror, etc. | Various proxy services | + +**Chat Completions protocol** (requires the **Needs Local Routing** toggle; converted automatically by the proxy): + +| Preset Name | Description | +|-------------|-------------| +| DeepSeek | DeepSeek models | +| Zhipu GLM / GLM en | Zhipu AI GLM models | +| Kimi / Kimi For Coding | Moonshot Kimi models | +| MiniMax / MiniMax en | MiniMax models | +| StepFun / StepFun en | StepFun Step models | +| Baidu Qianfan Coding Plan | Baidu Qianfan coding plan | +| Bailian | Alibaba Cloud Bailian (Qwen) | +| ModelScope | ModelScope community | +| Longcat | Longcat AI | +| BaiLing | BaiLing AI | +| Xiaomi MiMo / MiMo Token Plan | Xiaomi MiMo models | +| Volcengine Agentplan | Volcengine Agent Plan | +| BytePlus | BytePlus service | +| DouBaoSeed | DouBao Seed models | +| SiliconFlow / SiliconFlow en | SiliconFlow | +| Novita AI | Novita AI service | +| Nvidia | Nvidia AI service | + +> 💡 When you pick a Chat Completions preset, the **Needs Local Routing** toggle and the model mapping table are configured automatically; see the "Codex Local Routing and Model Mapping" section below. The preset list is updated continuously — refer to the in-app list for the authoritative version. #### Gemini Presets @@ -528,6 +553,34 @@ When a toggle is unchecked, its corresponding config entry is removed entirely. Additionally, the **Write Common Config** checkbox enables merging a global config snippet into the provider. Click **Edit Common Config** to customize the shared snippet. +### Codex Local Routing and Model Mapping + +Some third-party providers only support the **OpenAI Chat Completions** protocol or use non-GPT model names (such as DeepSeek, Kimi, or MiniMax). Codex natively understands only the OpenAI Responses API and GPT-series models, so these providers need CC Switch to convert the protocol and models locally. + +#### Needs Local Routing + +When editing a Codex provider, a **Needs Local Routing** toggle is available: + +- **When to enable**: the provider uses the Chat Completions protocol, or its model names are not Codex's default GPT series +- **When enabled**: CC Switch's local proxy converts the Responses requests Codex sends into upstream Chat Completions, then converts the response (including streaming SSE, reasoning content, and tool calls) back into Responses format +- **Prerequisite**: [local routing](../4-proxy/4.1-service.md) must be running with Codex takeover enabled for conversion to take effect; keep local routing running while in use + +> 💡 When you pick a Chat-format preset such as DeepSeek or Kimi, this toggle is enabled by default — no manual setup needed. + +#### Model Mapping + +Once **Needs Local Routing** is enabled, a **Model Mapping** table appears below it to declare the models available for this provider: + +| Field | Description | +|-------|-------------| +| Model ID | The real upstream model name, e.g. `deepseek-v4-flash` | +| Display Name | (Optional) The name shown in the `/model` command | +| Context Window | (Optional) The model's context length | + +- The mapping table generates Codex's `model_catalog_json` so the `/model` command lists these third-party model names +- Entries are saved exactly as listed and are the single source of truth for the model list +- **Codex must be restarted** to refresh the model list after changes (`model_catalog_json` is loaded at Codex startup) + ### Codex 1M Context Window When adding a Codex provider, an **Enable 1M Context Window** toggle is available: diff --git a/docs/user-manual/en/4-proxy/4.5-model-test.md b/docs/user-manual/en/4-proxy/4.5-model-test.md index 62b5c3f41..fd4dec61b 100644 --- a/docs/user-manual/en/4-proxy/4.5-model-test.md +++ b/docs/user-manual/en/4-proxy/4.5-model-test.md @@ -12,6 +12,8 @@ The model test feature (also known as **Stream Check**) verifies whether a provi Starting from v3.13.0, Stream Check coverage is extended to **Claude / Codex / Gemini / OpenCode / OpenClaw**, including all OpenClaw protocol variants (such as `openai-completions`). OpenCode is auto-detected via npm package mapping; OpenClaw supports custom `auth-header` detection and handles edge cases like Bedrock error messages and `baseURL` fallback. +For Codex third-party providers that use the Chat Completions protocol (such as DeepSeek, Kimi, or MiniMax), Stream Check probes the `/chat/completions` endpoint (instead of `/responses`) and aligns its URL fallback order with the actual proxy forwarding path (origin-only addresses try `/v1/...` first), so a working provider is not mistakenly flagged as unavailable. + ## Open Configuration Settings > Advanced > Model Test Config diff --git a/docs/user-manual/ja/2-providers/2.1-add.md b/docs/user-manual/ja/2-providers/2.1-add.md index 30ab96d33..55688e662 100644 --- a/docs/user-manual/ja/2-providers/2.1-add.md +++ b/docs/user-manual/ja/2-providers/2.1-add.md @@ -68,6 +68,10 @@ Claude Desktop パネルには、Claude Code のプリセットカタログか #### Codex プリセット +Codex プリセットは上流プロトコルにより 2 種類に分かれます。 + +**ネイティブ Responses プロトコル**(直接接続または標準プロキシ転送): + | プリセット名 | 説明 | |----------|------| | OpenAI 公式 | OpenAI 公式アカウントでログイン | @@ -75,11 +79,32 @@ Claude Desktop パネルには、Claude Code のプリセットカタログか | AiHubMix | AiHubMix 統合サービス | | DMXAPI | DMXAPI 中継サービス | | PackyCode | PackyCode 中継サービス | -| Cubence | Cubence サービス | -| AIGoCode | AIGoCode サービス | -| RightCode | RightCode サービス | -| AICodeMirror | AICodeMirror サービス | | OpenRouter | 統合ルーティングサービス | +| Cubence / AIGoCode / RightCode / AICodeMirror など | 各種中継サービス | + +**Chat Completions プロトコル**(「ローカルルーティングが必要」トグルが必要。プロキシが自動変換): + +| プリセット名 | 説明 | +|----------|------| +| DeepSeek | DeepSeek モデル | +| Zhipu GLM / GLM en | Zhipu AI の GLM モデル | +| Kimi / Kimi For Coding | Moonshot Kimi モデル | +| MiniMax / MiniMax en | MiniMax モデル | +| StepFun / StepFun en | StepFun Step モデル | +| Baidu Qianfan Coding Plan | 百度千帆コーディングプラン | +| Bailian | Alibaba Cloud 百錬(Qwen) | +| ModelScope | ModelScope コミュニティ | +| Longcat | Longcat AI | +| BaiLing | BaiLing AI | +| Xiaomi MiMo / MiMo Token Plan | Xiaomi MiMo モデル | +| Volcengine Agentplan | Volcengine Agent Plan | +| BytePlus | BytePlus サービス | +| DouBaoSeed | DouBao Seed モデル | +| SiliconFlow / SiliconFlow en | SiliconFlow | +| Novita AI | Novita AI サービス | +| Nvidia | Nvidia AI サービス | + +> 💡 Chat Completions 系プリセットを選択すると、「ローカルルーティングが必要」トグルとモデルマッピング表が自動的に設定されます。詳細は下記の「Codex ローカルルーティングとモデルマッピング」セクションを参照してください。プリセット一覧は継続的に更新されます。アプリ内の表示を正としてください。 #### Gemini プリセット @@ -528,6 +553,34 @@ Claude プロバイダーの編集時、JSON エディタの上部に **クイ また、**共通設定を書き込み** チェックボックスを有効にすると、グローバル設定スニペットをプロバイダーにマージできます。**共通設定を編集** をクリックして共有スニペットをカスタマイズできます。 +### Codex ローカルルーティングとモデルマッピング + +一部の第三者プロバイダーは **OpenAI Chat Completions** プロトコルのみをサポートするか、非 GPT モデル名(DeepSeek、Kimi、MiniMax など)を使用します。Codex はネイティブには OpenAI Responses API と GPT 系列モデルのみを認識するため、これらのプロバイダーでは CC Switch がローカルでプロトコルとモデルを変換する必要があります。 + +#### ローカルルーティングが必要 + +Codex プロバイダーの編集時、**ローカルルーティングが必要** トグルが利用できます: + +- **有効にするタイミング**:プロバイダーが Chat Completions プロトコルを使用する、またはモデル名が Codex デフォルトの GPT 系列でない場合 +- **有効時**:CC Switch のローカルプロキシが、Codex の送信する Responses リクエストを上流の Chat Completions に変換し、レスポンス(ストリーミング SSE、推論内容、ツール呼び出しを含む)を Responses 形式に再変換します +- **前提条件**:変換を有効にするには[ローカルルーティング](../4-proxy/4.1-service.md)を起動し、Codex の引き継ぎを有効にする必要があります。使用中はローカルルーティングを起動したままにしてください + +> 💡 DeepSeek や Kimi などの Chat 形式プリセットを選択すると、このトグルはデフォルトで有効になっており、手動設定は不要です。 + +#### モデルマッピング + +**ローカルルーティングが必要** を有効にすると、その下に **モデルマッピング** 表が表示され、このプロバイダーで利用可能なモデルを宣言できます: + +| フィールド | 説明 | +|------|------| +| モデル ID | 上流の実際のモデル名(例:`deepseek-v4-flash`) | +| 表示名 | (任意)`/model` コマンドに表示される名称 | +| コンテキストウィンドウ | (任意)モデルのコンテキスト長 | + +- マッピング表は Codex の `model_catalog_json` を生成し、`/model` コマンドでこれらの第三者モデル名を表示できるようにします +- リストの内容はそのまま保存され、モデルリストの唯一の情報源となります +- 変更後、モデルリストを更新するには **Codex の再起動が必要** です(`model_catalog_json` は Codex 起動時に読み込まれます) + ### Codex 1M コンテキストウィンドウ Codex プロバイダーの追加時、**1M コンテキストウィンドウを有効化** トグルが利用できます: diff --git a/docs/user-manual/ja/4-proxy/4.5-model-test.md b/docs/user-manual/ja/4-proxy/4.5-model-test.md index 9bad18faa..2fa0f44c6 100644 --- a/docs/user-manual/ja/4-proxy/4.5-model-test.md +++ b/docs/user-manual/ja/4-proxy/4.5-model-test.md @@ -12,6 +12,8 @@ v3.13.0 より、Stream Check の対応範囲が **Claude / Codex / Gemini / OpenCode / OpenClaw** に拡張され、OpenClaw の全プロトコルバリアント(`openai-completions` など)も含まれます。OpenCode は npm パッケージマッピングで自動識別、OpenClaw はカスタム `auth-header` 検出、Bedrock エラーメッセージ、`baseURL` フォールバックなどのエッジケースにも対応しています。 +Chat Completions プロトコルを使用する Codex 第三者プロバイダー(DeepSeek、Kimi、MiniMax など)の場合、Stream Check は `/responses` ではなく `/chat/completions` エンドポイントをプローブし、実際のプロキシ転送パスと URL フォールバック順序を一致させます(origin-only アドレスは `/v1/...` を優先)。これにより、使用可能なプロバイダーが誤って利用不可と判定されることを防ぎます。 + ## 設定を開く 設定 → 詳細 → モデルテスト diff --git a/docs/user-manual/zh/2-providers/2.1-add.md b/docs/user-manual/zh/2-providers/2.1-add.md index 39f2c887a..4d7429c62 100644 --- a/docs/user-manual/zh/2-providers/2.1-add.md +++ b/docs/user-manual/zh/2-providers/2.1-add.md @@ -68,6 +68,10 @@ Claude Desktop 面板内置从 Claude Code 预设目录转换而来的供应商 #### Codex 预设 +Codex 预设按上游协议分两类。 + +**原生 Responses 协议**(可直连或经标准代理转发): + | 预设名称 | 说明 | |----------|------| | OpenAI 官方 | 使用 OpenAI 官方账号登录 | @@ -75,11 +79,32 @@ Claude Desktop 面板内置从 Claude Code 预设目录转换而来的供应商 | AiHubMix | AiHubMix 聚合服务 | | DMXAPI | DMXAPI 中转服务 | | PackyCode | PackyCode 中转服务 | -| Cubence | Cubence 服务 | -| AIGoCode | AIGoCode 服务 | -| RightCode | RightCode 服务 | -| AICodeMirror | AICodeMirror 服务 | | OpenRouter | 聚合路由服务 | +| Cubence / AIGoCode / RightCode / AICodeMirror 等 | 各类中转服务 | + +**Chat Completions 协议**(需开启「需要本地路由映射」,由代理自动转换): + +| 预设名称 | 说明 | +|----------|------| +| DeepSeek | DeepSeek 模型 | +| 智谱 GLM / GLM en | 智谱 AI 的 GLM 模型 | +| Kimi / Kimi For Coding | Moonshot Kimi 模型 | +| MiniMax / MiniMax en | MiniMax 模型 | +| StepFun / StepFun en | 阶跃星辰 Step 模型 | +| 百度千帆 Coding Plan | 百度千帆编程套餐 | +| 百炼 | 阿里云百炼(通义千问) | +| ModelScope | 魔搭社区 | +| Longcat | Longcat AI | +| 百灵 (BaiLing) | 百灵 AI | +| 小米 MiMo / MiMo Token Plan | 小米 MiMo 模型 | +| 火山 Agentplan | 火山引擎 Agent Plan | +| BytePlus | BytePlus 服务 | +| DouBaoSeed | 豆包 Seed 模型 | +| SiliconFlow / SiliconFlow en | 硅基流动 | +| Novita AI | Novita AI 服务 | +| Nvidia | Nvidia AI 服务 | + +> 💡 选择 Chat Completions 类预设时,「需要本地路由映射」开关和模型映射表会自动配置好,无需手动设置;详见下文「Codex 本地路由与模型映射」一节。预设列表持续更新,以应用内实际显示为准。 #### Gemini 预设 @@ -528,6 +553,34 @@ v3.13.0 起新增的高级选项。默认情况下,CC Switch 会把配置的 ` 此外,**写入通用配置** 复选框可将全局配置片段合并到供应商中。点击 **编辑通用配置** 可自定义共享的配置片段。 +### Codex 本地路由与模型映射 + +部分第三方供应商只支持 **OpenAI Chat Completions** 协议,或使用非 GPT 模型名(如 DeepSeek、Kimi、MiniMax)。Codex 原生只认 OpenAI Responses API 与 GPT 系列模型,因此这类供应商需要 CC Switch 在本地做协议与模型转换。 + +#### 需要本地路由映射 + +编辑 Codex 供应商时,提供 **需要本地路由映射** 开关: + +- **何时打开**:供应商使用 Chat Completions 协议,或模型名不是 Codex 默认的 GPT 系列 +- **打开后**:CC Switch 本地代理会把 Codex 发出的 Responses 请求转换为上游的 Chat Completions,再把响应(含流式 SSE、推理内容、工具调用)转换回 Responses 格式 +- **前提条件**:必须开启[本地路由服务](../4-proxy/4.1-service.md)并启用 Codex 接管,转换才会生效;使用过程中需保持本地路由开启 + +> 💡 选择 DeepSeek、Kimi 等 Chat 格式预设时,此开关默认已打开,无需手动设置。 + +#### 模型映射 + +「需要本地路由映射」开启后,下方会出现 **模型映射** 表,用于声明该供应商可用的模型: + +| 字段 | 说明 | +|------|------| +| 模型 ID | 上游真实模型名,如 `deepseek-v4-flash` | +| 显示名称 | (可选)在 `/model` 命令中显示的名称 | +| 上下文窗口 | (可选)模型的上下文长度 | + +- 映射表会生成 Codex 的 `model_catalog_json`,让 Codex 的 `/model` 命令列出这些第三方模型名 +- 表中条目按填写内容原样保存,是模型列表的唯一来源 +- **修改后需要重启 Codex** 才能刷新模型列表(`model_catalog_json` 在 Codex 启动时加载) + ### Codex 1M 上下文窗口 添加 Codex 供应商时,提供 **启用 1M 上下文窗口** 开关: diff --git a/docs/user-manual/zh/4-proxy/4.5-model-test.md b/docs/user-manual/zh/4-proxy/4.5-model-test.md index 331906609..ced323e0e 100644 --- a/docs/user-manual/zh/4-proxy/4.5-model-test.md +++ b/docs/user-manual/zh/4-proxy/4.5-model-test.md @@ -12,6 +12,8 @@ v3.13.0 起,Stream Check 覆盖范围扩展到 **Claude / Codex / Gemini / OpenCode / OpenClaw**,包括 OpenClaw 的全部协议变体(`openai-completions` 等)。OpenCode 通过 npm 包映射自动识别;OpenClaw 支持自定义 `auth-header` 检测,并处理了 Bedrock 错误消息、`baseURL` 回退等边界情况。 +对于使用 Chat Completions 协议的 Codex 第三方供应商(如 DeepSeek、Kimi、MiniMax),Stream Check 会探测 `/chat/completions` 端点(而非 `/responses`),并与代理实际转发的 URL 顺序保持一致(origin-only 地址优先尝试 `/v1/...`),避免把可用供应商误判为不可用。 + ## 打开配置 设置 → 高级 → 模型测试