mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-03 07:33:45 +00:00
fix: permission checks for external_directory and doom_loop (#4433)
Co-authored-by: Aiden Cline <aidenpcline@gmail.com> Co-authored-by: AerionDyseti <AerionDyseti@users.noreply.github.com>
This commit is contained in:
@@ -36,6 +36,17 @@ export const WriteTool = Tool.define("write", {
|
||||
parentDir,
|
||||
},
|
||||
})
|
||||
} else if (agent.permission.external_directory === "deny") {
|
||||
throw new Permission.RejectedError(
|
||||
ctx.sessionID,
|
||||
"external_directory",
|
||||
ctx.callID,
|
||||
{
|
||||
filepath: filepath,
|
||||
parentDir,
|
||||
},
|
||||
`File ${filepath} is not in the current working directory`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user