From 7b0486408e73bb6a337c8bab6762f962271615ae Mon Sep 17 00:00:00 2001 From: konsisumer Date: Sat, 11 Apr 2026 15:35:40 +0200 Subject: [PATCH 1/2] fix: preserve dots in model IDs for OpenCode Zen provider (#7710) OpenCode Zen's MiniMax models (e.g. minimax-m2.5-free) require dots in model IDs, but _anthropic_preserve_dots() did not recognize the "opencode-zen" provider or its base URL pattern "opencode.ai/zen/v1". This caused normalize_model_name() to convert dots to hyphens (minimax-m2-5-free), resulting in HTTP 400 from the API. - Add "opencode-zen" to the provider allowlist in _anthropic_preserve_dots() - Broaden URL check from "opencode.ai/zen/go" to "opencode.ai/zen/" to cover both Go and Zen endpoints - Add tests for provider and URL-based dot preservation Closes #7710 --- run_agent.py | 6 +++--- tests/agent/test_minimax_provider.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/run_agent.py b/run_agent.py index 3956f89048805..5e22e1082f657 100644 --- a/run_agent.py +++ b/run_agent.py @@ -5819,11 +5819,11 @@ def _anthropic_preserve_dots(self) -> bool: """True when using an anthropic-compatible endpoint that preserves dots in model names. Alibaba/DashScope keeps dots (e.g. qwen3.5-plus). MiniMax keeps dots (e.g. MiniMax-M2.7). - OpenCode Go keeps dots (e.g. minimax-m2.7).""" - if (getattr(self, "provider", "") or "").lower() in {"alibaba", "minimax", "minimax-cn", "opencode-go"}: + OpenCode Go/Zen keeps dots for MiniMax models (e.g. minimax-m2.5-free).""" + if (getattr(self, "provider", "") or "").lower() in {"alibaba", "minimax", "minimax-cn", "opencode-go", "opencode-zen"}: return True base = (getattr(self, "base_url", "") or "").lower() - return "dashscope" in base or "aliyuncs" in base or "minimax" in base or "opencode.ai/zen/go" in base + return "dashscope" in base or "aliyuncs" in base or "minimax" in base or "opencode.ai/zen/" in base def _is_qwen_portal(self) -> bool: """Return True when the base URL targets Qwen Portal.""" diff --git a/tests/agent/test_minimax_provider.py b/tests/agent/test_minimax_provider.py index 1673bfd9445a3..8275be6f8bcb6 100644 --- a/tests/agent/test_minimax_provider.py +++ b/tests/agent/test_minimax_provider.py @@ -302,12 +302,28 @@ def test_minimax_cn_url_preserves_dots(self): from run_agent import AIAgent assert AIAgent._anthropic_preserve_dots(agent) is True + def test_opencode_zen_provider_preserves_dots(self): + from types import SimpleNamespace + agent = SimpleNamespace(provider="opencode-zen", base_url="") + from run_agent import AIAgent + assert AIAgent._anthropic_preserve_dots(agent) is True + + def test_opencode_zen_url_preserves_dots(self): + from types import SimpleNamespace + agent = SimpleNamespace(provider="custom", base_url="https://opencode.ai/zen/v1") + from run_agent import AIAgent + assert AIAgent._anthropic_preserve_dots(agent) is True + def test_anthropic_does_not_preserve_dots(self): from types import SimpleNamespace agent = SimpleNamespace(provider="anthropic", base_url="https://api.anthropic.com") from run_agent import AIAgent assert AIAgent._anthropic_preserve_dots(agent) is False + def test_normalize_preserves_m25_free_dot(self): + from agent.anthropic_adapter import normalize_model_name + assert normalize_model_name("minimax-m2.5-free", preserve_dots=True) == "minimax-m2.5-free" + def test_normalize_preserves_m27_dot(self): from agent.anthropic_adapter import normalize_model_name assert normalize_model_name("MiniMax-M2.7", preserve_dots=True) == "MiniMax-M2.7" From f3729147ef998a48c3275e82f8e3902573063bbb Mon Sep 17 00:00:00 2001 From: konsisumer Date: Sun, 12 Apr 2026 03:50:28 +0200 Subject: [PATCH 2/2] fix(docker): add git to system dependencies for npm git-based deps The whatsapp-bridge package.json references @whiskeysockets/baileys via a GitHub branch URL, which requires git during npm install. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5c57897f572ee..c436280a3d140 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ ENV PYTHONUNBUFFERED=1 # Install system dependencies in one layer, clear APT cache RUN apt-get update && \ apt-get install -y --no-install-recommends \ - build-essential nodejs npm python3 python3-pip ripgrep ffmpeg gcc python3-dev libffi-dev procps && \ + build-essential nodejs npm python3 python3-pip ripgrep ffmpeg gcc python3-dev libffi-dev procps git && \ rm -rf /var/lib/apt/lists/* COPY . /opt/hermes