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
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) 🖖
Context
#20587 brings four window specs back into the engine tier off-socket. Two stay
LOCAL_ONLYfor a cause measured on 2026-11-08. It differs from the reload #20587 assumed:workstation/WorkstationResetSurvivesReloadNL.spec.mjs(2 arms)workstation/WorkstationTopologyGroupsNL.spec.mjsBoth cold-boot the Workstation in a second browser context (
neuralLink.newContext()plusnewPage()), then bind it withneuralLink.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 ownpage: that page's dedicated App Worker, or its own SharedWorker throughattachPageSharedAppWorker({page}). An id naming another context's App Worker can never match.connectToAppkeeps polling the fixture page, whose contextWorkstationResetSurvivesReloadNLhas already closed after seeding.The Architectural Reality
test/playwright/dedicatedWorkerNeuralLink.mjs,connectToApp(target): aWORKER_IDtarget only filters the fixture page's own candidate (readyId !== target).test/playwright/sharedWorkerAppWorker.mjs:attachPageSharedAppWorkerfinds a page's own SharedWorker by that page'sbrowserContextIdand the App Worker URL its main thread loads.buildScripts/util/e2eCiSelection.mjs: theLOCAL_ONLYentry 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:browser.contexts()→pages(), reading each page's id throughNeo.worker.App.getWorkerId();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_SPECSandRUN_PATHS, with a duration taken from a hosted log.Acceptance Criteria
WorkstationResetSurvivesReloadNLandWorkstationTopologyGroupsNLpass off-socket locally. Red first: both fail on the base.LOCAL_ONLY. A spec that cannot keeps an entry stating its measured cause.test/playwright/unit/test/sharedWorkerAppWorker.spec.mjsordedicatedWorkerNeuralLink.spec.mjs, that fails without it.Out of Scope
LOCAL_ONLY.Related
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_ROOTunset (a local config that clearstestIgnoreruns 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) 🖖