From abc9cfdcc1c73c316f0b7fb467bffbd5717071f1 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Wed, 10 Jun 2026 16:33:29 -0700 Subject: [PATCH 1/3] fix(reasoning): wire reasoning-effort for Atlascloud, Moonshot, Ollama (#3024) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- crates/tui/src/client.rs | 50 ++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/crates/tui/src/client.rs b/crates/tui/src/client.rs index f7eb50b8..9d84b173 100644 --- a/crates/tui/src/client.rs +++ b/crates/tui/src/client.rs @@ -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, From 2d7d5e55ed30ef37185a22c60d0e41e82c99eadd Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Wed, 10 Jun 2026 16:40:37 -0700 Subject: [PATCH 2/3] style: cargo fmt Co-Authored-By: Claude Fable 5 --- crates/tui/src/client.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/tui/src/client.rs b/crates/tui/src/client.rs index 9d84b173..e4bd1bef 100644 --- a/crates/tui/src/client.rs +++ b/crates/tui/src/client.rs @@ -1321,9 +1321,7 @@ pub(super) fn apply_reasoning_effort( }; body["reasoning_effort"] = json!(value); } - ApiProvider::Openai - | ApiProvider::WanjieArk - | ApiProvider::OpenaiCodex => {} + ApiProvider::Openai | ApiProvider::WanjieArk | ApiProvider::OpenaiCodex => {} ApiProvider::Atlascloud => { // #3024: Atlascloud serves DeepSeek models. body["reasoning_effort"] = json!("high"); @@ -1375,9 +1373,7 @@ pub(super) fn apply_reasoning_effort( // "max" to "high" instead of sending an invalid value. body["reasoning_effort"] = json!("high"); } - ApiProvider::Openai - | ApiProvider::WanjieArk - | ApiProvider::OpenaiCodex => {} + ApiProvider::Openai | ApiProvider::WanjieArk | ApiProvider::OpenaiCodex => {} ApiProvider::Atlascloud => { // #3024: Atlascloud serves DeepSeek models. body["reasoning_effort"] = json!("high"); From 29e60cd4b97d4b4d7fbb7bdcf6cb0bd0d20b806f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 00:13:18 +0000 Subject: [PATCH 3/3] =?UTF-8?q?fix(reasoning):=20Atlascloud=20joins=20the?= =?UTF-8?q?=20DeepSeek=20dialect=20group=20=E2=80=94=20max=20tier=20now=20?= =?UTF-8?q?sends=20reasoning=5Feffort=3Dmax;=20add=20Atlascloud/Moonshot/O?= =?UTF-8?q?llama=20dialect-shape=20tests;=20document=20per-provider=20reas?= =?UTF-8?q?oning-effort=20wire=20mapping=20in=20PROVIDERS.md=20(#3024)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5 --- crates/tui/src/client.rs | 70 ++++++++++++++++++++++++++++------------ docs/PROVIDERS.md | 24 ++++++++++++++ 2 files changed, 73 insertions(+), 21 deletions(-) diff --git a/crates/tui/src/client.rs b/crates/tui/src/client.rs index e4bd1bef..93f722d6 100644 --- a/crates/tui/src/client.rs +++ b/crates/tui/src/client.rs @@ -1226,7 +1226,8 @@ pub(super) fn apply_reasoning_effort( | ApiProvider::SiliconflowCn | ApiProvider::Sglang | ApiProvider::Volcengine - | ApiProvider::Together => { + | ApiProvider::Together + | ApiProvider::Atlascloud => { body["thinking"] = json!({ "type": "disabled" }); } ApiProvider::OpenaiCodex => { @@ -1251,11 +1252,6 @@ pub(super) fn apply_reasoning_effort( | ApiProvider::WanjieArk | ApiProvider::Arcee | 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" }); @@ -1277,7 +1273,8 @@ pub(super) fn apply_reasoning_effort( | ApiProvider::Siliconflow | ApiProvider::SiliconflowCn | ApiProvider::Sglang - | ApiProvider::Volcengine => { + | ApiProvider::Volcengine + | ApiProvider::Atlascloud => { body["reasoning_effort"] = json!("high"); body["thinking"] = json!({ "type": "enabled" }); } @@ -1322,11 +1319,6 @@ pub(super) fn apply_reasoning_effort( body["reasoning_effort"] = json!(value); } ApiProvider::Openai | ApiProvider::WanjieArk | 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" }); @@ -1348,7 +1340,8 @@ pub(super) fn apply_reasoning_effort( | ApiProvider::Siliconflow | ApiProvider::SiliconflowCn | ApiProvider::Sglang - | ApiProvider::Volcengine => { + | ApiProvider::Volcengine + | ApiProvider::Atlascloud => { body["reasoning_effort"] = json!("max"); body["thinking"] = json!({ "type": "enabled" }); } @@ -1374,11 +1367,6 @@ pub(super) fn apply_reasoning_effort( body["reasoning_effort"] = json!("high"); } ApiProvider::Openai | ApiProvider::WanjieArk | 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" }); @@ -2569,12 +2557,9 @@ mod tests { fn reasoning_effort_off_is_omitted_for_strict_openai_like_providers() { for provider in [ ApiProvider::Openai, - ApiProvider::Atlascloud, ApiProvider::WanjieArk, ApiProvider::Arcee, ApiProvider::Huggingface, - ApiProvider::Moonshot, - ApiProvider::Ollama, ApiProvider::Fireworks, ] { let mut body = json!({}); @@ -2588,6 +2573,49 @@ mod tests { } } + #[test] + fn reasoning_effort_atlascloud_speaks_deepseek_dialect() { + let mut body = json!({}); + apply_reasoning_effort(&mut body, Some("high"), ApiProvider::Atlascloud); + assert_eq!( + body, + json!({ "reasoning_effort": "high", "thinking": { "type": "enabled" } }) + ); + + let mut body = json!({}); + apply_reasoning_effort(&mut body, Some("max"), ApiProvider::Atlascloud); + assert_eq!( + body, + json!({ "reasoning_effort": "max", "thinking": { "type": "enabled" } }) + ); + + let mut body = json!({}); + apply_reasoning_effort(&mut body, Some("off"), ApiProvider::Atlascloud); + assert_eq!(body, json!({ "thinking": { "type": "disabled" } })); + } + + #[test] + fn reasoning_effort_moonshot_toggles_thinking() { + let mut body = json!({}); + apply_reasoning_effort(&mut body, Some("high"), ApiProvider::Moonshot); + assert_eq!(body, json!({ "thinking": { "type": "enabled" } })); + + let mut body = json!({}); + apply_reasoning_effort(&mut body, Some("off"), ApiProvider::Moonshot); + assert_eq!(body, json!({ "thinking": { "type": "disabled" } })); + } + + #[test] + fn reasoning_effort_ollama_toggles_think_flag() { + let mut body = json!({}); + apply_reasoning_effort(&mut body, Some("high"), ApiProvider::Ollama); + assert_eq!(body, json!({ "think": true })); + + let mut body = json!({}); + apply_reasoning_effort(&mut body, Some("off"), ApiProvider::Ollama); + assert_eq!(body, json!({ "think": false })); + } + #[test] fn reasoning_effort_uses_nvidia_nim_chat_template_kwargs() { let mut body = json!({}); diff --git a/docs/PROVIDERS.md b/docs/PROVIDERS.md index 89556be3..d514f6a5 100644 --- a/docs/PROVIDERS.md +++ b/docs/PROVIDERS.md @@ -283,6 +283,30 @@ DeepSeek compatibility aliases `deepseek-chat` and `deepseek-reasoner` map to `deepseek-v4-flash` capability metadata and are scheduled to retire on 2026-07-24 at 2026-07-24T15:59:00Z. +## Reasoning Effort + +`/reasoning ` (and the `reasoning_effort` config key) is translated to +each provider's wire dialect by the client before the request is sent. `off` +disables thinking where the dialect supports it; providers marked "omitted" +receive no reasoning fields at all for that tier. + +| Provider | `off` | `low`/`medium`/`high` | `max`/`xhigh` | +| --- | --- | --- | --- | +| `deepseek`, `deepseek-cn`, `siliconflow`, `siliconflow-CN`, `sglang`, `volcengine`, `atlascloud` | `thinking: {type: disabled}` | `reasoning_effort: "high"` + `thinking: {type: enabled}` | `reasoning_effort: "max"` + `thinking: {type: enabled}` | +| `openrouter`, `novita`, `together` | `thinking: {type: disabled}` | `reasoning_effort` pass-through + `thinking: {type: enabled}` | `reasoning_effort: "xhigh"` + `thinking: {type: enabled}` | +| `moonshot` | `thinking: {type: disabled}` | `thinking: {type: enabled}` | `thinking: {type: enabled}` | +| `ollama` | `think: false` | `think: true` | `think: true` | +| `xiaomi-mimo` | `thinking: {type: disabled}` | `thinking: {type: enabled}` | `thinking: {type: enabled}` | +| `nvidia-nim` | `chat_template_kwargs.thinking: false` | `chat_template_kwargs`: `thinking: true` + `reasoning_effort: "high"` | `chat_template_kwargs`: `thinking: true` + `reasoning_effort: "max"` | +| `vllm` | `chat_template_kwargs.enable_thinking: false` | `chat_template_kwargs.enable_thinking: true` + `reasoning_effort` low/medium/high | `chat_template_kwargs.enable_thinking: true` + `reasoning_effort: "high"` (vLLM has no max tier) | +| `arcee`, `huggingface` | omitted | `reasoning_effort` pass-through | `reasoning_effort: "high"` | +| `fireworks` | omitted | `reasoning_effort: "high"` | `reasoning_effort: "max"` | +| `openai`, `wanjie-ark` | omitted | omitted | omitted | +| `openai-codex` | Responses API `reasoning` field (handled by the Responses bridge) | Responses API `reasoning` field | Responses API `reasoning` field | + +AtlasCloud serves DeepSeek models, so it speaks the DeepSeek reasoning dialect, +including the `max` tier (#3024). + ## Drift Check Run this before changing provider IDs, provider TOML tables, static model