LearnNewsExamplesServices
Frontmatter
id10658
titleFix Claude bridge prompt-focus regression
stateClosed
labels
bugaitestingregressionarchitecture
assigneestobiu
createdAtMay 3, 2026, 7:20 PM
updatedAtMay 12, 2026, 12:22 PM
githubUrlhttps://github.com/neomjs/neo/issues/10658
authorneo-gpt
commentsCount11
parentIssue10647
subIssues
10660 Add Claude bridge Space focus seed
10987 Replace Claude Space wake seed with r undo sequence
subIssuesCompleted2
subIssuesTotal2
blockedBy[]
blocking[]
closedAtMay 12, 2026, 12:22 PM

Fix Claude bridge prompt-focus regression

Closedbugaitestingregressionarchitecture
neo-gpt
neo-gpt commented on May 3, 2026, 7:20 PM

Context

After #10654, #10655, and #10656 merged on 2026-05-03, the wake-substrate restart sequence entered the #10649 cross-harness prompt-landing matrix. The bridge backlog fence was applied first: .neo-ai-data/wake-daemon/lastSyncId was advanced to GraphLog max 3035185, leaving zero pending rows before bridge start.

The bridge was then started manually from the Claude clone root:

[2026-05-03T17:14:13.922Z] [PID:4747] [INFO] [Bridge Daemon] Started. Tail-syncing from GraphLog ID: 3035185

Codex sent one controlled Claude-row matrix payload:

  • Message: MESSAGE:9543778b-f623-4471-80e1-d418f5b85206
  • Subject: MATRIX_CLAUDE_20260503_1716 controlled wake test
  • Target: @neo-opus-4-7
  • Token: MATRIX_CLAUDE_20260503_1716_CDX

The bridge logged adapter success:

[2026-05-03T17:16:29.955Z] [PID:4747] [INFO] [Bridge Daemon] Delivered WAKE_SUB:4df2d514-90ef-4b11-8c96-e25dabb197f3 via osascript to Claude

But @tobiu observed the actual harness effect: Claude selected active session text content, not the input field. The test was hard-stopped immediately. Codex killed bridge PID 4747 and explicitly tripped the wake safety gate:

{
  "state": "tripped",
  "reason": "Claude matrix row failed: bridge selected active session text content instead of input field; hard stop 2026-05-03T17:17Z",
  "trippedBy": "neo-gpt"
}

Duplicate Sweep Notes

  • Live latest-20 open GitHub issues were read with number/title/author/labels/URL. Adjacent open items include #10647 (wake incident safety tree), #10643, #10633, #10627, #10604, #10517, #10442, and #10422. None owns the newly confirmed Claude prompt-focus matrix failure after the 2026-05-03 restart.
  • Local resource search found historical adjacency:
    • #10391 documented that earlier Claude wake delivery relied on Cmd+3 plus atomic clipboard injection.
    • #10422 covers AppleScript focus-steal bleed as a general wake-substrate class.
    • #10644 fixed Antigravity prompt-surface routing and explicitly warned that toggle-like shortcuts are unsafe; it also noted Claude Cmd+3 needed audit if it behaved like a toggle or failed to focus the composer.
  • ask_knowledge_base(type: 'ticket', query='Claude bridge prompt focus wake delivery ticket duplicate') returned no relevant duplicate.

The Problem

The Claude row of the #10649 matrix failed at the critical user-visible layer. A2A storage, wake subscription matching, GraphLog tailing, and bridge adapter invocation all succeeded, but the payload did not land in the Claude prompt/composer surface.

This is exactly the failure class #10649 was created to catch: bridge success is not wake success. The current bridge log says Delivered ... via osascript to Claude, yet the observable effect was selection of active session transcript/content.

The regression is severe because Claude wake delivery had worked before. Historical tickets and comments record prior success with Cmd+3 for the Claude Code tab plus clipboard injection. The current 2026-05-03 live harness behavior invalidates the assumption that Cmd+3 leaves the Claude prompt field focused.

The Architectural Reality

The active Claude Shape C subscription is:

WAKE_SUB:4df2d514-90ef-4b11-8c96-e25dabb197f3 | @neo-opus-4-7 | {"appName":"Claude","tabShortcut":"3"}

ai/scripts/bridge-daemon.mjs currently treats Claude as a generic osascript target:

  • appName comes from harnessTargetMetadata.appName.
  • tabShortcut defaults to 3 for Claude when undefined.
  • The AppleScript activates the app, sends the tab shortcut, then issues Cmd+A, Cmd+X, clipboard paste, and Enter.

Relevant anchors:

  • ai/scripts/bridge-daemon.mjs:575-582 — Claude tabShortcut default and Antigravity fallback mapping.
  • ai/scripts/bridge-daemon.mjs:606-618 — app activation plus shortcut emission.
  • ai/scripts/bridge-daemon.mjs:625-643 — destructive focus-dependent Cmd+A / Cmd+X / Cmd+V / Enter sequence.
  • ai/docs/wake-prompt-landing-matrix.md — requirement 6 (Prompt Payload Lands) and requirement 8 (No Fresh Session Spawns).
  • learn/agentos/tooling/WakeSubstrateIncidentProtocol.md — freeze rule and reactivation evidence requirements.

The owning substrate is the bridge daemon's Claude osascript adapter/focus strategy, not A2A storage, not wake subscription bootstrap, and not heartbeat.

The Fix

Empirically derive and implement a Claude-specific prompt-focus strategy that proves the composer/input surface is focused before any destructive selection or paste step.

The fix may take one of these shapes, but must be validated against the live Claude harness:

  1. Replace the current Cmd+3-only focus assumption with a verified prompt-focus primitive for Claude Desktop / Claude Code tab.
  2. Add an Accessibility-based target/click/focus operation that selects the composer, not the transcript area.
  3. Remove or guard the destructive Cmd+A / Cmd+X cleanup for Claude unless the prompt field focus is proven.
  4. Add a fail-closed check where feasible: if the adapter cannot prove prompt-focus preconditions, it must log a blocked state and avoid pasting.

The implementation must keep the bridge backlog fence and safety gate discipline intact: no bridge restart as a background service, no heartbeat reactivation, and no gate enable until the Claude row of the #10649 matrix is green.

Acceptance Criteria

  • Reproduce the current failure from a controlled Claude-row matrix payload or document why the original MESSAGE:9543778b-f623-4471-80e1-d418f5b85206 evidence is sufficient.
  • Identify the current Claude Desktop / Claude Code prompt-focus primitive empirically. Do not assume Cmd+3 focuses the composer.
  • bridge-daemon.mjs no longer runs a focus-dependent destructive Cmd+A / Cmd+X sequence against Claude unless composer focus is verified.
  • Add deterministic unit coverage for the generated Claude adapter strategy where feasible.
  • Run the #10649 Claude row live with a fresh unique payload and capture evidence for requirements 1-10.
  • Confirm no active session transcript/content is selected or modified during the fixed wake attempt.
  • Keep wake safety gate tripped or disabled until the Claude row is green; only then can #10650 reactivation evidence proceed.
  • Post validation evidence back to #10647 or the implementing PR so future agents can distinguish adapter success from prompt-landing success.

Out of Scope

  • Fixing Antigravity prompt routing; #10644 owns that historical regression class and the Antigravity row should be tested separately.
  • Fixing Codex prompt routing; Codex row remains a separate matrix row.
  • Reactivating heartbeat or enabling the wake safety gate.
  • Redesigning A2A mailbox storage or wake subscription persistence.
  • Broad harness registry redesign unless a minimal Claude-focused adapter fix proves impossible.

Avoided Traps

  • Trap: bridge log says delivered, therefore done. Rejected. The user-visible effect failed even with Delivered ... via osascript to Claude in the log.
  • Trap: continue with Antigravity/Codex rows after Claude failure. Rejected. Hard stop is correct; the matrix exposed a loop-level failure.
  • Trap: restart bridge with backlog still pending. Rejected. The backlog fence was applied before this test and must be repeated before any future restart because new coordination messages will create fresh GraphLog rows.
  • Trap: trust historical Cmd+3 behavior. Rejected. It worked before, but live 2026-05-03 behavior selected session text content. The fix must verify current harness reality.

Related

  • Parent epic: #10647.
  • Matrix: #10649.
  • Incident protocol: #10650.
  • Antigravity prompt-surface regression: #10644.
  • Historical AppleScript focus-steal class: #10422.
  • Historical Claude bridge focus documentation: #10391.

Origin Session ID: 3ce08a3c-9582-4de4-8c14-48ec9fad1e2f

Retrieval Hint: Claude bridge prompt focus selected active session text content MATRIX_CLAUDE_20260503_1716_CDX bridge delivered not prompt landing.

tobiu assigned to @tobiu on May 12, 2026, 12:22 PM
tobiu closed this issue on May 12, 2026, 12:22 PM