mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
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
This commit is contained in:
parent
a3b34460a1
commit
001d38caad
2 changed files with 16 additions and 0 deletions
|
|
@ -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<error_details>\nThe specified file could not be found. Please verify the file path and try again.\n</error_details>"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue