From a23f1ea98aa4be081cc8156f5f57c9b8c5440766 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Wed, 3 Dec 2025 21:50:34 -0700 Subject: [PATCH] fix: update additional missed and usages - src/services/command/built-in-commands.ts: Change to in init command - src/core/tools/ExecuteCommandTool.ts: Change to for running command feedback - src/core/mentions/processUserContentMentions.ts: Update comment to reflect new tag - src/core/tools/__tests__/readFileTool.spec.ts: Update mock implementations Note: tags in fetch_instructions tool remain unchanged as they are XML tool parameters (parameter name = 'task'), not user content wrappers. --- src/core/mentions/processUserContentMentions.ts | 9 +++------ src/core/tools/ExecuteCommandTool.ts | 3 +-- src/core/tools/__tests__/readFileTool.spec.ts | 10 ++-------- src/services/command/built-in-commands.ts | 4 ++-- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/core/mentions/processUserContentMentions.ts b/src/core/mentions/processUserContentMentions.ts index 8e12a536a0..bb24a554be 100644 --- a/src/core/mentions/processUserContentMentions.ts +++ b/src/core/mentions/processUserContentMentions.ts @@ -30,13 +30,10 @@ export async function processUserContentMentions({ // Process userContent array, which contains various block types: // TextBlockParam, ImageBlockParam, ToolUseBlockParam, and ToolResultBlockParam. // We need to apply parseMentions() to: - // 1. All TextBlockParam's text (first user message with task) + // 1. All TextBlockParam's text (first user message) // 2. ToolResultBlockParam's content/context text arrays if it contains - // "" (see formatToolDeniedFeedback, attemptCompletion, - // executeCommand, and consecutiveMistakeCount >= 3) or "" - // (see askFollowupQuestion), we place all user generated content in - // these tags so they can effectively be used as markers for when we - // should parse mentions). + // "" - we place all user generated content in this tag + // so it can effectively be used as a marker for when we should parse mentions. return Promise.all( userContent.map(async (block) => { const shouldProcessMentions = (text: string) => text.includes("") diff --git a/src/core/tools/ExecuteCommandTool.ts b/src/core/tools/ExecuteCommandTool.ts index f7271bffe9..2d82694a41 100644 --- a/src/core/tools/ExecuteCommandTool.ts +++ b/src/core/tools/ExecuteCommandTool.ts @@ -337,8 +337,7 @@ export async function executeCommandInTerminal( [ `Command is still running in terminal from '${terminal.getCurrentWorkingDirectory().toPosix()}'.`, result.length > 0 ? `Here's the output so far:\n${result}\n` : "\n", - `The user provided the following feedback:`, - `\n${text}\n`, + `\n${text}\n`, ].join("\n"), images, ), diff --git a/src/core/tools/__tests__/readFileTool.spec.ts b/src/core/tools/__tests__/readFileTool.spec.ts index 11f533e54f..80d1bb6ff5 100644 --- a/src/core/tools/__tests__/readFileTool.spec.ts +++ b/src/core/tools/__tests__/readFileTool.spec.ts @@ -86,14 +86,8 @@ const { toolResultMock, imageBlocksMock } = vi.hoisted(() => { vi.mock("../../prompts/responses", () => ({ formatResponse: { toolDenied: vi.fn(() => "The user denied this operation."), - toolDeniedWithFeedback: vi.fn( - (feedback?: string) => - `The user denied this operation and provided the following feedback:\n\n${feedback}\n`, - ), - toolApprovedWithFeedback: vi.fn( - (feedback?: string) => - `The user approved this operation and provided the following context:\n\n${feedback}\n`, - ), + toolDeniedWithFeedback: vi.fn((feedback?: string) => `\n${feedback}\n`), + toolApprovedWithFeedback: vi.fn((feedback?: string) => `\n${feedback}\n`), rooIgnoreError: vi.fn( (path: string) => `Access to ${path} is blocked by the .rooignore file settings. You must try to continue in the task without using this file, or ask the user to update the .rooignore file.`, diff --git a/src/services/command/built-in-commands.ts b/src/services/command/built-in-commands.ts index db113c4895..53b0a81808 100644 --- a/src/services/command/built-in-commands.ts +++ b/src/services/command/built-in-commands.ts @@ -11,11 +11,11 @@ const BUILT_IN_COMMANDS: Record = { init: { name: "init", description: "Analyze codebase and create concise AGENTS.md files for AI assistants", - content: ` + content: ` Please analyze this codebase and create an AGENTS.md file containing: 1. Build/lint/test commands - especially for running a single test 2. Code style guidelines including imports, formatting, types, naming conventions, error handling, etc. - +