LearnNewsExamplesServices
Frontmatter
id12536
titleClaude wake/resume routing targets generic app, not the per-identity --user-data-dir instance
stateClosed
labels
bugaiarchitecture
assigneesneo-gpt
createdAtJun 4, 2026, 9:35 PM
updatedAtJun 7, 2026, 7:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/12536
authorneo-opus-grace
commentsCount5
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 7, 2026, 5:08 AM

Claude wake/resume routing targets generic app, not the per-identity --user-data-dir instance

Closed v13.0.0/archive-v13-0-0-chunk-16 bugaiarchitecture
neo-opus-grace
neo-opus-grace commented on Jun 4, 2026, 9:35 PM

Authored by Claude Opus 4.8 (Claude Code) as @neo-opus-grace, /lead-role. MC session f5432f03-d2b6-4bc0-a7b5-9fbdafe4b7b9.

Refs #12524, #12434

Context

Operator PRIO-0 (2026-06-04): @neo-opus-vega's wakeups don't work — osascript "resume vega" spawns a fresh local Claude Code session every ~10m (the loop @tobiu flagged), and a @neo-opus-grace wake mis-routed (focus-stole) into @neo-opus-ada's session (opus-4.7's evidence). The wake safety gate is currently disabled (trippedBy @neo-opus-grace) to stop the resume-spawns; this ticket is the path to safely re-enabling it.

The Problem

All claude-family identities (@neo-opus-grace, @neo-opus-ada, @neo-opus-vega) resolve to a generic appName:'Claude' / Tab-3 osascript target in the wake/resume routing. But distinct per-identity Claude instances already exist via --user-data-dir (verified via ps: …/.claude-instances/Neo, …/.claude-instances/neo-opus-vega). The routing never uses that per-identity key → osascript activates "Claude" generically → the wrong/shared instance:

  • "resume vega" → a fresh ephemeral Tab-3 session (the 10m loop), never a persistent addressable vega.
  • a wake for one claude identity → focus-steals into whichever claude session is active (the opus-4.7 mis-route).

Affects both paths: bridge wake-delivery (ai/daemons/bridge/daemon.mjs) AND resumeHarness resume (ai/scripts/lifecycle/resumeHarness.mjs + harnessRouting.mjs).

The Architectural Reality

  • ai/scripts/lifecycle/harnessRouting.mjs (from #12524): FAMILY_HARNESS_TARGETS.claude = {adapter:'osascript', appName:'Claude', freshSessionShortcut:'n'} + applyHarnessMetadataDefaults adds tabShortcut:'3'. Same for all claude identities — no per-identity differentiation.
  • resumeHarness.mjs + harnessRouting.mjs + bridge/daemon.mjs never reference --user-data-dir / CWD (grep = zero).
  • The addressable key exists + is live: distinct --user-data-dir per identity (.claude-instances/<id>).
  • #12524 (#12434) made routing identity-derived (modelFamily) but not instance-addressable — it keeps the generic target. This is the #12524 follow-on.

The Fix

Wire the wake/resume routing to target the per-identity Claude instance by its --user-data-dir (the addressable key that already exists), instead of generic appName:'Claude'/Tab-3. Apply to both the bridge wake-delivery and resumeHarness resume paths.

Acceptance Criteria

  • Core AC / the key unknown: determine + implement how osascript addresses a specific Claude instance (by PID / window title / --user-data-dir-derived identity). @neo-opus-ada runs as a distinct instance and likely knows the mechanism.
  • resumeHarness resume targets the per-identity instance (vega resume → vega's instance, not a fresh Tab-3 / opus-4.7's).
  • bridge wake-delivery targets the per-identity instance (a wake for X lands in X's session — no cross-identity focus-steal).
  • vega is wake-able end-to-end (a new A2A message wakes vega's own instance).
  • Re-enabling the wake safety gate no longer resumes the vega 10m loop (gate stays disabled until this lands).
  • Unit coverage for the per-identity target resolution.

Out of Scope

  • The #12434/#12524 routing-SSOT refactor (separate).
  • The memory team-default (#12527/#12532).
  • Off-box/cloud wake (vega runs locally per the verified --user-data-dir instance).

Evidence

  • ps: distinct --user-data-dir instances (.claude-instances/Neo, .claude-instances/neo-opus-vega) — the lever exists (per @neo-opus-ada).
  • @neo-opus-ada's wake-mis-route (a @neo-opus-grace wake into his session) — the bridge-path symptom.
  • vega's ~10m resume-spawn loop — the resume-path symptom.
  • #12524 diff: resolveHarnessTargetForIdentity('@neo-opus-vega') → generic osascript/Claude/Tab-3 (the PR's own test).

Related

  • Refs #12524, #12434 (routing base; this extends identity-derived → instance-addressable).
  • Wake safety gate currently disabled — this is the re-enable path.

Origin Session ID: f5432f03-d2b6-4bc0-a7b5-9fbdafe4b7b9 Retrieval Hint: "per-identity osascript instance addressing user-data-dir wake routing"

tobiu referenced in commit 9b910f7 - "fix(wake): machine-agnostic subscriptionTemplate for vega (#12536) (#12570) on Jun 5, 2026, 3:33 PM
tobiu referenced in commit 18950c7 - "fix(ai): route resumeHarness to addressed Claude instance (#12536) (#12664) on Jun 7, 2026, 5:08 AM
tobiu closed this issue on Jun 7, 2026, 5:08 AM