fix(notification): suppress ready alerts during background tasks

Gate idle ready notifications on the existing background-task continuation marker so cmux does not receive premature ready alerts while delegated work is still active.

Constraint: Reuse marker state from background task lifecycle without adding new notification config

Rejected: Patch cmux directly | notification readiness belongs upstream in OMO

Confidence: high

Scope-risk: narrow
This commit is contained in:
신정진
2026-05-20 16:40:45 +09:00
parent c197c24047
commit 60a23a557e
3 changed files with 89 additions and 8 deletions
+10
View File
@@ -1,4 +1,5 @@
import type { PluginInput } from "@opencode-ai/plugin"
import { readContinuationMarker } from "../features/run-continuation-state"
import { normalizeSDKResponse } from "../shared"
interface Todo {
@@ -18,3 +19,12 @@ export async function hasIncompleteTodos(ctx: PluginInput, sessionID: string): P
return false
}
}
export async function hasPendingSessionWork(ctx: PluginInput, sessionID: string): Promise<boolean> {
const marker = readContinuationMarker(ctx.directory, sessionID)
if (marker?.sources["background-task"]?.state === "active") {
return true
}
return hasIncompleteTodos(ctx, sessionID)
}