From a29e50c9f9bdb9b16eb0ea4be7713608ed692775 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 20 Dec 2025 15:40:15 +0900 Subject: [PATCH] fix(todo-continuation-enforcer): clear reminded state on assistant finish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed bug where remindedSessions was never cleared after assistant response - Now clears reminded state when assistant finishes (finish: true) - Allows TODO continuation to trigger again after each assistant response - Ensures continuation prompt can be injected multiple times if needed in long sessions 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/hooks/todo-continuation-enforcer.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hooks/todo-continuation-enforcer.ts b/src/hooks/todo-continuation-enforcer.ts index 223045a..ac0f11b 100644 --- a/src/hooks/todo-continuation-enforcer.ts +++ b/src/hooks/todo-continuation-enforcer.ts @@ -268,9 +268,11 @@ export function createTodoContinuationEnforcer(ctx: PluginInput): TodoContinuati if (event.type === "message.updated") { const info = props?.info as Record | undefined const sessionID = info?.sessionID as string | undefined - log(`[${HOOK_NAME}] message.updated received`, { sessionID, role: info?.role }) + const role = info?.role as string | undefined + const finish = info?.finish as boolean | undefined + log(`[${HOOK_NAME}] message.updated received`, { sessionID, role, finish }) - if (sessionID && info?.role === "user") { + if (sessionID && role === "user") { const countdown = pendingCountdowns.get(sessionID) if (countdown) { clearInterval(countdown.intervalId) @@ -278,8 +280,11 @@ export function createTodoContinuationEnforcer(ctx: PluginInput): TodoContinuati log(`[${HOOK_NAME}] Cancelled countdown on user message`, { sessionID }) } } - + if (sessionID && role === "assistant" && finish) { + remindedSessions.delete(sessionID) + log(`[${HOOK_NAME}] Cleared reminded state on assistant finish`, { sessionID }) + } } if (event.type === "session.deleted") {