fix(openai): preserve provider-specific reasoning disable intent (#366)

This commit is contained in:
Ed1s0nZ committed 2026-10-21 15:43:53 +08:00
1 parent be2c8c04e5
commit 5c5c5e199d
13 files changed
+566 -11

No files matched your search

+12
View File
@@ -76,6 +76,18 @@ ai:
The chat page reads saved channels into the “AI Channel” selector. A non-empty request `aiChannelId` selects a channel for that run/session without sending API credentials through the prompt path. Empty `aiChannelId` follows `ai.default_channel`.
### Disabling reasoning by provider and model
Use `reasoning.mode: off` (or **Reasoning → Off** in chat) to disable reasoning. The request format depends on the channel:
- On `https://api.openai.com/v1`, with an OpenAI-compatible provider and the `auto` or `openai_compat` profile, known models that support `none` send `reasoning_effort: "none"`. This covers GPT-5.5, GPT-5.6 (Sol/Terra/Luna and the `gpt-5.6` alias), GPT-6 Sol/Luna, and their dated snapshots. These models also accept `reasoning.effort: none` in configuration or the request. Planner requests retain explicit `none` through forced tool selection.
- DeepSeek channels using the `auto` or `deepseek_compat` profile retain `thinking: {type: disabled}` when off. An explicit profile takes precedence over automatic detection.
- Other models and third-party gateways retain the existing behavior: off omits reasoning fields. A gateway using an OpenAI model name is not automatically treated as the native OpenAI service.
For GPT-5.6 and GPT-6 Sol/Luna function tools on Chat Completions, choose **Off** explicitly; leaving effort unspecified uses the model's default reasoning and does not disable it. Requests combining these tools with reasoning return guidance to turn reasoning off instead of silently changing the requested effort. GPT-6.1 Sol and GPT-6 Astra require the Responses API for tools and do not support `none`; this Chat Completions backend reports that limitation and requires selecting a compatible model. Changing only `base_url` to a Responses URL does not adapt the protocol. See the [official reasoning guide](https://developers.openai.com/api/docs/guides/reasoning).
When `allow_client_reasoning: false`, chat/request reasoning overrides are ignored and the channel's settings apply.
Common Web UI operations:
- Add: click `+`, fill required fields, then save.
+12
View File
@@ -75,6 +75,18 @@ ai:
| `max_completion_tokens` | 单次模型输出上限;未填时使用默认值。 |
| `reasoning` | 该通道的默认推理扩展字段。不同网关支持差异较大,异常时先尝试 `mode: off`。 |
### 按提供商和模型关闭推理
使用 `reasoning.mode: off`,或在对话中选择“推理 → 关闭”。实际请求参数按通道区分:
- 官方 `https://api.openai.com/v1`、OpenAI 兼容提供商、`auto` 或 `openai_compat` profile 下,已知支持 `none` 的模型发送 `reasoning_effort: "none"`。覆盖 GPT-5.5、GPT-5.6(Sol/Terra/Luna 及 `gpt-5.6` 别名)、GPT-6 Sol/Luna 和对应日期快照;这些模型也接受配置或请求中的 `reasoning.effort: none`。Planner 的强制工具选择同样保留显式 `none`。
- DeepSeek 在 `auto` 或 `deepseek_compat` profile 下,关闭时仍发送 `thinking: {type: disabled}`。显式 profile 优先于自动识别。
- 其他模型和第三方兼容网关保持原有行为:关闭时省略推理字段。第三方网关使用 OpenAI 同名模型,不会被自动视为官方服务。
GPT-5.6 和 GPT-6 Sol/Luna 在 Chat Completions 中使用函数工具时,应明确选择“关闭”;不指定强度会采用模型默认推理,不等同于关闭。工具与推理不兼容时会提示关闭推理,不会静默改写用户选择的强度。GPT-6.1 Sol 和 GPT-6 Astra 不支持 `none`,工具调用必须使用 Responses;当前 Chat Completions 后端会明确提示该限制,需要选择兼容模型。仅把 `base_url` 改成 Responses URL 不能完成协议适配。详见 [OpenAI 官方推理说明](https://developers.openai.com/api/docs/guides/reasoning)。
`allow_client_reasoning: false` 时忽略对话或请求的推理覆盖,按通道设置执行。
对话页的“AI 通道”下拉框会读取已保存通道。请求体中的 `aiChannelId` 非空时仅对本次/本会话运行配置生效,不会把 API Key 发送给模型;为空时跟随 `ai.default_channel`。
常用操作: