Context
Reproduced 2026-04-28 immediately after A2A substrate restoration. Wake delivery to Antigravity (now a VS Code extension as of 2026) injected the literal [WAKE] text and message preview into the active editor buffer instead of the agent input panel. The open file at the time was ai/graph/storage/SQLite.mjs, so wake text became literal source-file content. Verbatim editor capture:
[WAKE] 1 events for @neo-gemini-pro:
- 1 new messages (latest: "Re: A2A Two-Way Stability Test — confirmed bidirectional" from @neo-opus-ada)
Subscription: WAKE_SUB:b3d1179c-2d75-4816-9cb1-17669df51241
Window: 30001ms
import Base from './Base.mjs';
...
Risk: silent source-file corruption that can land in commits if the agent's editor focus is on a working file when wake fires.
The Problem
The bridge daemon's Shape C delivery on macOS uses osascript System Events keystroke injection. Before keystroking the digest, the script optionally hits a tabShortcut to bring the agent panel to focus — and the dispatch at ai/scripts/bridge-daemon.mjs:506 already handles this for Cursor (Cmd+L). Antigravity uses the same Cmd+L agent-panel-focus shortcut as Cursor, but appName === 'Antigravity' was never added to the dispatch when the harness migrated to a VS Code extension model in 2026. With no tabShortcut applied, keystrokes route to whichever pane holds focus — typically the active editor.
The Architectural Reality
ai/scripts/bridge-daemon.mjs:506 (current):
else if (appName === 'Cursor') tabShortcut = 'l';
The dispatch is missing 'Antigravity'. No other code change is required — the rest of the osascript flow (activate appName → keystroke tabShortcut + Cmd → delay 0.5s → keystroke digest) works correctly for Cursor and will work identically for Antigravity once the appName is recognized.
The Fix
Extend the existing dispatch at ai/scripts/bridge-daemon.mjs:506 to include Antigravity:
else if (appName === 'Cursor' || appName === 'Antigravity') tabShortcut = 'l';
One-line change. Local-tested by @neo-gemini-pro; PR forthcoming on branch fix/antigravity-bridge-daemon-shortcut.
Acceptance Criteria
Out of Scope
- Auto-detection of IDE-extension harnesses — explicit per-
appName dispatch is the existing contract; auto-detection adds complexity for no reliability gain
- Migration to a different delivery substrate (HTTP webhook into the VS Code extension, MCP server-push notifications, etc.) — these are durable architectural alternatives that may be revisited later, but they are NOT this ticket and do NOT block this fix
- Eliminating the theoretical race window between the tabShortcut fire and the digest keystroke — the existing 0.5s
delay makes this practically rare; defer until empirical evidence shows the race actually fires
Avoided Traps
- Adding a new
harnessKind discriminator on manage_wake_subscription. Rejected. The dispatch already keys on appName; adding a parallel harnessKind field duplicates the existing routing axis and creates schema-evolution debt. The simpler fix is to extend the existing appName switch.
- Disabling Shape C delivery for any GUI-app target as a defensive measure. Rejected. Cursor uses the same Shape C with the same dispatch and works correctly — the substrate isn't broken, only the Antigravity branch was missing.
Related
- Substrate:
ai/scripts/bridge-daemon.mjs Shape C delivery dispatch
- Adjacent: #10446 (
feat(bridge-daemon): fail-fast on empty appName metadata) — same file, complementary defensive guard
- Empirical reproducer session: wake delivery only became routinely exercised after the SQLite IN-clause overflow (#10463/#10464/#10465/#10466) cleared and A2A substrate came back online
Origin Session ID: 4bb6859b-860f-440d-9055-320e20b0ee22
Retrieval Hint: bridge daemon Shape C osascript keystroke injection VS Code Antigravity active editor source file corruption tabShortcut appName dispatch
Context
Reproduced 2026-04-28 immediately after A2A substrate restoration. Wake delivery to Antigravity (now a VS Code extension as of 2026) injected the literal
[WAKE]text and message preview into the active editor buffer instead of the agent input panel. The open file at the time wasai/graph/storage/SQLite.mjs, so wake text became literal source-file content. Verbatim editor capture:Risk: silent source-file corruption that can land in commits if the agent's editor focus is on a working file when wake fires.
The Problem
The bridge daemon's Shape C delivery on macOS uses
osascriptSystem Events keystroke injection. Before keystroking the digest, the script optionally hits a tabShortcut to bring the agent panel to focus — and the dispatch atai/scripts/bridge-daemon.mjs:506already handles this for Cursor (Cmd+L). Antigravity uses the sameCmd+Lagent-panel-focus shortcut as Cursor, butappName === 'Antigravity'was never added to the dispatch when the harness migrated to a VS Code extension model in 2026. With no tabShortcut applied, keystrokes route to whichever pane holds focus — typically the active editor.The Architectural Reality
ai/scripts/bridge-daemon.mjs:506(current):else if (appName === 'Cursor') tabShortcut = 'l';The dispatch is missing
'Antigravity'. No other code change is required — the rest of the osascript flow (activate appName → keystroke tabShortcut + Cmd → delay 0.5s → keystroke digest) works correctly for Cursor and will work identically for Antigravity once the appName is recognized.The Fix
Extend the existing dispatch at
ai/scripts/bridge-daemon.mjs:506to include Antigravity:else if (appName === 'Cursor' || appName === 'Antigravity') tabShortcut = 'l';One-line change. Local-tested by @neo-gemini-pro; PR forthcoming on branch
fix/antigravity-bridge-daemon-shortcut.Acceptance Criteria
ai/scripts/bridge-daemon.mjs:506dispatch includesappName === 'Antigravity'test/playwright/unit/ai/scripts/bridge-daemon.spec.mjsextended to cover theappName === 'Antigravity'branch (asserttabShortcut === 'l'is applied)Cursor, terminal/tmux,Claude)(#10467)per AGENTS.md §3 Gate 1; type=fix, scope=aiOut of Scope
appNamedispatch is the existing contract; auto-detection adds complexity for no reliability gaindelaymakes this practically rare; defer until empirical evidence shows the race actually firesAvoided Traps
harnessKinddiscriminator onmanage_wake_subscription. Rejected. The dispatch already keys onappName; adding a parallelharnessKindfield duplicates the existing routing axis and creates schema-evolution debt. The simpler fix is to extend the existingappNameswitch.Related
ai/scripts/bridge-daemon.mjsShape C delivery dispatchfeat(bridge-daemon): fail-fast on empty appName metadata) — same file, complementary defensive guardOrigin Session ID:
4bb6859b-860f-440d-9055-320e20b0ee22Retrieval Hint:
bridge daemon Shape C osascript keystroke injection VS Code Antigravity active editor source file corruption tabShortcut appName dispatch