From 66f5e0923d931b687d40d5af2fbe723577720d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 22:51:12 -0400 Subject: [PATCH] fix(automation): log no-op status-change calls instead of silently returning P2-34: Silent no-op guard hid caller bugs. Warn-log the violation so it shows up in traces; callers should still gate. --- src/main/automation/automation-handlers.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/automation/automation-handlers.ts b/src/main/automation/automation-handlers.ts index 46d0b06f..cc437850 100644 --- a/src/main/automation/automation-handlers.ts +++ b/src/main/automation/automation-handlers.ts @@ -31,7 +31,13 @@ export function handleTaskStatusChange( newStatus: string, ): void { if (deps.isQuitting()) return; - if (previousStatus === newStatus) return; + if (previousStatus === newStatus) { + // Caller should gate this; log the no-op so the offender can be traced. + deps.logger.warn( + `[automation] handleTaskStatusChange called with no-op status (${previousStatus}) for task ${taskId} — caller should gate this.`, + ); + return; + } const { db, wakeAgentIfPossible } = deps; const { dispatchAutomation } = callbacks;