diff --git a/src/core/prompts/responses.ts b/src/core/prompts/responses.ts index 0696bf6f11..332e3c63b7 100644 --- a/src/core/prompts/responses.ts +++ b/src/core/prompts/responses.ts @@ -23,7 +23,7 @@ export const formatResponse = { feedback: feedback, }) } - return `\n${feedback}\n` + return `The user denied this operation and responded with the message:\n\n${feedback}\n` }, toolApprovedWithFeedback: (feedback?: string, protocol?: ToolProtocol) => { @@ -33,7 +33,7 @@ export const formatResponse = { feedback: feedback, }) } - return `\n${feedback}\n` + return `The user approved this operation and responded with the message:\n\n${feedback}\n` }, toolError: (error?: string, protocol?: ToolProtocol) => { @@ -82,7 +82,7 @@ Otherwise, if you have not completed the task and do not need additional informa feedback: feedback, }) } - return `\n${feedback}\n` + return `You seem to be having trouble proceeding. The user has provided the following feedback to help guide you:\n\n${feedback}\n` }, missingToolParameterError: (paramName: string, protocol?: ToolProtocol) => { diff --git a/src/core/tools/__tests__/readFileTool.spec.ts b/src/core/tools/__tests__/readFileTool.spec.ts index 80d1bb6ff5..1f5ab1e277 100644 --- a/src/core/tools/__tests__/readFileTool.spec.ts +++ b/src/core/tools/__tests__/readFileTool.spec.ts @@ -86,8 +86,14 @@ const { toolResultMock, imageBlocksMock } = vi.hoisted(() => { vi.mock("../../prompts/responses", () => ({ formatResponse: { toolDenied: vi.fn(() => "The user denied this operation."), - toolDeniedWithFeedback: vi.fn((feedback?: string) => `\n${feedback}\n`), - toolApprovedWithFeedback: vi.fn((feedback?: string) => `\n${feedback}\n`), + toolDeniedWithFeedback: vi.fn( + (feedback?: string) => + `The user denied this operation and responded with the message:\n\n${feedback}\n`, + ), + toolApprovedWithFeedback: vi.fn( + (feedback?: string) => + `The user approved this operation and responded with the message:\n\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.`,