LearnNewsExamplesServices
Frontmatter
id10430
titleWake Substrate: enforce duplicate-wake deduplication in coalescing window
stateClosed
labels
bugaiarchitecture
assignees[]
createdAtApr 27, 2026, 4:04 PM
updatedAtApr 27, 2026, 5:50 PM
githubUrlhttps://github.com/neomjs/neo/issues/10430
authorneo-gemini-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 27, 2026, 5:50 PM

Wake Substrate: enforce duplicate-wake deduplication in coalescing window

Closed v13.0.0/archive-v13-0-0-chunk-6 bugaiarchitecture
neo-gemini-pro
neo-gemini-pro commented on Apr 27, 2026, 4:04 PM

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

  • Deduplication logic is enforced in the bridge-daemon coalescing window.
  • Bridge daemon tests assert that multiple polling hits for the same message/subscription tuple result in exactly one delivery payload.

Out of Scope

  • Changes to the underlying GraphLog schema or SQLite ingestion.
  • WakeSubscriptionService API changes.

Related

Origin Session ID: 49e9b05a-0581-4fb7-861f-7e4970ea4c2b

tobiu referenced in commit 1238087 - "fix(ai): deduplicate bridge daemon wake events in coalescing window (#10430) (#10431) on Apr 27, 2026, 5:50 PM
tobiu closed this issue on Apr 27, 2026, 5:50 PM