fix: usa sempre agente semplice per Ollama

- Rimuovi condizione len(custom_tools) > 0
- Ora usa simple agent per qualsiasi config con provider=ollama
This commit is contained in:
opencode committed 2026-03-23 16:01:28 +01:00
1 parent 8acbeb7dfe
commit 0b5c6a874e
1 file changed
+3 -5
+3 -5
View File
@@ -424,11 +424,9 @@ def create_langcode_agent(system_prompt: Optional[str] = None, use_simple_agent:
config = config_manager.get_configuration(active_name)
if config and config.get("provider") == "ollama":
# Ollama doesn't fully support bind_tools in deepagents
# Check if we have tools - if so, use simple agent
custom_tools = get_custom_tools()
if len(custom_tools) > 0:
print("⚠️ Using simple chat agent (Ollama detected without full tool support)")
use_simple_agent = True
# Always use simple agent for Ollama
print("⚠️ Using simple chat agent (Ollama detected)")
use_simple_agent = True
if use_simple_agent:
return create_simple_agent(system_prompt)