From 001d38caadfabdef8483a34caa905dbe4acff95e Mon Sep 17 00:00:00 2001 From: Merge Resolver Date: Thu, 21 Aug 2025 18:48:49 -0600 Subject: [PATCH] fix(chat): add Missing Required Parameter title mapping for tool arg errors and tests - Map "Roo tried to use ... without value for required parameter" to 'Missing Required Parameter' - Keep existing 'Invalid Tool Arguments' mapping - Add unit test covering the exact screenshot string - No backend changes; only ChatView title extraction --- .../src/utils/__tests__/errorTitleExtractor.spec.ts | 5 +++++ webview-ui/src/utils/errorTitleExtractor.ts | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/webview-ui/src/utils/__tests__/errorTitleExtractor.spec.ts b/webview-ui/src/utils/__tests__/errorTitleExtractor.spec.ts index 61604a79fb..b62bd7ff94 100644 --- a/webview-ui/src/utils/__tests__/errorTitleExtractor.spec.ts +++ b/webview-ui/src/utils/__tests__/errorTitleExtractor.spec.ts @@ -226,6 +226,11 @@ describe("extractErrorTitle", () => { expect(extractErrorTitle(error, mockT)).toBe("Invalid Tool Arguments") }) + it("should handle missing required parameter tool error", () => { + const error = "Roo tried to use apply_diff without value for required parameter 'path'. Retrying..." + expect(extractErrorTitle(error, mockT)).toBe("Missing Required Parameter") + }) + it("should handle file not found error from actual code", () => { const error = "File does not exist at path: /Users/test/project/src/app.ts\n\n\nThe specified file could not be found. Please verify the file path and try again.\n" diff --git a/webview-ui/src/utils/errorTitleExtractor.ts b/webview-ui/src/utils/errorTitleExtractor.ts index 2bacacf951..d1fc7d1ead 100644 --- a/webview-ui/src/utils/errorTitleExtractor.ts +++ b/webview-ui/src/utils/errorTitleExtractor.ts @@ -103,6 +103,17 @@ export function extractErrorTitle(errorContent: string, t: TFunction): string { pattern: /^Failed to apply diff:/i, title: "Diff Application Failed", }, + // Roo chat errors generated when tool args are missing/invalid + { + // Example: Roo tried to use apply_diff without value for required parameter 'path'. Retrying... + pattern: /^Roo tried to use .+ without value for required parameter ['"“”‘’][^'"“”‘’]+['"“”‘’]/i, + title: "Missing Required Parameter", + }, + { + // Fallback without quoting the param + pattern: /^Roo tried to use .+ without value for required parameter/i, + title: "Missing Required Parameter", + }, ] // API and service error patterns