LearnNewsExamplesServices
Frontmatter
id10410
titleWake Substrate post-#10404 hardening: idempotency + duplicate deduplication
stateClosed
labels
bug
assigneesneo-opus-4-7
createdAtApr 27, 2026, 12:22 PM
updatedAtApr 27, 2026, 1:36 PM
githubUrlhttps://github.com/neomjs/neo/issues/10410
authorneo-gemini-3-1-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 27, 2026, 1:36 PM

Wake Substrate post-#10404 hardening: idempotency + duplicate deduplication

Closedbug
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on Apr 27, 2026, 12:22 PM

Wake Substrate post-#10404 hardening: idempotency + duplicate deduplication

Context

During the bidirectional smoke test of the wake substrate post-#10404 merge, Claude (@neo-opus-4-7) empirically discovered two distinct bugs in the wake infrastructure related to idempotency and duplicate deduplication.

Bug 1: Bootstrap Idempotency Miss

Calling manage_wake_subscription({action: 'bootstrap'}) when a subscription already exists for the tuple (agentIdentity, trigger, harnessTarget) should return status: 'existing' and avoid creating a duplicate. Instead, the action created a duplicate sub (e.g., WAKE_SUB:e5f96999 alongside existing WAKE_SUB:ca08d381) populated with the new template metadata.

Possible causes:

  • The db.nodes.items iteration in WakeSubscriptionService.mjs:bootstrap failed to surface the old sub (potential cache miss).
  • The trigger/harnessTarget shape on the old sub differs from the template post-load.
  • Flawed tuple-matching logic.

Bug 2: Duplicate-Wake Delivery

A single A2A message (MESSAGE:626881c7) generated TWO wake notifications for the receiving agent, both citing the exact same subscription ID (Subscription: WAKE_SUB:ca08d381).

Possible causes:

  • The Bridge daemon poll-loop iterates trace × sub pairs without strict per-(sub, trace) deduplication before osascript/prompt injection.
  • The Coalescing engine flushed twice within the 30s window.
  • add_message created two SENT_TO edges for the same MESSAGE id.

Proposed Solution

  1. Idempotency Fix: Audit and patch WakeSubscriptionService.mjs:bootstrap to correctly identify existing subscriptions for the target tuple, preventing the generation of duplicate subscription nodes.
  2. Deduplication Fix: Introduce a (sub, trace) deduplication map/set in bridge-daemon.mjs (or the coalescing logic) before invoking the hardware interrupt/wake script.

Note: The duplicate WAKE_SUB:ca08d381 is currently active and intentionally being kept alive by Claude (@neo-opus-4-7) for live-reproducible testing. Do not forcibly unsubscribe it until the fix is developed and validated against it.

tobiu closed this issue on Apr 27, 2026, 1:36 PM
tobiu referenced in commit 1b52925 - "fix(memory-core): bootstrap idempotency uses raw SQL (#10410) (#10412) on Apr 27, 2026, 1:36 PM
tobiu referenced in commit 4d6c703 - "feat(bridge-daemon): persist diagnostic logs to disk (#10419) (#10425) on Apr 27, 2026, 4:18 PM