fix(agent): raise tool rounds and ease calendar creates
CI / checks (push) Has been cancelled

Local models were burning the 8-round budget on simple event adds.
Raise the limit, resolve calendars by name/default, and inject the
household clock so relative dates work.
This commit is contained in:
ginnoir
2026-07-08 21:40:44 -05:00
parent ea371b8085
commit d3e79edb9e
7 changed files with 240 additions and 10 deletions
+3 -3
View File
@@ -1,13 +1,13 @@
import { createLlmClient, type ChatMessage, type LlmClient } from "@/lib/llm";
import { buildVisionContentParts, textFromMessageContent } from "@/lib/llm/content";
import { AGENT_SYSTEM_PROMPT, AGENT_TOOLS } from "../tools";
import { AGENT_SYSTEM_PROMPT, AGENT_TOOLS, appendAgentRuntimeContext } from "../tools";
import type { ClientChatMessage } from "../messages";
import { describeToolActivity } from "../tool-labels";
import { createApiToolExecutor, type ToolExecutor } from "../tool-executor";
import { resolveAssistantImageDataUrls } from "./resolve-images";
import { thinkingLabel, type AgentProgressEvent } from "./progress";
const MAX_TOOL_ROUNDS = 8;
const MAX_TOOL_ROUNDS = 24;
export type AgentToolCallSummary = {
name: string;
@@ -53,7 +53,7 @@ export async function runAgentChat(options: {
const llm = options.llm ?? createLlmClient({ model: options.model });
const executeTool = options.executeTool ?? createApiToolExecutor(options.request);
const onProgress = options.onProgress;
const systemPrompt = options.systemPrompt ?? AGENT_SYSTEM_PROMPT;
const systemPrompt = appendAgentRuntimeContext(options.systemPrompt ?? AGENT_SYSTEM_PROMPT);
const userMessages = await Promise.all(
options.messages.map((message) => toLlmUserMessage(message)),