Enable Codex goals in provider templates (#3089)

* Enable Codex goals in provider templates

* feat: add Codex goal mode toggle

- Remove forced goals=true from Codex provider presets and custom templates.
- Add a Codex provider editor switch that updates [features].goals on demand.
- Update docs, i18n, and regression coverage for the optional Goal mode flow.

---------

Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
Kairos Duan
2026-05-27 11:31:31 +08:00
committed by GitHub
parent e9d84af500
commit 3c3d417457
13 changed files with 325 additions and 25 deletions
@@ -268,10 +268,13 @@ requires_openai_auth = true
| `model` | Yes | Model to use (e.g., `gpt-5.2`, `gpt-4o`) |
| `model_reasoning_effort` | No | Reasoning effort: `low` / `medium` / `high` |
| `disable_response_storage` | No | Whether to disable response storage |
| `goals` | No | Enables Codex `/goal` mode when set under `[features]`; the provider editor can toggle this field for providers that need it |
| `base_url` | Yes | API endpoint URL |
| `wire_api` | No | API protocol type (usually `responses`) |
| `requires_openai_auth` | No | Whether to use OpenAI authentication |
If Codex recognizes `/goal` but cannot set a goal after switching to an API-key or custom endpoint provider, enable the provider editor's **Goal mode** switch. CC Switch writes `goals = true` under `[features]` for that provider's `~/.codex/config.toml`; restart Codex afterward. If Goal mode asks for approval more often than expected, refresh the Codex settings page and check that `approval_policy` and `sandbox_mode` still match your intended permission level.
### Gemini Configuration Format
@@ -268,10 +268,13 @@ requires_openai_auth = true
| `model` | はい | 使用するモデル(例:`gpt-5.2``gpt-4o` |
| `model_reasoning_effort` | いいえ | 推論強度:`low` / `medium` / `high` |
| `disable_response_storage` | いいえ | レスポンス保存を無効にするかどうか |
| `goals` | いいえ | `[features]` 配下で `true` にすると Codex の `/goal` モードを有効化します。必要なプロバイダーでは、プロバイダー編集画面のスイッチで切り替えられます |
| `base_url` | はい | API エンドポイントアドレス |
| `wire_api` | いいえ | API プロトコルタイプ(通常 `responses` |
| `requires_openai_auth` | いいえ | OpenAI 認証方式を使用するかどうか |
API Key またはカスタムエンドポイントのプロバイダーへ切り替えた後、Codex が `/goal` を認識しているのに目標を設定できない場合は、プロバイダー編集画面の **Goal mode** スイッチを有効にしてください。CC Switch はそのプロバイダーの `~/.codex/config.toml``[features]``goals = true` を書き込みます。その後、Codex を再起動してください。Goal mode 有効化後に想定より頻繁に承認を求められる場合は、Codex の設定画面を再読み込みし、`approval_policy``sandbox_mode` が意図した権限と一致しているか確認してください。
### Gemini 設定形式
@@ -268,10 +268,13 @@ requires_openai_auth = true
| `model` | 是 | 使用的模型(如 `gpt-5.2``gpt-4o` |
| `model_reasoning_effort` | 否 | 推理强度:`low` / `medium` / `high` |
| `disable_response_storage` | 否 | 是否禁用响应存储 |
| `goals` | 否 | 放在 `[features]` 下并设为 `true` 后启用 Codex `/goal` 模式;需要时可在供应商编辑区域通过开关启用 |
| `base_url` | 是 | API 端点地址 |
| `wire_api` | 否 | API 协议类型(通常为 `responses` |
| `requires_openai_auth` | 否 | 是否使用 OpenAI 认证方式 |
如果切换到 API Key 或自定义端点供应商后,Codex 能识别 `/goal`,但无法设置目标,请在供应商编辑区域打开 **Goal mode** 开关。CC Switch 会为该供应商在 `~/.codex/config.toml``[features]` 下写入 `goals = true`,之后请重启 Codex。如果启用 Goal mode 后比预期更频繁地请求批准,请刷新 Codex 设置页,并确认 `approval_policy``sandbox_mode` 仍符合你的权限预期。
### Gemini 配置格式