feat(providers): route OpenCode Go muse-spark contributor models through Responses
The OpenCode Go gateway serves muse-spark-1.2-contributor and muse-spark-1.3-contributor only on /responses; /chat/completions returns 500 for both. Declare them in responses_models so they take the existing Responses path, as DeepSeek V4 does. Fixes #5896 (cherry picked from commit 0e775f3ee19d9391ddf73afd8062519caf0c6a4f)
This commit is contained in:
1 parent
96e8036107
commit
6f53f9f6c9
2 files changed
+17
No files matched your search
@@ -290,6 +290,10 @@ PROVIDERS: tuple[ProviderSpec, ...] = (
|
||||
detect_by_base_keyword="opencode.ai/zen/go",
|
||||
default_api_base="https://opencode.ai/zen/go/v1",
|
||||
strip_model_prefixes=("opencode-go", "opencode_go"),
|
||||
responses=ResponsesCapabilities(
|
||||
models=("muse-spark-1.2-contributor", "muse-spark-1.3-contributor"),
|
||||
allows_chat_fallback=False,
|
||||
),
|
||||
),
|
||||
# Hugging Face Inference Providers: OpenAI-compatible router for chat models.
|
||||
ProviderSpec(
|
||||
|
||||
@@ -130,6 +130,19 @@ def test_opencode_prefixes_are_stripped_before_request() -> None:
|
||||
assert go_kwargs["model"] == "o3"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", ["muse-spark-1.2-contributor", "muse-spark-1.3-contributor"])
|
||||
def test_opencode_go_muse_spark_contributor_models_use_responses(model) -> None:
|
||||
provider = OpenAICompatProvider(
|
||||
api_key=None,
|
||||
default_model=f"opencode-go/{model}",
|
||||
spec=find_by_name("opencode_go"),
|
||||
)
|
||||
|
||||
assert provider._should_use_responses_api(model, None) is True
|
||||
assert provider._should_use_responses_api(f"opencode-go/{model}", None) is True
|
||||
assert provider._should_use_responses_api("opencode-go/kimi-k2.5", None) is False
|
||||
|
||||
|
||||
def _fake_responses_output() -> dict[str, object]:
|
||||
return {
|
||||
"output": [{
|
||||
|
||||
Reference in new issue
Block a user