LearnNewsExamplesServices
Frontmatter
id19008
titleA remote setBodyCls reaches a closed window's port during vessel reintegration
stateClosed
labels
bugaitestingdashboard
assigneesneo-opus-grace
createdAtSep 19, 2026, 11:05 PM
updatedAtSep 20, 2026, 12:41 AM
githubUrlhttps://github.com/neomjs/neo/issues/19008
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 20, 2026, 12:41 AM

A remote setBodyCls reaches a closed window's port during vessel reintegration

Closed v13.2.0/archive-v13-2-0-chunk-22 bugaitestingdashboard
neo-opus-grace
neo-opus-grace commented on Sep 19, 2026, 11:05 PM

Context

Spun out of #18998, which was filed on two worker errors before either had a mechanism. The first — a component reference reaching the VDom worker under a generated id — turned out to be a TreeBuilder identity defect and is repaired in its own PR. This one is the other error, and it is a different mechanism in a different worker:

App Worker: Error: worker.Base#promiseMessage: no live port for destination
  "d6f8a94e-abb1-4718-896f-fb9d376f2163" (remoteMethod Neo.main.DomAccess.setBodyCls) — a window closed?

Measured at dev@db3de7d7b5 plus the #18998 repair, headless, --workers=1, NEO_AGENTOS_RUNTIME_ROOT wired: 3 of 3 runs, and with the vdom defect gone it is now the only worker error left in the file. WorkstationFiveBeatNL scenes 4 and 5 fail on it alone, 3/3 at --repeat-each=3.

The Problem

worker.Base#promiseMessage resolves a remote call against a port whose window has closed. The call is Neo.main.DomAccess.setBodyCls — a main-thread DOM write — addressed to a destination that is gone by the time it is delivered.

Scene 4 is "reintegration: whole stack home, commit precedes the vessel self-close". A remote call racing a deliberate window close is precisely that scene's subject, so the two are plausibly the same event seen from the two ends — but that is a hypothesis, not a measurement. What is measured is the error's text, its frequency (3/3), and that no other worker error remains.

The error's own message ends in a question — "a window closed?" — which is the framework guessing at its own cause. A remote call to a closed window is either an ordinary race the sender should tolerate, or a missed teardown that leaves a caller addressing a dead port. The message does not distinguish them, and neither do I yet.

The Architectural Reality

  • worker.Base#promiseMessage is the App-Worker side of the remote-method bridge; the destination is a window/port id, and Neo.main.DomAccess.setBodyCls is a main-thread writer.
  • The error surfaces at all because of @neo-opus-ada's worker-error gate (#18554 / PR #18716): fixtures.mjs's workerErrors auto-fixture reads mirrored worker errors from the page console and fails any test that did not name the error it provoked. Before that gate this class of error stayed inside the worker's own inspector.
  • workerErrors.expect(RegExp) exists exactly so a test can declare an error it means to provoke. Neither scene declares this one.

The Fix

Decide which of the two it is, with evidence, and act accordingly:

  1. An ordinary teardown race — the sender should not address a port it can know is gone, or should tolerate the absence without raising. Repair on the sender side; the scenes then pass without naming anything.
  2. A missed teardown — something should have unregistered the destination before the call was issued. Repair there.
  3. A legitimate, unavoidable race the journey deliberately provokes — then the scene NAMES it via workerErrors.expect(...), and the gate stays as strict as it is. This is the only branch in which the test changes rather than the engine.

Branch 3 is the one to be suspicious of: it is also the branch that makes the red go away with the least work, which is exactly why it needs the strongest evidence rather than the weakest.

Contract Ledger

Target surface Source of authority Behaviour Fallback Docs Evidence
Viewport#syncBodyTheme's dispatch worker.Base#promiseMessage + #isWindowDeparted settles silently ONLY when the typed rejection and a recorded departure both hold; anything else reaches the console no handler at all was the prior state — an unhandled rejection in the App Worker the method's own docblock unit: the same typed rejection at departed=true and departed=false, plus a generic-rejection control
code: 'NEO_DEAD_PORT' worker.Base#promiseMessage unchanged — attached to every send that resolved no message id — unchanged —
isWindowDeparted(windowId) worker.Base unchanged — read, never widened — unchanged —
the workerErrors gate test/playwright/fixtures.mjs (#18554) unchanged; no scene-local naming added — — —

Decision Record impact

none.

Acceptance Criteria

  • The destination's lifetime is established: whether the port was already unregistered when the call was issued, or closed between issue and delivery. Measured, not inferred from the scene's narrative. — MET: the engine already carries the distinction. promiseMessage attaches code: 'NEO_DEAD_PORT' to any send that resolved no message id, and isWindowDeparted(windowId) is the separate evidence that a departure was recorded. The measurement was which side of that pairing this caller sat on: neither.
  • The repair lands on whichever of sender, teardown, or test the measurement selects, with the rationale recorded here. — MET: sender side. Five sibling detached dispatches in src/ already own this outcome; two of them (tab/plugin/Overflow, manager/DomEvent) gate on the recorded departure and three on the code alone. The count established the owner; the docblock established the gate.
  • If the outcome is branch 3, the naming is scene-local and the gate's contract is unchanged — no pageerror handler is reintroduced to print instead of assert. — MET vacuously: branch 3 was not taken, and nothing in the gate changed.

Scope restatement, 2026-09-20 (review RA-2). The two criteria below are not this leaf's to close and are struck rather than carried: this ticket delivers one sender's terminal behaviour, and a whole-journey green depends on #18998's root repair as well. They remain live on their owning artifacts.

  • WorkstationFiveBeatNL passes whole at a named dev head → owned by #18998 and #17844 jointly; measured contribution of THIS leaf is scene 4, 3/3 red → 3/3 green.
  • #17844's census row for this file is updated → owned by #17844.

Out of Scope

  • The component-reference identity defect (#18998) — repaired separately; this ticket assumes that repair is in.
  • The workerErrors gate's own contract. It is the instrument that made this visible and it is working.
  • The #16756 native-display arm in WorkstationTearOutSourceContinuityNL, dispositioned in #17844.

Avoided Traps

  • Reading the scene's narrative as the mechanism. "Commit precedes the vessel self-close" makes a close-race plausible; it does not make it measured. #18998 cost three wrong hypotheses to exactly this habit.
  • Taking branch 3 because it is cheap. Naming an error silences it in one line, which is why it must be the conclusion of a measurement rather than a shortcut past one.

Related

#18998 (the other half of the same two-error observation) · #18554 / #18716 (the gate) · #17844 (the census) · #16498 (waits on a whole five-beat capture)

Live latest-open sweep: checked the latest 20 open issues at 2026-09-19T21:0xZ; no equivalent found — #18998 is the nearest and this is deliberately spun out of it. A2A in-flight claim sweep: no overlapping claim. Own-assignment sweep: no same-surface hit.

Retrieval Hint: "promiseMessage no live port setBodyCls five-beat scene 4"