From d4eb9ae899a7ccf565fed5810bd93a6e2349a5e2 Mon Sep 17 00:00:00 2001 From: Nicholai Date: Sun, 16 Nov 2025 17:58:57 -0700 Subject: [PATCH] feat: switch to Claude Haiku 4.5 and add tool debug logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated model from gpt-oss-120b (no function calling support) to anthropic/claude-haiku-4.5 which has excellent function calling support for enabling Morgan's agent creation tool. Changes: - Update OPENROUTER_MODEL to anthropic/claude-haiku-4.5 - Add debug logging to show available tools for each agent - Claude Haiku 4.5 provides fast, cost-effective function calling This enables tool calling for Morgan's create_agent_package functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/app/api/chat/route.ts | 6 +++++- wrangler.jsonc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/api/chat/route.ts b/src/app/api/chat/route.ts index e2d3af36e..7e1e01253 100644 --- a/src/app/api/chat/route.ts +++ b/src/app/api/chat/route.ts @@ -79,11 +79,15 @@ export async function POST(request: NextRequest) { // Get configured model const model = getConfiguredModel() + // Debug: Log tools being passed to streamText + const toolsToPass = agent.tools || {} + console.log(`[chat] Tools available for agent ${agentId}:`, Object.keys(toolsToPass)) + // Stream response from agent const result = streamText({ model, system: agent.systemPrompt, - tools: agent.tools || {}, + tools: toolsToPass, messages, temperature: agent.temperature, // Note: maxTokens is not used in streamText - it uses maxRetries, retry logic, etc diff --git a/wrangler.jsonc b/wrangler.jsonc index e8524cd2a..e7518e88c 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -16,7 +16,7 @@ "vars": { // LLM Configuration (Vercel AI SDK) "OPENROUTER_API_KEY": "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", - "OPENROUTER_MODEL": "openai/gpt-oss-120b", + "OPENROUTER_MODEL": "anthropic/claude-haiku-4.5", // RAG Configuration (Qdrant) "QDRANT_URL": "", "QDRANT_API_KEY": "",