LearnNewsExamplesServices
Frontmatter
id14858
titleBind AgentOS Neural Link E2Es to the current page session
stateOpen
labels
bugdeveloper-experienceaitestingregression
assigneesneo-gpt
createdAt7:19 PM
updatedAt7:19 PM
githubUrlhttps://github.com/neomjs/neo/issues/14858
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

Bind AgentOS Neural Link E2Es to the current page session

Open Backlog/active-chunk-4 bugdeveloper-experienceaitestingregression
neo-gpt
neo-gpt commented on 7:19 PM

Summary

AgentOS Neural Link E2Es must bind to the App Worker session owned by the Playwright page under test, not to an older same-name agentos session left in the shared bridge/runtime.

This is the follow-up from the post-#14847/#14855 E2E review run. The dashboard source shape was fixed separately; the remaining failure is the E2E session-binding/test-contract layer.

Problem

A focused ordering run with Cockpit.spec.mjs before the Neural Link AgentOS specs exposed stale-session behavior:

./node_modules/.bin/playwright test -c test/playwright/playwright.config.e2e.mjs \
  test/playwright/e2e/agentos/Cockpit.spec.mjs \
  test/playwright/e2e/agentos/FleetCockpitLifecycleNL.spec.mjs \
  test/playwright/e2e/neural-link/WindowOps.spec.mjs \
  --workers=1

Observed symptoms from the review evidence:

  • FleetCockpitLifecycleNL.spec.mjs can bind via raw waitForSession('agentos'), which is app-name lookup rather than current-page identity lookup.
  • The selected session can be an old AgentOS session whose stores/windows do not reflect the page just opened by the test.
  • WindowOps.spec.mjs still failed after the AgentOS dashboard source-shape PR because the test contract did not prove that the selected window topology belonged to the bound AgentOS page/session.

Architectural Reality

Surface Current contract Source of authority
test/playwright/fixtures.mjs neuralLink.connectToApp() Prefer the page App Worker id (Neo.worker.App.getWorkerId()); app-name fallback is weaker and can bind the oldest same-name session. Whitebox E2E fixture comments + prior #12897 archived fix pattern.
ai/services/neural-link/ConnectionService.mjs#waitForSession() Exact session id is safe; app-name lookup iterates registered session data and is not a current-page identity guarantee. Local source inspection.
test/playwright/e2e/agentos/FleetCockpitLifecycleNL.spec.mjs Currently bypasses the fixture identity path with waitForSession('agentos'). Local source inspection.
test/playwright/e2e/neural-link/WindowOps.spec.mjs Must assert against the actual window topology fields returned by RuntimeService for the bound page/session. Local source inspection + post-#14847 focused run.

Scope

Fix the AgentOS Neural Link E2E session binding and test assertions so these specs are stable when another AgentOS page/session already exists in the bridge.

Expected shape:

  • Refactor AgentOS Neural Link E2Es away from raw app-name waitForSession('agentos') binding.
  • Use the page-bound neuralLink.connectToApp('AgentOS') path or an equivalent exact current-page App Worker id helper.
  • Fix WindowOps.spec.mjs so source-window discovery validates the RuntimeService topology for the bound app worker.
  • Harden the fixture/service only if local evidence shows the current page worker id path is still insufficient.

Acceptance Criteria

  • FleetCockpitLifecycleNL.spec.mjs does not use raw waitForSession('agentos') app-name binding.
  • WindowOps.spec.mjs verifies source windows using the actual topology fields for the bound AgentOS app worker.
  • This focused ordering passes:
./node_modules/.bin/playwright test -c test/playwright/playwright.config.e2e.mjs \
  test/playwright/e2e/agentos/Cockpit.spec.mjs \
  test/playwright/e2e/agentos/FleetCockpitLifecycleNL.spec.mjs \
  test/playwright/e2e/neural-link/WindowOps.spec.mjs \
  --workers=1
  • The fix does not depend on manually killing unrelated long-lived bridge sessions as normal test setup.
  • If local port isolation is required for deterministic validation, the PR documents the exact supported command/config and why.

Out of Scope

  • LivePreview Learn-route popout failure (#14856).
  • Grid E2E failures (#14852, #14853, #14854).
  • Reworking the AgentOS dashboard source shape already handled by #14847 / #14855.
  • Broad bridge protocol redesign unless a minimal fixture hardening is proven necessary.

Avoided Traps

  • Do not make test order the fix; the ordering is the regression probe.
  • Do not accept app-name fallback as proof of current-page binding.
  • Do not delete or skip the failing specs.
  • Do not convert this to black-box DOM-only coverage; this is specifically a Neural Link whitebox E2E contract.

Duplicate Sweep

Checked immediately before creation on 2026-07-05T17:19:02Z:

  • Latest 20 open issues via gh issue list --state open --limit 20.
  • Targeted search for waitForSession('agentos'), oldest same-name session, and FleetCockpitLifecycleNL: no open duplicate.
  • A2A mailbox latest lifecycle messages: no peer lane claims this session-binding follow-up; Grace owns #14857, unrelated dock producer work.
  • Knowledge Base query surfaced archived #12897 as prior art for the same failure mode, not an active open duplicate.

Related: #14855, #14847, #12897.