mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Throw FileRestrictionErrors sooner
This commit is contained in:
@@ -1144,25 +1144,22 @@ export class Cline {
|
||||
await this.browserSession.closeBrowser()
|
||||
}
|
||||
|
||||
// Only validate complete tool uses
|
||||
if (!block.partial) {
|
||||
const { mode } = (await this.providerRef.deref()?.getState()) ?? {}
|
||||
const { customModes } = (await this.providerRef.deref()?.getState()) ?? {}
|
||||
try {
|
||||
validateToolUse(
|
||||
block.name as ToolName,
|
||||
mode ?? defaultModeSlug,
|
||||
customModes ?? [],
|
||||
{
|
||||
apply_diff: this.diffEnabled,
|
||||
},
|
||||
block.params,
|
||||
)
|
||||
} catch (error) {
|
||||
this.consecutiveMistakeCount++
|
||||
pushToolResult(formatResponse.toolError(error.message))
|
||||
break
|
||||
}
|
||||
// Validate tool use before execution
|
||||
const { mode, customModes } = (await this.providerRef.deref()?.getState()) ?? {}
|
||||
try {
|
||||
validateToolUse(
|
||||
block.name as ToolName,
|
||||
mode ?? defaultModeSlug,
|
||||
customModes ?? [],
|
||||
{
|
||||
apply_diff: this.diffEnabled,
|
||||
},
|
||||
block.params,
|
||||
)
|
||||
} catch (error) {
|
||||
this.consecutiveMistakeCount++
|
||||
pushToolResult(formatResponse.toolError(error.message))
|
||||
break
|
||||
}
|
||||
|
||||
switch (block.name) {
|
||||
|
||||
Reference in New Issue
Block a user