Skip to content

Commit 6fed908

Browse files
authored
Add a few more read-only operations (#25)
1 parent 178fd3a commit 6fed908

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"displayName": "Roo Cline",
44
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
55
"publisher": "RooVeterinaryInc",
6-
"version": "2.1.4",
6+
"version": "2.1.5",
77
"files": [
8-
"bin/roo-cline-2.1.4.vsix",
8+
"bin/roo-cline-2.1.5.vsix",
99
"assets/icons/icon_Roo.png"
1010
],
1111
"icon": "assets/icons/icon_Roo.png",

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
693693
const lastMessage = messages.at(-1)
694694
if (lastMessage?.type === "ask" && lastMessage.text) {
695695
const tool = JSON.parse(lastMessage.text)
696-
return ["readFile", "listFiles", "searchFiles"].includes(tool.tool)
696+
return ["readFile", "listFiles", "listFilesTopLevel", "listFilesRecursive", "listCodeDefinitionNames", "searchFiles"].includes(tool.tool)
697697
}
698698
return false
699699
}

webview-ui/src/components/chat/__tests__/ChatView.test.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,31 @@ describe('ChatView', () => {
125125
})
126126
})
127127

128+
it('should auto-approve all file listing tool types when alwaysAllowReadOnly is true', () => {
129+
const fileListingTools = [
130+
'readFile', 'listFiles', 'listFilesTopLevel',
131+
'listFilesRecursive', 'listCodeDefinitionNames', 'searchFiles'
132+
]
133+
134+
fileListingTools.forEach(tool => {
135+
jest.clearAllMocks()
136+
mockState.clineMessages = [
137+
{
138+
type: 'ask',
139+
ask: 'tool',
140+
text: JSON.stringify({ tool }),
141+
ts: Date.now(),
142+
}
143+
]
144+
renderChatView()
145+
146+
expect(vscode.postMessage).toHaveBeenCalledWith({
147+
type: 'askResponse',
148+
askResponse: 'yesButtonClicked'
149+
})
150+
})
151+
})
152+
128153
it('should auto-approve write tool actions when alwaysAllowWrite is true', () => {
129154
mockState.clineMessages = [
130155
{

0 commit comments

Comments
 (0)