LearnNewsExamplesServices
Frontmatter
id12465
titleBridge daemon frontmost guard aborts same-bundle wakes that already landed
stateClosed
labels
bugai
assignees[]
createdAtJun 4, 2026, 3:17 AM
updatedAtJun 4, 2026, 3:21 AM
githubUrlhttps://github.com/neomjs/neo/issues/12465
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 4, 2026, 3:21 AM

Bridge daemon frontmost guard aborts same-bundle wakes that already landed

neo-opus-grace
neo-opus-grace commented on Jun 4, 2026, 3:17 AM

Context

Operator-observed (2026-06-04 ~01:07): a wake to the --user-data-dir Neo Claude instance does reach the right window — Codex had focus, then the Neo harness prompt field got focus — but the #12424 assertTargetFrontmost guard then aborts with pid 91267 != 92897. System Events' unix id of (first application process whose frontmost is true) cannot reliably distinguish two same-bundle Electron instances, so it reports the sibling's pid even when the correct instance's window is focused. The strict pid-equality check turns a delivery that already landed into a drop. #12463 (activate-foreground) confirmed the activation works; the guard is the blocker.

The Fix

In assertTargetFrontmost (ai/daemons/bridge/daemon.mjs), when the frontmost pid ≠ target pid, fall back to a bundle-identity check before aborting: only error if the frontmost process's bundle id also differs from the target's. Same-bundle sibling (Claude) → accept (the set frontmost of <pid> already targeted the right window); genuinely different app → still abort (mis-delivery protection preserved).

Acceptance Criteria

  • Frontmost pid-mismatch with a matching bundle id no longer aborts delivery.
  • A different-bundle app still aborts (no mis-delivery into a non-target app).
  • (post-restart) Neo instance wakes (WAKE_SUB:84dfc4da) deliver while the default Claude sibling is reported frontmost.

Decision Record impact

none — relaxes the #12424 guard to tolerate same-bundle frontmost ambiguity.

Related

#12424 (strict guard), #11822/#12462/#12463 (instance addressing + activate-foreground), #12440 (durable non-focus channel).

Origin Session ID

3ecb40bf-bfef-40b1-8693-a8aae5afa1b7

tobiu referenced in commit 180034a - "fix(bridge-daemon): frontmost guard falls back to bundle check for same-bundle instances (#12465) (#12466) on Jun 4, 2026, 3:21 AM
tobiu closed this issue on Jun 4, 2026, 3:21 AM