Skip to content

[bug] A session stamped to an offline machine makes the Coding banner tell an owner already running pags up to run pags up (#531 AC 2) #537

Description

@serge-ivo

With machine A off and B online, the Coding banner still tells someone already running pags up to run pags up

Recorded on #531 as AC 2 improved-but-not-closed, and split out because closing it is a design decision rather than a patch.

State: the instance is pinned to A; A is off; B is online and running the runner.

  • /runtime/status → connected (B's socket is live)
  • /capture → offline (correct — the session is stamped to A, which is gone)
  • resolveRunnerOnline:36 gives a live session's capture priority over the relay answer, so the banner resolves to offline

Every one of those readings is truthful about the question it answers. The banner is not, because it collapses them into a boolean and then renders the one remedy a boolean can carry: run pags up. The owner is already running it — on B.

This is the same shape as #530 (the chat prompt prescribing pags up when the pin was the problem) and #524 (a remedy naming no machine), both now fixed. The banner is the remaining surface where a true fact produces a false instruction.

Why a boolean cannot fix it

The honest sentence is per-session, not per-instance: "this session is running on A, which is offline. B is connected — start a new session there, or bring A back." That needs the session's stamped node and the live node in the same sentence.

diagnoseAttachment (routes/instances.ts:860-866) already produces exactly this class of sentence for the instance, and runtime-attachment.ts:69-79 deliberately returns remedy: null where pags up would be wrong. The missing piece is the session-scoped equivalent.

The decision

  1. A session-scoped diagnosis — extend the attachment diagnosis to take a session's stamped node, and have the banner render its sentence. Most consistent with where [bug] The agent prescribes pags up when the runner is excluded by the pin — the chat prompt is a fourth "no runner" construction site and the only one never wired to diagnoseAttachment #530 and [bug] A "Runs on" tile claims "Attached · online" for a node the pin excludes — one line below "Status: Offline", and the invariant test only covers the pinned tile #531 landed; costs a new state in a table that is now a Record<AttachmentState, …> (a compile error until handled, which is the point).
  2. Resolve the conflict differently — stop letting a stale session's capture override a live relay, and let the session surface its own staleness separately. Smaller, but resolveRunnerOnline's current priority exists for a reason worth re-reading before overturning.
  3. Offer to relocate — a stamped session on a dead node is arguably a prompt to move it, not just a report. startSessionOnRunner already reclaims a session onto the live machine (reassignSessionNode), so the capability exists.

Acceptance criteria

  1. With A off and B online, no surface instructs the owner to run pags up.
  2. The banner names the session's machine and the live machine.
  3. /capture staying truthful about the session is preserved — it is not the bug.
  4. A test with a session stamped to an offline node and a live socket elsewhere, asserting the rendered sentence.

Verified

The three readings and resolveRunnerOnline:36's priority were measured by the #531 lane and are recorded there. Not reproduced by me: this needs an instance pinned to a machine that is off, which means manufacturing production state on the owner's setup — deliberately not done.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions