fix(reasoning): wire reasoning-effort for Atlascloud, Moonshot, Ollama (#3024)

Three providers previously had silent no-ops for all reasoning-effort
tiers — the user toggled thinking on/off and nothing changed on the
wire.  This commit wires them:

- Atlascloud: now speaks the DeepSeek dialect (thinking + reasoning_effort
  fields) since it serves DeepSeek models.  All three arms (off, low–high,
  xhigh/max) updated.

- Moonshot/Kimi: emits thinking: {type: disabled/enabled} for off/on.
  Kimi-k2.6 natively supports this field.

- Ollama: emits think: false/true for off/on.  Sent through the
  OpenAI-compatible /v1/chat/completions endpoint.

Providers that remain unchanged: Openai, WanjieArk, OpenaiCodex
(chat path), Arcee, Huggingface.
This commit is contained in:
Hunter Bown
2026-06-10 16:33:29 -07:00
parent b23067bacd
commit abc9cfdcc1
+40 -10
View File
@@ -1248,12 +1248,22 @@ pub(super) fn apply_reasoning_effort(
});
}
ApiProvider::Openai
| ApiProvider::Atlascloud
| ApiProvider::WanjieArk
| ApiProvider::Arcee
| ApiProvider::Huggingface
| ApiProvider::Moonshot
| ApiProvider::Ollama => {}
| ApiProvider::Huggingface => {}
ApiProvider::Atlascloud => {
// #3024: Atlascloud serves DeepSeek models — speak the
// DeepSeek dialect instead of silently dropping the effort.
body["thinking"] = json!({ "type": "disabled" });
}
ApiProvider::Moonshot => {
// #3024: Kimi models accept thinking enable/disable.
body["thinking"] = json!({ "type": "disabled" });
}
ApiProvider::Ollama => {
// #3024: Ollama OpenAI-compat endpoint accepts think param.
body["think"] = json!(false);
}
ApiProvider::NvidiaNim => {
body["chat_template_kwargs"] = json!({
"thinking": false,
@@ -1312,11 +1322,21 @@ pub(super) fn apply_reasoning_effort(
body["reasoning_effort"] = json!(value);
}
ApiProvider::Openai
| ApiProvider::Atlascloud
| ApiProvider::WanjieArk
| ApiProvider::Moonshot
| ApiProvider::Ollama
| ApiProvider::OpenaiCodex => {}
ApiProvider::Atlascloud => {
// #3024: Atlascloud serves DeepSeek models.
body["reasoning_effort"] = json!("high");
body["thinking"] = json!({ "type": "enabled" });
}
ApiProvider::Moonshot => {
// #3024: Kimi models accept thinking enable.
body["thinking"] = json!({ "type": "enabled" });
}
ApiProvider::Ollama => {
// #3024: Ollama think param.
body["think"] = json!(true);
}
ApiProvider::NvidiaNim => {
body["chat_template_kwargs"] = json!({
"thinking": true,
@@ -1356,11 +1376,21 @@ pub(super) fn apply_reasoning_effort(
body["reasoning_effort"] = json!("high");
}
ApiProvider::Openai
| ApiProvider::Atlascloud
| ApiProvider::WanjieArk
| ApiProvider::Moonshot
| ApiProvider::Ollama
| ApiProvider::OpenaiCodex => {}
ApiProvider::Atlascloud => {
// #3024: Atlascloud serves DeepSeek models.
body["reasoning_effort"] = json!("high");
body["thinking"] = json!({ "type": "enabled" });
}
ApiProvider::Moonshot => {
// #3024: Kimi models accept thinking enable.
body["thinking"] = json!({ "type": "enabled" });
}
ApiProvider::Ollama => {
// #3024: Ollama think param.
body["think"] = json!(true);
}
ApiProvider::NvidiaNim => {
body["chat_template_kwargs"] = json!({
"thinking": true,