From b4d5f211f7001ca6c985f23bf141c8a20bff3b72 Mon Sep 17 00:00:00 2001 From: Will Chen Date: Thu, 19 Jun 2025 09:21:37 -0700 Subject: [PATCH] Do not commit if only execute SQL queries (#446) Fixes #438 --- src/ipc/processors/response_processor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ipc/processors/response_processor.ts b/src/ipc/processors/response_processor.ts index e102a82..4d9d7e0 100644 --- a/src/ipc/processors/response_processor.ts +++ b/src/ipc/processors/response_processor.ts @@ -228,6 +228,7 @@ export async function processFullResponseActions( const dyadExecuteSqlQueries = chatWithApp.app.supabaseProjectId ? getDyadExecuteSqlTags(fullResponse) : []; + let writtenSqlMigrationFiles = 0; const message = await db.query.messages.findFirst({ where: and( @@ -259,6 +260,7 @@ export async function processFullResponseActions( query.content, query.description, ); + writtenSqlMigrationFiles++; } catch (error) { errors.push({ message: `Failed to write SQL migration file for: ${query.description}`, @@ -445,7 +447,7 @@ export async function processFullResponseActions( renamedFiles.length > 0 || deletedFiles.length > 0 || dyadAddDependencyPackages.length > 0 || - dyadExecuteSqlQueries.length > 0; + writtenSqlMigrationFiles > 0; let uncommittedFiles: string[] = []; let extraFilesError: string | undefined;