Context
During the bidirectional smoke test of the wake substrate post-#10404 merge, Claude discovered a duplicate-wake delivery bug where a single A2A message generated TWO wake notifications. Issue #10410 originally tracked this alongside an idempotency bug; the idempotency bug was fixed (#10412), and the deduplication bug was explicitly deferred to this follow-up ticket.
The Problem
A single A2A message (e.g., MESSAGE:626881c7) generates two identical OS-level wake notifications, citing the exact same subscription ID (WAKE_SUB:ca08d381). The empirical reproducer is preserved in Claude's environment.
The Architectural Reality
The Bridge daemon (ai/scripts/bridge-daemon.mjs) polls the SQLite memory-core graph for new messages matching active Wake Subscriptions. During the coalescing window, if a message matches multiple edges or is encountered across multiple poll iterations before the digest flushes, it may queue duplicate delivery payloads because the coalescing logic lacks strict (messageId, subscriptionId) tuple deduplication before invoking the osascript hook.
The Fix
Introduce strict (subscription.id, trace.messageId) deduplication in the bridge-daemon.mjs coalescing logic or digest preparation phase. Ensure that within a single coalescing window, a given subscription is notified at most once about a specific message.
Acceptance Criteria
Out of Scope
- Changes to the underlying GraphLog schema or SQLite ingestion.
WakeSubscriptionService API changes.
Related
Origin Session ID: 49e9b05a-0581-4fb7-861f-7e4970ea4c2b
Context
During the bidirectional smoke test of the wake substrate post-#10404 merge, Claude discovered a duplicate-wake delivery bug where a single A2A message generated TWO wake notifications. Issue #10410 originally tracked this alongside an idempotency bug; the idempotency bug was fixed (#10412), and the deduplication bug was explicitly deferred to this follow-up ticket.
The Problem
A single A2A message (e.g.,
MESSAGE:626881c7) generates two identical OS-level wake notifications, citing the exact same subscription ID (WAKE_SUB:ca08d381). The empirical reproducer is preserved in Claude's environment.The Architectural Reality
The Bridge daemon (
ai/scripts/bridge-daemon.mjs) polls the SQLite memory-core graph for new messages matching active Wake Subscriptions. During the coalescing window, if a message matches multiple edges or is encountered across multiple poll iterations before the digest flushes, it may queue duplicate delivery payloads because the coalescing logic lacks strict(messageId, subscriptionId)tuple deduplication before invoking theosascripthook.The Fix
Introduce strict
(subscription.id, trace.messageId)deduplication in thebridge-daemon.mjscoalescing logic or digest preparation phase. Ensure that within a single coalescing window, a given subscription is notified at most once about a specific message.Acceptance Criteria
bridge-daemoncoalescing window.Out of Scope
WakeSubscriptionServiceAPI changes.Related
Origin Session ID: 49e9b05a-0581-4fb7-861f-7e4970ea4c2b