---
number: 10663
title: 'fix(ai): extend focus seed default to Codex (#10662)'
author: neo-opus-ada
state: MERGED
createdAt: '2026-05-03T19:53:24Z'
updatedAt: '2026-05-03T20:01:02Z'
closedAt: '2026-05-03T20:00:58Z'
mergedAt: '2026-05-03T20:00:57Z'
head: agent/10662-codex-focus-seed
base: dev
url: 'https://github.com/neomjs/neo/pull/10663'
---
Authored by Claude Opus 4.7 (1M context) (Claude Code). Session 9766f91c-51f8-44fe-ac34-d79f61a0e1bf.

Resolves #10662
Related: #10661 (Claude focus seed PR — substrate primitive this extends), #10649 (matrix execution that surfaced the regression), #10647 (Wake Incident Safety Tree epic — parent), #10650 (Wake Substrate Incident Protocol — reactivation evidence requirements gate this)

Mirrors PR #10661 verbatim for Codex. The collapsed-sidebar regression that #10649 matrix execution surfaced (Codex row red on 2026-05-03 ~19:43Z) is the same failure-mode class as the Claude pre-#10661 case: bridge wake reaches the app window via osascript, but composer focus is uncertain — the first `Cmd+A` in the destructive-clear sequence selects the wrong target (thread history instead of composer content).

PR #10661 introduced the per-harness `focusSeedKey` primitive precisely for this extension shape: future harnesses adopt the seed by extending the per-harness default conditional, not by re-architecting the bridge. This PR's bridge-daemon change is one line.

## Surface

- **`ai/scripts/bridge-daemon.mjs`** (~10 lines: 1-line conditional change + Anchor & Echo block update). Extends the `focusSeedKey === undefined && appName === 'Claude'` default to `(appName === 'Claude' || appName === 'Codex')`. Anchor & Echo block now cites the empirical Codex collapsed-sidebar regression + #10662 + #10649.
- **`test/playwright/unit/ai/mcp/server/memory-core/services/WakeSubscriptionService.spec.mjs`** (~28 lines). Round-trip test for Codex `harnessTargetMetadata` with `focusSeedKey: 'space'` + `tabShortcut: null`, mirroring the existing Claude round-trip test.
- **`test/playwright/unit/ai/scripts/bridge-daemon.spec.mjs`** (~95 lines). Ordering test for Codex (`activate < space < clear`) using the same mock-osascript pattern as the existing Claude ordering test. Plus a negative drift guard (`not.toContain('keystroke "3" using command down')`) — Codex has no Code-tab equivalent so the bridge must not emit a Cmd+3 keystroke. Distinct from Claude's `activate < tab < space < clear` order.

## Deltas from ticket

None — the fix matches #10662's prescription verbatim. The Anchor & Echo update covers the trap reasoning the ticket called out (don't introduce a new primitive; extend the existing one).

## Test Evidence

```
$ npx playwright test -c test/playwright/playwright.config.unit.mjs \\
    test/playwright/unit/ai/scripts/bridge-daemon.spec.mjs \\
    test/playwright/unit/ai/mcp/server/memory-core/services/WakeSubscriptionService.spec.mjs
Running 44 tests using 8 workers
  44 passed (8.7s)
```

New spec coverage:
- **WakeSubscriptionService.spec.mjs**: `MCP tool preserves explicit bridge-daemon metadata for Codex with focusSeedKey (#10662)` — verifies the round-trip preserves `appName: 'Codex'` + `focusSeedKey: 'space'` + `tabShortcut: null`
- **bridge-daemon.spec.mjs**: `Codex default focus seed generates Space after activate and before prompt clear (#10662)` — verifies the keystroke order `activate < space < clear` AND the negative drift guard (no Cmd+3 emitted for Codex)

Existing Claude + Antigravity tests all pass — no regression in the prior matrix rows.

## Post-Merge Validation

- [ ] Controlled bridge test against `@neo-gpt` Codex Desktop with sidebar collapsed: wake-digest lands in composer (not thread history); matrix Codex row flips from RED to GREEN
- [ ] Per the #10650 protocol "Reactivation Evidence Requirements" section: with all three matrix rows green AND all local regressions merged AND bridge backlog fence path documented, reactivation-gate becomes eligible — final flip is @tobiu's call
- [ ] Once reactivation completes: file the post-incident retrospective on #10647 using the protocol's template; close #10647 epic with summary

## Out of Scope (per ticket)

- **Codex app-server adapter** (`turn/start` / `turn/steer` / `thread/inject_items` via `codex debug app-server send-message-v2`) — anchored on existing #10517, owned by @neo-gpt; supersedes UI-keystroke delivery once shipped
- **Bridge backlog fence handling** — already documented in the #10650 protocol
- **Cross-process cache-invalidation under live updates** — separate substrate concern (#10186)
- **Disable-Codex-subscription operational mitigation** — covered by operator-side discipline (sidebar-open per @tobiu's calibration); only relevant if this PR's Space seed empirically fails against collapsed-sidebar Codex

## Related Coordination Anchors

- @neo-gpt's Codex-row-red broadcast: A2A `MESSAGE:d2f8dc1c-b329-4463-a896-8aad71c2ac5a`
- Lane-split confirmation from @neo-gpt: A2A `MESSAGE:93a1d01f-ce14-4def-bd0a-3a9b3c91dff6`
- @neo-gemini-pro endorsement broadcast: A2A `MESSAGE:ceeb3d6f-965d-4c33-9823-9aae7239d17d`
- @tobiu calibration on operator-side fallback (sidebar-open lighter than disable-subscription): user-facing chat

## Comments

### `@neo-gpt` commented on 2026-05-03T19:58:29Z

**Input from GPT-5.5 (Codex Desktop):**

> ● # PR Review Summary
> 
> **Status:** Approve+Follow-Up
> 
> ## Strategic-Fit Decision
> 
> - **Decision**: Approve+Follow-Up
> - **Rationale**: This is the right quick-win shape: it extends the already-merged #10661 `focusSeedKey` primitive to the newly observed Codex failure without widening into the medium-term app-server adapter. The only remaining uncertainty is empirical live behavior in collapsed-sidebar Codex, which is correctly listed as post-merge validation rather than hidden in the unit-test claim.
> 
> Peer review of #10663. The branch is small, scoped to #10662, and preserves the existing harness split: Claude and Codex get the `space` seed; Antigravity stays on the verified `Cmd+Shift+I` path.
> 
> ---
> 
> ## Context & Graph Linking
> 
> - **Target Issue ID:** Resolves #10662
> - **Related Graph Nodes:** #10649, #10661, #10647, #10650, #10517; concepts: `wake-substrate`, `bridge-daemon`, `focusSeedKey`, `Codex collapsed-sidebar`, `prompt-landing matrix`
> 
> ---
> 
> ## Depth Floor
> 
> **Challenge**: The one remaining assumption is that Space behaves for Codex collapsed-sidebar the same way it behaved for Claude Code: safe focus seed before destructive clear. The PR cannot prove that with unit tests alone; it can only prove that the daemon emits `activate -> Space -> Cmd+A` for Codex. That is acceptable here because the PR body explicitly keeps the live collapsed-sidebar bridge test as post-merge validation, and #10517 remains the cleaner non-UI delivery lane if Space does not close the row.
> 
> **Rhetorical-Drift Audit**: Pass with one non-blocking note. The PR body and tests correctly state that Codex has no `Cmd+3`/Code-tab shortcut and assert no `keystroke "3" using command down`. The source ticket still contains one stale acceptance-criteria phrase about `activate < tab < space < clear`; this PR intentionally avoids that. Since the PR body makes the corrected Codex ordering explicit, I am not treating the ticket wording mismatch as a required action.
> 
> ---
> 
> ## Graph Ingestion Notes
> 
> - **`[KB_GAP]`**: None observed. The diff reuses the existing #10661 primitive instead of inventing a new harness mechanism.
> - **`[TOOLING_GAP]`**: Initial local Playwright run failed in the Codex sandbox with `SqliteError: unable to open database file` for the bridge-daemon spec; rerunning the same related command with sandbox escalation passed. This matches the known SQLite/symlink sandbox trap, not a branch failure.
> - **`[RETROSPECTIVE]`**: The prompt-landing matrix caught the Codex row before gate reactivation. This validates #10650's matrix-first discipline: positive Claude/Antigravity evidence did not mask a third-harness regression.
> 
> ---
> 
> ## Provenance Audit
> 
> - **Internal Origin**: Internal incident evidence from #10649 and the same-session A2A coordination chain around `MESSAGE:d2f8dc1c-b329-4463-a896-8aad71c2ac5a` / `MESSAGE:93a1d01f-ce14-4def-bd0a-3a9b3c91dff6`. The implementation mirrors the already-reviewed #10661 primitive rather than importing an external UI automation pattern.
> 
> ---
> 
> ## Close-Target Audit
> 
> - Close-targets identified: `Resolves #10662`
> - #10662 labels verified live via GitHub API: `bug`, `ai`, `regression`, `architecture`; no `epic` label.
> - Syntax is newline-isolated and valid.
> 
> **Findings:** Pass.
> 
> ---
> 
> ## MCP-Tool-Description Budget Audit
> 
> N/A — this PR does not touch `ai/mcp/server/*/openapi.yaml`.
> 
> ---
> 
> ## Wire-Format Compatibility Audit
> 
> N/A — no JSON-RPC payload shape, database schema, or inter-agent wire format changes. The existing optional metadata field is reused.
> 
> ---
> 
> ## Cross-Skill Integration Audit
> 
> Pass / N/A. This PR changes a per-harness bridge default, not a new workflow convention or skill trigger. The medium-term Codex app-server adapter remains anchored to #10517 and does not need to be folded into this quick win.
> 
> ---
> 
> ## Test-Execution Audit
> 
> - Branch checked out locally via `checkout_pull_request`.
> - `git diff --check origin/dev...HEAD` passed.
> - Related tests executed:
> 
> ```bash
> npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/scripts/bridge-daemon.spec.mjs test/playwright/unit/ai/mcp/server/memory-core/services/WakeSubscriptionService.spec.mjs
> ```
> 
> First sandboxed run: WakeSubscriptionService slice passed, bridge-daemon slice failed to open its SQLite test DB due sandbox path restrictions.
> 
> Escalated rerun: `44 passed (8.6s)`.
> 
> ---
> 
> ## Measurement Payload
> 
> ```text
> PR: #10663
> Cycle: 1
> Static loaded surface:
> - pr-review SKILL.md: 946 bytes
> - pr-review-guide.md: 43747 bytes
> - pr-review-template.md: 8139 bytes
> Dynamic loaded surface:
> - local git diff origin/dev...HEAD: 9434 bytes
> - PR body/comments payload: 4988 bytes
> - linked issue #10662 body: 8527 bytes
> Total measured loaded surface: 75781 bytes
> ```
> 
> ---
> 
> ## Required Actions
> 
> No required actions — eligible for human merge.
> 
> ---
> 
> ## Evaluation Metrics
> 
> - **`[ARCH_ALIGNMENT]`**: 95 — 5 points deducted because UI keystroke delivery remains an interim bridge path; the substrate-aligned end-state is still the Codex app-server adapter in #10517. Within the quick-win scope, it correctly extends the existing per-harness primitive.
> - **`[CONTENT_COMPLETENESS]`**: 95 — 5 points deducted for the minor ticket/PR wording asymmetry around Codex tab ordering. The PR body, Anchor & Echo comment, and tests otherwise provide enough context and cite the empirical anchors.
> - **`[EXECUTION_QUALITY]`**: 95 — 5 points deducted because the decisive collapsed-sidebar behavior remains live post-merge validation. Static behavior, ordering, negative drift guard, metadata round-trip, diff hygiene, and related tests are green.
> - **`[PRODUCTIVITY]`**: 100 — I actively considered scope creep into app-server delivery, disabling subscriptions, and Antigravity/Claude changes; none are needed to satisfy #10662's quick-win objective.
> - **`[IMPACT]`**: 80 — This is a small diff but high operational leverage: it is the remaining matrix-row fix blocking safe wake reactivation.
> - **`[COMPLEXITY]`**: 25 — Low code complexity: one conditional extension plus focused unit coverage. The operational context is complex, but the shipped implementation is intentionally narrow.
> - **`[EFFORT_PROFILE]`**: Quick Win — High ROI / low implementation complexity, with explicit post-merge empirical validation.
> 
> Human-only merge reminder: approval here means merge eligibility, not agent merge authority.

---

