Skip to content

The agent that grows with you

fix(opencode-go): send reasoning for the canonical deepseek-flash id

Ada7c734c78384e
diff --git a/plugins/model-providers/opencode-zen/__init__.py b/plugins/model-providers/opencode-zen/__init__.py
index a2ee868dc3f..c1c55c7fb5f 100644
--- a/plugins/model-providers/opencode-zen/__init__.py
+++ b/plugins/model-providers/opencode-zen/__init__.py
@@ -25,9 +25,15 @@ def _flat_model_name(model: str | None) -> str:
return (model or "").strip().rsplit("/", 1)[-1].lower()
+# Version-less DeepSeek ids that still carry the thinking/effort knobs on this wire: the retired
+# ``deepseek-reasoner`` alias and the canonical ``deepseek-flash`` (2026-09 Flash refresh), for
+# which the Go relay honours the same top-level ``reasoning_effort``/``thinking`` contract.
+_THINKING_CAPABLE_IDS: frozenset[str] = frozenset({"deepseek-reasoner", "deepseek-flash"})
+
+
def _is_deepseek_thinking_model(model: str | None) -> bool:
m = _flat_model_name(model)
- return (m.startswith("deepseek-v") and not m.startswith("deepseek-v3")) or m == "deepseek-reasoner"
+ return (m.startswith("deepseek-v") and not m.startswith("deepseek-v3")) or m in _THINKING_CAPABLE_IDS
def _is_glm_5_2_model(model: str | None) -> bool:
diff --git a/tests/plugins/model_providers/test_opencode_go_profile.py b/tests/plugins/model_providers/test_opencode_go_profile.py
index 406b340dcd8..f10eb879021 100644
--- a/tests/plugins/model_providers/test_opencode_go_profile.py
+++ b/tests/plugins/model_providers/test_opencode_go_profile.py
@@ -182,6 +182,36 @@ class TestOpenCodeGoDeepSeekThinking:
assert extra_body == {}
assert top_level == {"reasoning_effort": "max"}
+ @pytest.mark.parametrize("model", ["deepseek-flash", "deepseek/deepseek-flash"])
+ def test_version_less_canonical_id_gets_the_controls(self, opencode_go_profile, model):
+ """The canonical version-less Flash id must reach the wire like the versioned ids:
+ the asked effort, and an explicit thinking-off when reasoning is disabled."""
+ _, top_level = opencode_go_profile.build_api_kwargs_extras(
+ reasoning_config={"enabled": True, "effort": "high"},
+ model=model,
+ )
+ assert top_level == {"reasoning_effort": "high"}
+ extra_body, top_level = opencode_go_profile.build_api_kwargs_extras(
+ reasoning_config={"enabled": False},
+ model=model,
+ )
+ assert extra_body == {"thinking": {"type": "disabled"}}
+ assert top_level == {}
+
+ def test_version_less_flash_effort_reaches_the_wire(self, opencode_go_profile):
+ from agent.transports.chat_completions import ChatCompletionsTransport
+
+ kwargs = ChatCompletionsTransport().build_kwargs(
+ model="deepseek-flash",
+ messages=[{"role": "user", "content": "ping"}],
+ tools=None,
+ provider_profile=opencode_go_profile,
+ reasoning_config={"enabled": True, "effort": "max"},
+ base_url="https://opencode.ai/zen/go/v1",
+ )
+ assert "extra_body" not in kwargs
+ assert kwargs["reasoning_effort"] == "max"
+
class TestOpenCodeGoGLM52Reasoning:
"""GLM-5.2 uses its native high/max reasoning_effort knob on OpenCode Go."""