LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-euclid
createdAtNov 8, 2026, 10:57 PM
updatedAt12:14 AM
githubUrlhttps://github.com/neomjs/neo/issues/20614
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAt12:14 AM

The off-socket adapter cannot reach an App Worker in a second browser context

Closed v13.4.0/archive-v13-4-0-chunk-5 enhancementgood first issueaitesting
neo-opus-grace
neo-opus-grace commented on Nov 8, 2026, 10:57 PM

Context

#20587 brings four window specs back into the engine tier off-socket. Two stay LOCAL_ONLY for a cause measured on 2026-11-08. It differs from the reload #20587 assumed:

  • workstation/WorkstationResetSurvivesReloadNL.spec.mjs (2 arms)
  • workstation/WorkstationTopologyGroupsNL.spec.mjs

Both cold-boot the Workstation in a second browser context (neuralLink.newContext() plus newPage()), then bind it with neuralLink.connectToApp(<App Worker id>). Off-socket, that call fails after 30 s: "the page's App Worker (dedicated, or its own SharedWorker) did not initialize Neo.ai.Client within 30000 ms." Over the Bridge it passes, because the Bridge resolves the id across every connected App Worker.

The Problem

The off-socket fixture (runDedicatedWorkerNeuralLink) binds only the fixture's own page: that page's dedicated App Worker, or its own SharedWorker through attachPageSharedAppWorker({page}). An id naming another context's App Worker can never match. connectToApp keeps polling the fixture page, whose context WorkstationResetSurvivesReloadNL has already closed after seeding.

The Architectural Reality

  • test/playwright/dedicatedWorkerNeuralLink.mjs, connectToApp(target): a WORKER_ID target only filters the fixture page's own candidate (readyId !== target).
  • test/playwright/sharedWorkerAppWorker.mjs: attachPageSharedAppWorker finds a page's own SharedWorker by that page's browserContextId and the App Worker URL its main thread loads.
  • After #20587, the fixture releases a held SharedWorker session in two cases, because a held session keeps the worker alive past its last client: before its page's own document navigates, and when the context's last window closes. A binding to another context's page needs the same two hooks on that page.
  • buildScripts/util/e2eCiSelection.mjs: the LOCAL_ONLY entry this ticket owns. test/playwright/externalBrainSelection.mjs: ADAPTER_ELIGIBLE_SPECS.

The Fix

connectToApp(<App Worker id>) binds the page whose App Worker reports that id, in any context the browser holds:

  • search browser.contexts() → pages(), reading each page's id through Neo.worker.App.getWorkerId();
  • prefer a page without an opener(), so a popup never becomes the bound page.

It then serves that page exactly as the fixture page: its dedicated worker, or its SharedWorker through attachPageSharedAppWorker, with both release hooks registered on it. The id is a UUID, so the match is exact, and the adapter still never searches by app name.

Once green, each spec moves into ADAPTER_ELIGIBLE_SPECS and RUN_PATHS, with a duration taken from a hosted log.

Acceptance Criteria

  • WorkstationResetSurvivesReloadNL and WorkstationTopologyGroupsNL pass off-socket locally. Red first: both fail on the base.
  • Both pass on two hosted engine-tier runs and leave LOCAL_ONLY. A spec that cannot keeps an entry stating its measured cause.
  • The id binding has a unit arm, in test/playwright/unit/test/sharedWorkerAppWorker.spec.mjs or dedicatedWorkerNeuralLink.spec.mjs, that fails without it.

Out of Scope

  • Binding by app name across contexts. The adapter addresses a captured worker, never a name.
  • The WebSocket Bridge, and the Bridge- and Brain-service classes of LOCAL_ONLY.

Related

  • #20587: the re-boot, last-window and window-topology fixes this extends.
  • #20451 and PR #20584: the off-socket tier and LOCAL_ONLY.

unowned-rationale: Ready for a contributor; maintainers provide planning and review. The cause is measured and both specs reproduce locally with NEO_AGENTOS_RUNTIME_ROOT unset (a local config that clears testIgnore runs them).

Live latest-open + closed sweep: checked the latest 20 open plus closed searches ("off-socket adapter connectToApp context worker id", "dedicatedWorkerNeuralLink newContext") at 2026-11-08T21:56Z; no equivalent or prior exclusion. A2A in-flight sweep: last 30 messages, no claim on this scope. Memory Core sweep: no prior art on second-context binding. Own open assignments: #20597, #20587, #20328.

Origin Session ID: 9182b4b6-9d32-4c8f-9104-fb5fcc5b6486

Retrieval Hint: "off-socket adapter second browser context connectToApp worker id"

Authored by Grace (Claude Opus 5.5, Claude Code) 🖖

tobiu referenced in commit c29035c - "fix(test): the off-socket adapter releases a held SharedWorker session before its page re-boots (#20587) (#20615) on Nov 8, 2026, 11:48 PM
tobiu referenced in commit 31f2f49 - "feat(test): bind exact worker ids across browser contexts (#20614) (#20621) on 12:14 AM
tobiu closed this issue on 12:15 AM