feat(desktop): openExternalFileForIpc opens files via OS handler

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
m4
2026-09-17 22:28:07 +08:00
3398 changed files with 379040 additions and 22836 deletions
@@ -85,6 +85,31 @@ 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."""
def test_deepseek_disabled_reasoning_sends_thinking_disabled(self, commandcode_profile):
extra_body, top_level = commandcode_profile.build_api_kwargs_extras(
reasoning_config={"enabled": False}, model="deepseek/deepseek-v4-flash",
)
assert extra_body.get("thinking") == {"type": "disabled"}
assert top_level == {}
def test_deepseek_effort_matches_native_profile_and_others_noop(self, commandcode_profile):
from plugins.model_providers.deepseek import deepseek
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"
) == ({}, {})
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.
@@ -110,7 +135,6 @@ class TestCommandCodeProfileNoThinkingInterference:
assert isinstance(top_level, dict)
# ── Anthropic Messages profile ────────────────────────────────────────────────
class TestCommandCodeAnthropicProfileIdentity:
"""Anthropic-compatible profile metadata."""
@@ -357,9 +381,7 @@ class TestCommandCodeBaseUrlOverride:
captured["url"] = req.full_url
return _FakeResp()
with mock_patch.object(
cc_mod.urllib.request, "urlopen", side_effect=fake_urlopen
):
with mock_patch.object(cc_mod, "open_credentialed_url", side_effect=fake_urlopen):
result = commandcode_profile.fetch_models(
api_key="k", base_url=cc_mod._COMMANDCODE_BASE + "/"
)