fix(reasoning): Atlascloud joins the DeepSeek dialect group — max tier now sends reasoning_effort=max; add Atlascloud/Moonshot/Ollama dialect-shape tests; document per-provider reasoning-effort wire mapping in PROVIDERS.md (#3024)

Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
This commit is contained in:
Claude
2026-06-11 00:13:18 +00:00
parent 2d7d5e55ed
commit 29e60cd4b9
2 changed files with 73 additions and 21 deletions
+49 -21
View File
@@ -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!({});
+24
View File
@@ -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 <effort>` (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