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
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
Origin Session ID: 09444f9b-9ae1-4d9a-81a4-02e885870417
Retrieval Hint: "cross-harness bidirectional wake osascript"
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\ncharacters injected into bash), UI delivery viaosascriptsuffered 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 totmux, which doesn't exist in the Antigravity desktop environment).The Problem
bridge-daemon.mjscontained SQL syntax errors when looking upSENT_BYedges, causing it to fail gracefully and label the sender asundefined.osascriptinjection, breaking multiline rendering in the target UI.Cmd+3(Code tab focus) and an atomic clipboard injection (Cmd+V) with sufficient delays (0.5s) instead of unreliable character-by-character keystrokes.Cmd+3. When given an invalid or empty configuration, it fell back totmux(causingspawn tmux ENOENTfor Antigravity).The Architectural Reality
ai/scripts/bridge-daemon.mjsacts as the cross-process bridge, tail-syncing from the Memory Core SQLite database and evaluating graph nodes against activeWAKE_SUBSCRIPTIONnodes.osascriptortmuxshell commands to pierce the harness container and trigger the target agent UI.The Fix
SENT_BYfallback query inbridge-daemon.mjs.\nwith actual newlines in the digest template string.osascriptadapter inbridge-daemon.mjsto use an atomic clipboard paste sequence (set the clipboard to argv) with safedelay 0.5timings.osascriptadapter dynamic: it now parsesappNameand an optionaltabShortcutfromsubscription.properties.harnessTargetMetadata..neo-ai-data/sqlite/memory-core-graph.sqliteto use the generalizedosascriptadapter, targeting"Antigravity"without theCmd+3shortcut.Acceptance Criteria
Cmd+3) before pasting.appNameresolution.spawn tmux ENOENTerrors occur on Antigravity delivery.Out of Scope
osascript).pump()through the coalescing engine.Related
Origin Session ID: 09444f9b-9ae1-4d9a-81a4-02e885870417 Retrieval Hint: "cross-harness bidirectional wake osascript"