diff --git a/mcp/llm-router/providers/opencode.py b/mcp/llm-router/providers/opencode.py index ebc0f35..21a1e56 100755 --- a/mcp/llm-router/providers/opencode.py +++ b/mcp/llm-router/providers/opencode.py @@ -4,6 +4,9 @@ import subprocess from typing import List +# OpenCode binary path (linuxbrew installation) +OPENCODE_BIN = "/home/linuxbrew/.linuxbrew/bin/opencode" + def invoke(cli_args: List[str], prompt: str, timeout: int = 300) -> str: """ @@ -22,9 +25,10 @@ def invoke(cli_args: List[str], prompt: str, timeout: int = 300) -> str: TimeoutError: If request exceeds timeout Example invocation: - opencode -m github-copilot/gpt-5.2 -p "Hello world" + opencode run -m github-copilot/gpt-5.2 "Hello world" """ - cmd = ["opencode"] + cli_args + ["-p", prompt] + # Build command: opencode run -m MODEL "prompt" + cmd = [OPENCODE_BIN, "run"] + cli_args + [prompt] try: result = subprocess.run( diff --git a/state/model-policy.json b/state/model-policy.json index f917d1c..9bfa12f 100644 --- a/state/model-policy.json +++ b/state/model-policy.json @@ -190,7 +190,7 @@ "task_routing": { "reasoning": "github-copilot/gpt-5.2", "code-generation": "zai-coding-plan/glm-4.7", - "long-context": "gemini/gemini-3-pro", + "long-context": "gemini/gemini-2.5-pro", "default": "github-copilot/claude-sonnet-4.5" } }