mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
Small tool usage cleanup (#203)
This commit is contained in:
parent
03f93d6570
commit
7e2cd4b7b0
2 changed files with 11 additions and 12 deletions
|
|
@ -188,17 +188,16 @@ describe('toolUsageParser', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should handle searchFiles tool with query fallback', () => {
|
||||
it('should handle searchFiles tool without regex', () => {
|
||||
const message = {
|
||||
ask: 'tool',
|
||||
text: '{"tool":"searchFiles","query":"test pattern"}',
|
||||
text: '{"tool":"searchFiles"}',
|
||||
};
|
||||
|
||||
const result = extractToolUsageFromAsk(message);
|
||||
|
||||
expect(result).toEqual({
|
||||
action: 'Grepped',
|
||||
details: 'test pattern',
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ export function extractToolUsageFromAsk(message: {
|
|||
case 'editedExistingFile':
|
||||
return {
|
||||
action: 'Edited',
|
||||
details: path || undefined,
|
||||
details: path,
|
||||
};
|
||||
case 'createdNewFile':
|
||||
return {
|
||||
action: 'Created',
|
||||
details: path || undefined,
|
||||
details: path,
|
||||
};
|
||||
case 'readFile':
|
||||
// Handle batch files (multiple reads)
|
||||
|
|
@ -59,32 +59,32 @@ export function extractToolUsageFromAsk(message: {
|
|||
// Handle single file read
|
||||
return {
|
||||
action: 'Read',
|
||||
details: path || undefined,
|
||||
details: path,
|
||||
};
|
||||
case 'searchFiles':
|
||||
return {
|
||||
action: 'Grepped',
|
||||
details: regex || query || 'pattern',
|
||||
details: regex,
|
||||
};
|
||||
case 'listFiles':
|
||||
return {
|
||||
action: 'Listed',
|
||||
details: path || undefined,
|
||||
details: path,
|
||||
};
|
||||
case 'listFilesTopLevel':
|
||||
return {
|
||||
action: 'Listed',
|
||||
details: path || undefined,
|
||||
details: path,
|
||||
};
|
||||
case 'listFilesRecursive':
|
||||
return {
|
||||
action: 'Listed',
|
||||
details: path || undefined,
|
||||
details: path,
|
||||
};
|
||||
case 'newFileCreated':
|
||||
return {
|
||||
action: 'Created',
|
||||
details: path || undefined,
|
||||
details: path,
|
||||
};
|
||||
case 'appliedDiff':
|
||||
// Handle batch diffs (multiple file edits)
|
||||
|
|
@ -106,7 +106,7 @@ export function extractToolUsageFromAsk(message: {
|
|||
// Handle single file diff
|
||||
return {
|
||||
action: 'Edited',
|
||||
details: path || undefined,
|
||||
details: path,
|
||||
};
|
||||
default:
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue