LearnNewsExamplesServices
Frontmatter
id10391
titleFinalize Phase 3 Wake Substrate with Bidirectional Delivery
stateClosed
labels
enhancementai
assignees[]
createdAtApr 26, 2026, 11:23 PM
updatedAtApr 26, 2026, 11:40 PM
githubUrlhttps://github.com/neomjs/neo/issues/10391
authorneo-gemini-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 26, 2026, 11:40 PM

Finalize Phase 3 Wake Substrate with Bidirectional Delivery

neo-gemini-pro
neo-gemini-pro commented on Apr 26, 2026, 11:23 PM

Context The Phase 3 Wake Substrate was failing to deliver autonomous wake payloads cleanly across harnesses. Sender resolution failed (resulting in undefined), payload formatting was broken (literal \n characters injected into bash), UI delivery via osascript suffered from race conditions with character-by-character simulated keystrokes, and bidirectional delivery to Gemini via Antigravity failed entirely because the daemon lacked dynamic application targeting (falling back to tmux, which doesn't exist in the Antigravity desktop environment).

The Problem

  • bridge-daemon.mjs contained SQL syntax errors when looking up SENT_BY edges, causing it to fail gracefully and label the sender as undefined.
  • Payload formatting didn't correctly convert literal backslashes to newlines for osascript injection, breaking multiline rendering in the target UI.
  • UI delivery to Claude Desktop was unreliable; it required explicit Cmd+3 (Code tab focus) and an atomic clipboard injection (Cmd+V) with sufficient delays (0.5s) instead of unreliable character-by-character keystrokes.
  • Bidirectionality failed because the adapter logic hardcoded "Claude" and Cmd+3. When given an invalid or empty configuration, it fell back to tmux (causing spawn tmux ENOENT for Antigravity).

The Architectural Reality

  • ai/scripts/bridge-daemon.mjs acts as the cross-process bridge, tail-syncing from the Memory Core SQLite database and evaluating graph nodes against active WAKE_SUBSCRIPTION nodes.
  • The daemon executes in the host macOS environment, relying on native osascript or tmux shell commands to pierce the harness container and trigger the target agent UI.

The Fix

  • Fixed SQL quoting in the SENT_BY fallback query in bridge-daemon.mjs.
  • Replaced literal \n with actual newlines in the digest template string.
  • Refactored the osascript adapter in bridge-daemon.mjs to use an atomic clipboard paste sequence (set the clipboard to argv) with safe delay 0.5 timings.
  • Made the osascript adapter dynamic: it now parses appName and an optional tabShortcut from subscription.properties.harnessTargetMetadata.
  • Updated the Gemini wake subscription natively in .neo-ai-data/sqlite/memory-core-graph.sqlite to use the generalized osascript adapter, targeting "Antigravity" without the Cmd+3 shortcut.

Acceptance Criteria

  • Claude Desktop receives wake digests with correct multiline formatting and sender identity.
  • Claude Desktop correctly switches to the Code tab (Cmd+3) before pasting.
  • Gemini (Antigravity) receives wake digests correctly using dynamic appName resolution.
  • No spawn tmux ENOENT errors occur on Antigravity delivery.

Out of Scope

  • Phase 4 transition to native MCP client subscription models (deprecating osascript).
  • Addressing the outstanding Playwright boot regression.
  • Wiring pump() through the coalescing engine.

Related

  • None directly.

Origin Session ID: 09444f9b-9ae1-4d9a-81a4-02e885870417 Retrieval Hint: "cross-harness bidirectional wake osascript"

tobiu referenced in commit 3ee3407 - "feat(ai): Finalize Phase 3 Wake Substrate with Bidirectional Delivery (#10391) (#10392) on Apr 26, 2026, 11:40 PM
tobiu closed this issue on Apr 26, 2026, 11:40 PM