feat: adaptive reasoning detection for Codex Chat providers

Auto-detect each Chat-routed Codex provider's reasoning interface from
its name, base URL, and model, then inject the matching thinking
parameter without manual configuration:

- Platform-first inference (OpenRouter, SiliconFlow) overrides model
  rules, since the same model exposes different reasoning controls
  depending on the hosting platform.
- Effort tiers are forwarded only to providers that support them
  (DeepSeek, OpenRouter, and StepFun's step-3.5-flash-2603); on/off-only
  providers (Kimi, GLM, Qwen, MiniMax, MiMo, SiliconFlow) drop the level
  instead of sending a field the upstream rejects.
- OpenRouter uses the native reasoning:{effort} object, clamps max to
  xhigh (its enum has no max), and forwards an explicit effort:"none" so
  reasoning can be turned off.
- StepFun falls back to inference so per-model effort support is honored
  (the static preset would have forced effort on step-3.5-flash too).

Includes the Codex provider-form reasoning controls, i18n strings
(zh/en/ja), and response-side reasoning extraction.
This commit is contained in:
Jason
2026-05-21 22:29:18 +08:00
parent 5048ed632d
commit 44d9aabbf3
13 changed files with 1058 additions and 16 deletions
+7 -1
View File
@@ -1103,7 +1103,13 @@
"catalogModelPlaceholder": "e.g., deepseek-v4-flash",
"catalogColumnDisplay": "Menu Display Name",
"catalogColumnModel": "Actual Request Model",
"catalogColumnContext": "Context Window"
"catalogColumnContext": "Context Window",
"reasoningModeToggle": "Supports Thinking Mode",
"reasoningModeHint": "Enable when the upstream Chat Completions API supports toggling thinking on/off. Providers like Kimi, GLM and Qwen usually fall into this category.",
"reasoningEffortToggle": "Supports Reasoning Effort",
"reasoningEffortHint": "Enable when the upstream supports thinking-depth control such as low/high/max. Enabling this also turns on thinking mode and converts Codex's reasoning.effort into the upstream Chat parameter.",
"reasoningSectionToggle": "Reasoning Capability (Advanced · usually auto-detected)",
"reasoningSectionHint": "Preset providers are configured automatically; custom providers are inferred from name/URL. Expand to override manually only when auto-detection is wrong."
},
"geminiConfig": {
"envFile": "Environment Variables (.env)",
+7 -1
View File
@@ -1103,7 +1103,13 @@
"catalogModelPlaceholder": "例: deepseek-v4-flash",
"catalogColumnDisplay": "メニュー表示名",
"catalogColumnModel": "実際のリクエストモデル",
"catalogColumnContext": "コンテキストウィンドウ"
"catalogColumnContext": "コンテキストウィンドウ",
"reasoningModeToggle": "思考モードに対応",
"reasoningModeHint": "上流の Chat Completions API が思考(thinking)のオン/オフ切り替えに対応している場合に有効化します。Kimi、GLM、Qwen などが通常このタイプに該当します。",
"reasoningEffortToggle": "思考レベルに対応",
"reasoningEffortHint": "上流が low/high/max などの思考の深さの制御に対応している場合に有効化します。有効にすると思考モードも自動的にオンになり、Codex の reasoning.effort を上流の Chat パラメータに変換します。",
"reasoningSectionToggle": "思考能力(詳細・通常は自動識別)",
"reasoningSectionHint": "プリセットの供給元は自動的に設定され、カスタム供給元は名前/URL から自動推論されます。自動識別が正しくない場合のみ展開して手動で上書きしてください。"
},
"geminiConfig": {
"envFile": "環境変数 (.env)",
+7 -1
View File
@@ -1103,7 +1103,13 @@
"catalogModelPlaceholder": "例如: deepseek-v4-flash",
"catalogColumnDisplay": "菜单显示名",
"catalogColumnModel": "实际请求模型",
"catalogColumnContext": "上下文窗口"
"catalogColumnContext": "上下文窗口",
"reasoningModeToggle": "支持思考模式",
"reasoningModeHint": "上游 Chat Completions 接口支持开启或关闭 thinking 时启用。Kimi、GLM、Qwen 等通常属于这一类。",
"reasoningEffortToggle": "支持思考等级",
"reasoningEffortHint": "上游支持 low/high/max 等思考深度控制时启用。启用后会自动启用思考模式,并把 Codex 的 reasoning.effort 转成上游 Chat 参数。",
"reasoningSectionToggle": "思考能力(高级·通常自动识别)",
"reasoningSectionHint": "预设供应商已自动配置;自定义供应商会按名称/地址自动推断。仅当自动识别不准时才需展开手动覆盖。"
},
"geminiConfig": {
"envFile": "环境变量 (.env)",