refactor(codex): remove configuration wizard and unify provider setup experience

- Remove CodexQuickWizardModal component (~300 lines)
- Add "Custom (Blank Template)" preset with annotated TOML template
- Unify configuration experience across Claude/Codex/Gemini
- Remove wizard-related i18n keys, keep apiUrlLabel for CodexFormFields
- Simplify component integration by removing wizard state management

This change reduces code complexity by ~250 lines while providing better
user education through commented configuration templates in Chinese.

Users can now:
1. Select "Custom (Blank Template)" preset
2. See annotated TOML template with inline documentation
3. Follow step-by-step comments to configure custom providers

BREAKING CHANGE: Configuration wizard UI removed, replaced with template-based approach
This commit is contained in:
Jason
2025-11-16 12:29:18 +08:00
parent 031ea3a58f
commit 6a6980c82c
7 changed files with 49 additions and 419 deletions

View File

@@ -98,6 +98,52 @@ requires_openai_auth = true`,
textColor: "#FFFFFF",
},
},
{
name: "Custom (Blank Template)",
websiteUrl: "https://docs.anthropic.com",
category: "third_party",
isCustomTemplate: true,
auth: generateThirdPartyAuth(""),
config: `# ========================================
# Codex 自定义供应商配置模板
# ========================================
# 快速上手:
# 1. 在上方 auth.json 中设置 API Key
# 2. 将下方 'custom' 替换为供应商名称(小写、无空格)
# 3. 替换 base_url 为实际的 API 端点
# 4. 根据需要调整模型名称
#
# 文档: https://docs.anthropic.com
# ========================================
# ========== 模型配置 ==========
model_provider = "custom" # 供应商唯一标识
model = "gpt-5-codex" # 模型名称
model_reasoning_effort = "high" # 推理强度low, medium, high
disable_response_storage = true # 隐私:不本地存储响应
# ========== 供应商设置 ==========
[model_providers.custom]
name = "custom" # 与上方 model_provider 保持一致
base_url = "https://api.example.com/v1" # 👈 替换为实际端点
wire_api = "responses" # API 响应格式
requires_openai_auth = true # 使用 auth.json 中的 OPENAI_API_KEY
# ========== 可选:自定义请求头 ==========
# 如果供应商需要自定义请求头,取消注释:
# [model_providers.custom.headers]
# X-Custom-Header = "value"
# ========== 可选:模型覆盖 ==========
# 如果需要覆盖特定模型,取消注释:
# [model_overrides]
# "gpt-5-codex" = { model_provider = "custom", model = "your-model-name" }`,
theme: {
icon: "generic",
backgroundColor: "#6B7280", // gray-500
textColor: "#FFFFFF",
},
},
{
name: "AiHubMix",
websiteUrl: "https://aihubmix.com",