Context
During cross-harness operations, the Bridge Daemon delivers Wake Payloads via osascript. If the user is actively working in a different application (like Antigravity IDE) when the daemon attempts to bring the target application (like Claude Desktop) to the front, macOS UI steal prevention can block the activate command.
The Problem
Because osascript's keystroke command natively routes keystrokes to the globally frontmost application (regardless of the surrounding tell process block), a failed focus steal causes the daemon to dump the Wake Payload and keystroke shortcuts into whatever application the user is currently using. This causes severe input clobbering and cross-contamination of agent messages.
The Architectural Reality
The issue lies in ai/scripts/bridge-daemon.mjs where osascriptArgs executes keystroke "v" without asserting that the application actually became frontmost.
The Fix
Update the AppleScript string in bridge-daemon.mjs to explicitly check if currentApp is not "${appName}" immediately before modifying the clipboard and sending the keystroke "v". If the focus steal failed, the script will gracefully throw an error and abort, preventing the bleed.
Acceptance Criteria
Origin Session ID: 49e9b05a-0581-4fb7-861f-7e4970ea4c2b
Context
During cross-harness operations, the Bridge Daemon delivers Wake Payloads via
osascript. If the user is actively working in a different application (like Antigravity IDE) when the daemon attempts to bring the target application (like Claude Desktop) to the front, macOS UI steal prevention can block theactivatecommand.The Problem
Because
osascript'skeystrokecommand natively routes keystrokes to the globally frontmost application (regardless of the surroundingtell processblock), a failed focus steal causes the daemon to dump the Wake Payload and keystroke shortcuts into whatever application the user is currently using. This causes severe input clobbering and cross-contamination of agent messages.The Architectural Reality
The issue lies in
ai/scripts/bridge-daemon.mjswhereosascriptArgsexecuteskeystroke "v"without asserting that the application actually became frontmost.The Fix
Update the AppleScript string in
bridge-daemon.mjsto explicitly checkif currentApp is not "${appName}"immediately before modifying the clipboard and sending thekeystroke "v". If the focus steal failed, the script will gracefully throw an error and abort, preventing the bleed.Acceptance Criteria
appName.Origin Session ID: 49e9b05a-0581-4fb7-861f-7e4970ea4c2b