LearnNewsExamplesServices
Frontmatter
id10664
titleFail closed for Codex UI wake after Space seed failure
stateClosed
labels
bugairegressionarchitecture
assigneesneo-opus-4-7
createdAtMay 3, 2026, 10:10 PM
updatedAtMay 3, 2026, 10:42 PM
githubUrlhttps://github.com/neomjs/neo/issues/10664
authorneo-gpt
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 3, 2026, 10:42 PM

Fail closed for Codex UI wake after Space seed failure

Closedbugairegressionarchitecture
neo-gpt
neo-gpt commented on May 3, 2026, 10:10 PM

Context

This ticket exists because the post-merge validation path for #10663 was falsified before we restarted the bridge.

On 2026-05-03, @tobiu manually tested Codex Desktop with the composer unfocused and observed:

  • Pressing Space when the Codex prompt field is not focused applies a focus outline but does not focus the composer.
  • Pressing Enter behaves similarly: outline / focus affordance, not usable composer focus.
  • Printable keys such as r can move focus into the prompt, but if the prompt already contains text, the key replaces the existing prompt input. Printable-key seeding is therefore destructive and cannot be used before the bridge's Cmd+A / Cmd+X clear path.

This invalidates the live-behavior hypothesis behind #10662 / PR #10663 for Codex. Unit coverage correctly proves that the daemon emits activate -> Space -> Cmd+A, but the live Codex app shows Space is not a safe composer-focus primitive.

Immediate mitigation already applied by @neo-gpt:

  • Wake safety gate remains tripped with the updated Codex Space/Enter failure reason.
  • @neo-gpt's WAKE_SUB:f9a09dfd-37de-40e5-8857-6cd2c7373232 subscription was changed to harnessTarget: 'disabled' to prevent unsafe UI wake injection while preserving Memory Core coordination.

The Problem

The bridge daemon's osascript delivery path is focus-dependent and destructive:

  1. Activate app.
  2. Optionally emit tab/focus seed keys.
  3. Clear current target with Cmd+A / Cmd+X.
  4. Paste the wake payload and press Enter.

For Codex Desktop, no currently validated key seed can guarantee that step 3 targets the composer. Space and Enter are non-destructive but insufficient. Printable keys can focus but mutate or replace user prompt text. Therefore Codex UI wake delivery must fail closed until a verified direct composer-focus primitive or non-UI delivery adapter exists.

Leaving the merged #10663 Codex Space default as if it were sufficient is dangerous for two reasons:

  • It can give future agents a false green signal that Codex prompt landing is fixed.
  • If the Codex bridge-daemon subscription is re-enabled prematurely, osascript can still operate on thread history or other focused UI rather than the composer.

The Architectural Reality

Relevant code and state:

  • ai/scripts/bridge-daemon.mjs now defaults focusSeedKey = 'space' for appName === 'Claude' || appName === 'Codex' after PR #10663.
  • test/playwright/unit/ai/scripts/bridge-daemon.spec.mjs verifies Codex emits activate -> Space -> Cmd+A and does not emit Cmd+3.
  • test/playwright/unit/ai/mcp/server/memory-core/services/WakeSubscriptionService.spec.mjs verifies focusSeedKey: 'space' can round-trip for Codex metadata.
  • @neo-gpt's live subscription currently remains active but harnessTarget is disabled as a runtime safety mitigation.
  • #10517 is the medium-term non-UI routing lane for Codex app-server delivery (turn/start, turn/steer, thread/inject_items) and should not be duplicated here.

The bridge layer owns the immediate fail-closed behavior; #10517 owns the durable app-server routing architecture.

The Fix

Implement a narrow safety correction for Codex UI wake delivery:

  1. Remove or neutralize the Codex default focusSeedKey: 'space' claim in bridge-daemon.mjs so the code no longer implies Space is sufficient for Codex composer focus.
  2. Add a fail-closed guard for appName === 'Codex' on the osascript bridge path unless an explicitly validated non-destructive Codex focus primitive is configured in metadata.
  3. Keep Claude's Space seed intact and keep Antigravity on the verified Cmd+Shift+I path.
  4. Preserve @neo-gpt's disabled bridge-daemon subscription until a safe delivery path exists.
  5. Point future Codex delivery work to #10517 rather than extending blind key-seed experiments.

Acceptance Criteria

  • bridge-daemon.mjs no longer presents Codex Space seeding as a validated default composer-focus fix.
  • Codex osascript UI delivery fails closed by default, or otherwise refuses to proceed before destructive Cmd+A / Cmd+X when composer focus is unproven.
  • Claude's existing Space seed remains covered and unchanged.
  • Antigravity's Cmd+Shift+I route remains covered and unchanged.
  • Unit tests prove Codex no longer silently proceeds through the destructive clear path under the default metadata shape.
  • Issue / PR body explicitly links #10517 as the durable Codex app-server delivery lane.
  • Post-merge: @neo-gpt wake subscription remains disabled until a verified safe Codex path exists.

Out of Scope

  • Implementing the Codex app-server adapter itself. That belongs to #10517 or a narrower sub-ticket under #10517.
  • Retesting Claude Desktop prompt focus. Claude remains covered by #10660 / #10661.
  • Changing Antigravity / Gemini delivery. Antigravity remains green via Cmd+Shift+I.
  • Heartbeat reactivation, WAKE_GATE_OVERRIDE=1, or fresh-session recovery. Those stay blocked until the full matrix is green and @tobiu explicitly flips the gate.

Avoided Traps

  • Trap: try another printable key seed such as r. Rejected. Printable keys can replace existing Codex prompt text when the composer is unfocused, so they are not safe pre-clear focus primitives.
  • Trap: treat unit ordering tests as matrix green evidence. Rejected. The unit test proves emitted osascript order only; live Codex behavior falsified the focus assumption.
  • Trap: duplicate #10517. Rejected. This ticket is only the immediate fail-closed correction for unsafe Codex UI wake. #10517 remains the durable app-server / wakePolicy routing lane.
  • Trap: re-enable heartbeat because #10663 merged. Rejected. The merge did not produce live prompt-landing proof; the gate remains tripped.

Related

  • #10649 — Wake prompt-landing matrix; Codex row remains red.
  • #10662 / PR #10663 — Codex Space seed quick-fix hypothesis, now live-falsified.
  • #10660 / PR #10661 — Claude Space seed, still valid for Claude.
  • #10517 — Medium-term Codex app-server / HarnessPresence routing lane.
  • #10650 — Wake Substrate Incident Protocol; matrix green is required before reactivation.
  • #10647 — Original wake incident safety tree epic, now closed but still the incident context.

Origin Session ID

Origin Session ID: d9cd4943-3285-47a6-b629-c05a9a2a38e4

Retrieval Hint

query_raw_memories("Codex Space Enter focus outline printable key replaces prompt focusSeedKey") and query_raw_memories("Codex collapsed-sidebar #10663 Space seed failed manual validation").

Duplicate sweep performed before creation:

  • Local content sweep found adjacent tickets #10658, #10660, #10644, #10517, but no exact ticket for live-falsified Codex Space seed fail-closed correction.
  • Latest 20 open GitHub tickets were reviewed for title/author/labels; #10517 is related but medium-term routing, not this immediate safety correction.
  • Knowledge Base ticket query returned no relevant documents for this exact framing.
tobiu referenced in commit 60b9c7b - "fix(ai): fail closed for Codex UI wake (#10664) (#10665) on May 3, 2026, 10:42 PM
tobiu closed this issue on May 3, 2026, 10:42 PM