chore: anchor fresh-start history to upstream
This commit is contained in:
@@ -85,30 +85,32 @@ class TestCommandCodeProfileIdentity:
|
||||
assert commandcode_profile.get_hostname() == "api.commandcode.ai"
|
||||
|
||||
|
||||
class TestCommandCodeReasoningWireControls:
|
||||
"""DeepSeek V4+ defaults to thinking when ``thinking`` is omitted, so the profile
|
||||
must put the user's setting on the wire (#95232); other families stay a no-op."""
|
||||
class TestCommandCodeProfileNoThinkingInterference:
|
||||
"""Chat completions profile is a no-op for thinking config — it delegates
|
||||
to the underlying model's provider (DeepSeek, Qwen, etc.) for wire format.
|
||||
"""
|
||||
|
||||
def test_deepseek_disabled_reasoning_sends_thinking_disabled(self, commandcode_profile):
|
||||
def test_passthrough_no_reasoning_config(self, commandcode_profile):
|
||||
extra_body, top_level = commandcode_profile.build_api_kwargs_extras(
|
||||
reasoning_config={"enabled": False}, model="deepseek/deepseek-v4-flash",
|
||||
reasoning_config=None, model="deepseek/deepseek-v4-pro"
|
||||
)
|
||||
assert extra_body.get("thinking") == {"type": "disabled"}
|
||||
assert top_level == {}
|
||||
# Chat completions profile doesn't inject thinking params — that's
|
||||
# the DeepSeek provider's job when routed through DeepSeek's own profile.
|
||||
# When routed through CommandCode, the underlying model API handles it.
|
||||
assert isinstance(extra_body, dict)
|
||||
assert isinstance(top_level, dict)
|
||||
# Default ProviderProfile returns ({}, {}).
|
||||
|
||||
def test_deepseek_effort_matches_native_profile_and_others_noop(self, commandcode_profile):
|
||||
from plugins.model_providers.deepseek import deepseek
|
||||
def test_passthrough_with_reasoning_config(self, commandcode_profile):
|
||||
extra_body, top_level = commandcode_profile.build_api_kwargs_extras(
|
||||
reasoning_config={"enabled": True, "effort": "high"},
|
||||
model="deepseek/deepseek-v4-pro",
|
||||
)
|
||||
assert isinstance(extra_body, dict)
|
||||
assert isinstance(top_level, dict)
|
||||
|
||||
rc = {"enabled": True, "effort": "low"}
|
||||
expected = deepseek.build_api_kwargs_extras(reasoning_config=rc, model="deepseek-v4.1-flash")
|
||||
assert expected[1].get("reasoning_effort") == "low" # equality below must not be ({}, {}) == ({}, {})
|
||||
assert commandcode_profile.build_api_kwargs_extras(
|
||||
reasoning_config=rc, model="deepseek/deepseek-v4.1-flash"
|
||||
) == expected
|
||||
assert commandcode_profile.build_api_kwargs_extras(
|
||||
reasoning_config=rc, model="Qwen/Qwen3.7-Max"
|
||||
) == ({}, {})
|
||||
|
||||
# ── Anthropic Messages profile ────────────────────────────────────────────────
|
||||
|
||||
class TestCommandCodeAnthropicProfileIdentity:
|
||||
"""Anthropic-compatible profile metadata."""
|
||||
@@ -355,7 +357,9 @@ class TestCommandCodeBaseUrlOverride:
|
||||
captured["url"] = req.full_url
|
||||
return _FakeResp()
|
||||
|
||||
with mock_patch.object(cc_mod, "open_credentialed_url", side_effect=fake_urlopen):
|
||||
with mock_patch.object(
|
||||
cc_mod.urllib.request, "urlopen", side_effect=fake_urlopen
|
||||
):
|
||||
result = commandcode_profile.fetch_models(
|
||||
api_key="k", base_url=cc_mod._COMMANDCODE_BASE + "/"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user