LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtOct 26, 2026, 4:52 PM
updatedAtOct 26, 2026, 6:54 PM
githubUrlhttps://github.com/neomjs/neo/issues/20129
authorneo-opus-grace
commentsCount0
parentIssue20114
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 26, 2026, 6:54 PM

An app that starts after its Neural Link socket opens never announces its window

neo-opus-grace
neo-opus-grace commented on Oct 26, 2026, 4:52 PM

Context

The cloud cold walk for neomjs/neo#20114 (2026-10-26, a fresh container, npx neo-app@13.3.2, the published neo-neural-link@1.0.0) loaded the app twice with the Bridge already running. Both times healthcheck and get_window_topology listed no windows, so simulate_event, which needs a windowId, could only be routed by copying an id out of query_component's output. Connections made after the app started (a focus retry, a reconnect after the Bridge was killed) did register the window.

The Problem

This is the normal agent flow: the harness starts the Neural Link first, then the dev server and page. With the Bridge already up, the socket opens about 0.5 s into the load, before Neo.app() has registered the application, and the window is never announced afterwards.

The Architectural Reality

  • src/ai/Client.mjs onSocketOpen (:304-356) announces windows once, at open time: from WindowManager.items, and for a non-SharedWorker app from the Neo.apps registry (:347-356).
  • onAppWorkerWindowConnect (:217) runs only for SharedWorker connect events.
  • src/controller/Application.mjs:82 registers Neo.apps[me.windowId] = me later, and nothing notifies the client. A grep of src finds only those three window_connected sends.

The Fix

When a non-SharedWorker application registers while the Neural Link socket is open, announce its window once (appName, windowId), through the same window_connected notification onSocketOpen sends. Keep the open-time rehydration for windows that already exist, and never announce a windowId twice.

Acceptance Criteria

  • AC-1: with the socket opened before the app registers, exactly one window_connected carrying the app's appName and windowId is sent once the app registers (unit, red-first on dev).
  • AC-2: an app that exists at open time is announced once, not twice.
  • AC-3 (post-merge, installed): after an ordinary load with the Bridge already running, get_window_topology lists the window and simulate_event routes with that windowId.

Out of Scope

  • The client's deliberate stop after five reconnect attempts (onSocketReconnectFailed / redial, "never on a timer"). That trade-off is documented for agents in the create-app and skills leaves of #20114.

Related

Parent: neomjs/neo#20114 · cloud-walk receipt on #20114

Sweeps (2026-10-26T15:52Z): live latest-open, the 20 newest neomjs/neo issues, no equivalent; keyword window_connected / "announce its window" / "No active App Worker sessions", none open; A2A, latest 30 messages, no claim; own-assignment, #20114, #20128, #19919 and #15000, none overlapping.

Origin Session ID: 9853627c-2129-4d41-b905-0c74bec35a48 Retrieval Hint: "Neo.ai.Client onSocketOpen window_connected Neo.apps registers after socket open get_window_topology empty simulate_event windowId"

tobiu referenced in commit 6a2dc17 - "fix(ai): an app that registers after its Neural Link socket opens announces its window (#20129) (#20136) on Oct 26, 2026, 6:54 PM
tobiu closed this issue on Oct 26, 2026, 6:54 PM