LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-maryam
createdAtNov 5, 2026, 8:34 PM
updatedAtNov 6, 2026, 12:01 AM
githubUrlhttps://github.com/neomjs/neo/issues/20372
authorneo-opus-vega
commentsCount1
parentIssue20370
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 20371 ai.Client: explicit transport start and a test-only registry boot
blocking[ ] 20376 Off-socket NL dispatch for SharedWorker apps, [ ] 20374 CI selection runs single-app NL specs without a Brain checkout, [x] 20373 Off-socket NL dispatch: refusal, regression, conflict and lifetime specs
closedAtNov 6, 2026, 12:01 AM

The neuralLink fixture dispatches to the page's own App Worker

Closed v13.4.0/archive-v13-4-0-chunk-4 enhancementaitesting
neo-opus-vega
neo-opus-vega commented on Nov 5, 2026, 8:34 PM

Part of #20370 (linked natively); graduated from D#18775, option G. Blocked by the seam leaf, which provides the test entry.

Context

With the test entry in place, the whitebox fixture still reaches the API only through a Bridge. This leaf gives it a second path: dispatch to the page's own dedicated App Worker, with no Brain checkout and no socket.

The Architectural Reality

  • test/playwright/fixtures.mjs provides the neuralLink fixture, which throws unless NEO_AGENTOS_RUNTIME_ROOT names a Brain checkout.
  • test/playwright/e2e/core/AiClientLateBridge.spec.mjs already captures and evaluates the page's App Worker: the precedent for addressing.
  • Binding by app name went wrong once: waitForSession(appName) returned the oldest same-name session (#19713, fixed by #19715 in the fixture). The adapter keeps its own worker handle and never looks an app up by name.
  • Client#handleAgentDisconnected (src/ai/Client.mjs:272) releases the writer's locks and sweeps its transactions, keyed on the full pair.

The Fix

  1. A harness-owned adapter in the test tree (never src/main/addon/): boots the page with the test flag, captures its dedicated App Worker, and calls the test entry.
  2. Each test gets a fresh fixture-minted {agentId, sessionId} pair. Fixture teardown ends that pair through handleAgentDisconnected, including when the test throws.
  3. The fixture picks the adapter when no Brain checkout is configured; with NEO_AGENTOS_RUNTIME_ROOT set, the Bridge path is unchanged.

Discussion Criteria Mapping & Leaf Slice

Option G (dedicated worker first, no app-name search), OQ6's mechanism (the spec is in the contract-specs leaf), and STEP_BACK point 3. No binding inventory belongs to this leaf.

Acceptance Criteria

  • With no NEO_AGENTOS_RUNTIME_ROOT, a spec against a real source app on a dedicated worker reads and writes through the adapter, and the page opens no WebSocket.
  • Each test runs under its own fixture-minted pair, and teardown ends it through handleAgentDisconnected even when the test throws.
  • The adapter addresses the captured worker and never searches by app name.
  • Specs run with NEO_AGENTOS_RUNTIME_ROOT set behave unchanged.
  • learn/guides/testing/WhiteboxE2E.md says which path a run takes and how to choose it.

Out of Scope

The contract specs, CI selection, SharedWorker apps (residual leaf), and any production main-thread API.

Decision Record

Decision Record: Not needed (D#18775).

unowned-rationale: blocked by the seam leaf; any peer claims it once that lands, and the epic's steward (Vega) reviews.

Origin Session ID: 0c8e30ea-3ef2-41c6-9d56-139ec7d52392

Retrieval Hint: "neuralLink fixture dedicated App Worker adapter off-socket dispatch"