Fix bug with auto-approving commands

This commit is contained in:
Matt Rubens
2024-12-26 21:22:22 -08:00
parent 26fcd6a351
commit 91399c9f61
3 changed files with 104 additions and 45 deletions

View File

@@ -834,7 +834,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
const autoApprove = async () => {
if (isAutoApproved(lastMessage)) {
// Add delay for write operations
if (alwaysAllowWrite && isWriteToolAction(lastMessage)) {
if (lastMessage?.ask === "tool" && isWriteToolAction(lastMessage)) {
await new Promise(resolve => setTimeout(resolve, writeDelayMs))
}
handlePrimaryButtonClick()