diff --git a/src/LLMProviders/chainRunner/AutonomousAgentChainRunner.ts b/src/LLMProviders/chainRunner/AutonomousAgentChainRunner.ts index a195dd8f..9086fc19 100644 --- a/src/LLMProviders/chainRunner/AutonomousAgentChainRunner.ts +++ b/src/LLMProviders/chainRunner/AutonomousAgentChainRunner.ts @@ -869,9 +869,12 @@ export class AutonomousAgentChainRunner extends CopilotPlusChainRunner { } } - // Add tool result step (shown in rolling display - this is the "what was found") + // Add tool result step only when it provides new info (failure or source counts). + // Skip redundant success steps like "Listed vault tasks" after "Listing vault tasks". const resultSummary = summarizeToolResult(tc.name, result, sourceInfo, toolCall.args); - this.addReasoningStep(resultSummary, tc.name); + if (!result.success || sourceInfo) { + this.addReasoningStep(resultSummary, tc.name); + } // Add ToolMessage to conversation const toolMessage = createToolResultMessage( diff --git a/src/tools/ObsidianCliTools.ts b/src/tools/ObsidianCliTools.ts index 15861e32..4a37b18b 100644 --- a/src/tools/ObsidianCliTools.ts +++ b/src/tools/ObsidianCliTools.ts @@ -141,7 +141,9 @@ export const obsidianPropertiesTool = createLangChainTool({ // --------------------------------------------------------------------------- const tasksSchema = z.object({ - command: z.literal("tasks").describe("List tasks across the vault with optional filters."), + command: z + .literal("tasks") + .describe('Must be exactly "tasks". Lists tasks across the vault with optional filters.'), file: z.string().optional().describe("Filter tasks by file name."), path: z.string().optional().describe("Filter tasks by vault-relative file path."), todo: z.boolean().optional().describe("Show only incomplete (todo) tasks."), diff --git a/src/tools/builtinTools.ts b/src/tools/builtinTools.ts index 5600a0ed..30d717fe 100644 --- a/src/tools/builtinTools.ts +++ b/src/tools/builtinTools.ts @@ -348,6 +348,7 @@ export function registerCliTools(): void { - daily:path — get the vault-relative file path (useful for follow-up readNote calls). - daily:append and daily:prepend also auto-create the daily note if it doesn't exist, but do NOT apply the template. - Use \\n for newlines and \\t for tabs in content strings. +- For past or future daily notes (e.g. "yesterday's daily note"): NEVER ask the user for the date — use the time tools. Workflow: (1) call getCurrentTime to resolve the date, (2) call daily:path to discover the date format and folder, (3) call obsidianTemplates with command=templates to list available template names, then call template:read with the name that matches (e.g. "Daily Note Template"), (4) use writeToFile to create the note at the resolved path with the template content, replacing variables like {{date}} with the target date. If templates returns an error or no daily template is found, ask the user for their template path and use readNote to read it. - For arbitrary file writes beyond daily notes, use writeToFile or replaceInFile instead. - If the user names a specific vault, pass it using the vault parameter.`, }, @@ -396,13 +397,15 @@ export function registerCliTools(): void { category: "cli", requiresVault: true, customPromptInstructions: `For obsidianTasks: +- ALWAYS use this tool when the user asks about tasks, todos, or checkboxes. Do NOT use localSearch for task queries. - Use to list and filter tasks across the vault. - todo=true: show only incomplete tasks. done=true: show only completed tasks. - status="x": filter by specific status character (e.g., "/" for in-progress, "x" for done, " " for open). - daily=true: show tasks from today's daily note only. - verbose=true: group tasks by file with line numbers. - total=true: return only the task count. -- file= resolves like a wikilink (name only). path= uses exact vault-relative path.`, +- file= resolves like a wikilink (name only). path= uses exact vault-relative path. +- For time-based task queries (e.g. "tasks from last month"): use verbose=true to get tasks grouped by file, then filter results by file dates or daily note filenames to match the time range.`, }, });