From 3ef88fc7ffdd0db668632241a93072d6bfdce0b2 Mon Sep 17 00:00:00 2001 From: 2revoemag Date: Mon, 1 Jun 2026 16:49:43 -0400 Subject: [PATCH] Recognize Gemma as tool-capable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gemma models (gemma-2/3/4) support OpenAI-style function calling, but "gemma" was missing from the _model_supports_tools heuristic in stream_agent_loop(). On a non-allowlisted endpoint (e.g. a self-hosted OpenAI-compatible server), a Gemma-backed agent therefore never receives native tool schemas and falls back to the prompt-text tool-call convention — which Gemma does not follow. The result is that tool calls are emitted as raw text and never execute. Add "gemma" to the capability keyword list alongside the other tool-capable families. Co-authored-by: 2revoemag <2revoemag@users.noreply.github.com> Co-authored-by: Claude --- src/agent_loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent_loop.py b/src/agent_loop.py index 40aa1b1..fd0f440 100644 --- a/src/agent_loop.py +++ b/src/agent_loop.py @@ -1358,7 +1358,7 @@ async def stream_agent_loop( except Exception as _e: logger.debug(f"endpoint supports_tools lookup failed: {_e}") _model_supports_tools = any(kw in _model_lc for kw in ( - "deepseek", "gpt-4", "gpt-5", "gpt-o", "claude", "gemini", + "deepseek", "gpt-4", "gpt-5", "gpt-o", "claude", "gemini", "gemma", "qwen3", "qwen2.5", "mixtral", "mistral", "llama-3.1", "llama-3.2", "llama-3.3", "llama-4", # Local-served models that follow OpenAI-style function calling