Skip to content

Nine window routes send a command for another machine's session with no guard (listed as reported in the helper's coverage test) #627

Closed

Description

@SSFSKIM

Commands the window sends for another machine's session with no guard

Summary

REMOTE_UNAVAILABLE (src/shared/ipc/remote-unavailable.ts) declares the commands that a session on another machine reached over RL2 cannot take. Every renderer control that issues one is supposed to read the window's helper, src/renderer/src/lane-b/remote-unavailable.ts. The helper greys the control with the declared sentence, and nothing is sent.

The coverage test test/lane-b/renderer-guards.test.ts holds the renderer to that rule. It found nine routes that issue a declared command for such a session with no guard. Each is listed there as a reported entry. Fixing a route removes its entry, and the test then requires the fix to hold: the module must read the helper or name a real guard.

"Over RL2" means isOverRl2: a lane B session on another machine, or a terminal (lane A) session of a machine the org rows cover. isRemoteLaneB and useElsewhereMachine answer for lane B alone.

What main does with these commands today

No offer row or adapter takes any of these commands (checked against src/endpoint/offers.ts and the lane A and lane B adapters). So each one goes through routeLaneB, then routeLaneA, then manager.dispatch (src/main/machines/manager.ts:279), then dispatchOverLink (src/main/machines/remote/dispatch.ts:57):

  • The machine's link is not up (offline, connecting, reconnecting): the result is host_unavailable, with the words <command>: machine <ref> is not connected. The ref is the machine's id, not its display name.
  • The link is up and the command's grade is above view: main refuses it before any round trip, with <command>: refused act-required by machine <name>. The member's grade on the machine makes no difference: an owner gets the same refusal as a reader.
  • The link is up and the grade is view: the command is sent. The machine serves no row for it and refuses it, which reaches the window as <command>: refused not-offered by machine <name>. A member below view would be refused too, by grade or as not offered; which of the two the endpoint answers first has not been checked by a run. The window also hears the not-offered refusal app-wide (src/renderer/src/artifacts/remote-surfaces.ts).

Grades and route classes are from src/shared/ipc/grades/*.ts and src/shared/ipc/routes.ts.

The routes

Paths are under src/renderer/src/. The line numbers are at the head of the UX wave's U9 branch after M4's review round.

1. A mod's ask is answered automatically

  • Where: engine-surface/asks.ts:64, connectSurfaceAsks.
  • Command: session.ui.answer (grade converse).
  • The route: every plugin.ask in any session's event batch is answered with no control. That includes the asks of a session on another machine.
  • Offline: host_unavailable. The only trace is a console.warn ("[engine-surface] … not answered: …"), and the person sees nothing.
  • Link up, whatever the grade: the act-required refusal, likewise only in the console. The ask stays unanswered on the other machine until it expires.
  • Guard to add: skip an ask when remoteUnavailableOf(appSessionId, 'session.ui.answer') !== null. Then nothing is sent for another machine's session, and the mod there sees the same unanswered ask, without a refused round trip on every ask.

2. The owner channel's answer, cancel and "mark read" on a request card

  • Where: owner/report/answering.ts:65 (reportAnswer), :88 (markRead) and :185 (cancel). They are reached from request-card/RequestCard.tsx:444 to :457 (the essential item's MarkRead) and from the card's answer and cancel controls.
  • Commands: ownerChannel.answered and ownerChannel.cancel (grade converse); ownerChannel.markRead (grade view).
  • The route: an attention item of another machine's session is drawn with these controls, and they stay enabled.
  • Offline:
    • MarkRead shows the essential item's "not marked" alert with the host_unavailable words;
    • cancel shows the error as the card's note;
    • an answer's report shows its failure with Retry.
  • Link up:
    • answered and cancel get the act-required refusal, whatever the grade;
    • markRead is sent and refused as not offered, and the alert shows those words.
  • Guard to add:
    • MarkRead reads useRemoteUnavailable(item.appSessionId, 'ownerChannel.markRead') and is drawn disabled with that sentence;
    • the card's answer and cancel controls read the helper for ownerChannel.answered and ownerChannel.cancel the same way.

3. The owner channel's state is read when a transcript mounts

  • Where: stores/owner-channel.ts:36, through useOwnerChannel, called from transcript/view/TranscriptSlot.tsx:124.
  • Command: ownerChannel.state (grade view).
  • The route: opening a lane B session of another machine reads its owner channel. It reads again on every ownerChannel.changed.
  • Offline: host_unavailable. The read is dropped silently, and the slot shows no owner lane.
  • Link up: sent and refused as not offered. Silent as well, but every mount costs a refused round trip, and the refusal is recorded app-wide as "doesn't offer this" for that machine.
  • Guard to add: don't read, or subscribe, while remoteUnavailableOf(appSessionId, 'ownerChannel.state') !== null. The slot then stays at "no owner lane", which is what it shows today.

4. Prompt history is appended for a terminal session over RL2

  • Where: composer/editor/submit.ts:83 to :85, appendHistory.
  • Command: session.history.append (grade converse).
  • The route: the early return checks isRemoteLaneB alone. A terminal (lane A) session on an RL2 machine falls through and appends.
  • Offline: host_unavailable, logged by console.warn. The person sees nothing.
  • Link up, whatever the grade: the act-required refusal, likewise only in the console.
  • Guard to add: return early on isOverRl2(appSessionId), or on remoteUnavailableOf(appSessionId, 'session.history.append') !== null, in place of isRemoteLaneB.

5. /fast off typed in the composer

  • Where: widgets/model.ts:193 (applyFlagSettings), reached from widgets/typed.ts:87 (applyFast).
  • Command: session.applyFlagSettings (grade manage, by effect).
  • The route: the model selector greys its own control for another machine's session, but the typed /fast off reaches the command for a ready session there.
  • Offline: the typed command reports its failure in the transport's words for host_unavailable.
  • Link up, whatever the grade: it reports the act-required refusal in the same words. Even the machine's owner is refused, and is told so only as a transport failure.
  • Guard to add: applyFast checks remoteUnavailableOf(id, 'session.applyFlagSettings'). When that is not null, it reports that sentence and sends nothing, as the selector does.

6. Take over a session another process holds

  • Where: sessions/record-ops.ts:230 (takeOverSession), reached from sessions/HolderActions.tsx:62 to :69.
  • Command: session.takeOver (grade spawn). For a terminal holder, session.takeOverPane is asked first, on the session's machine.
  • The route: a record of another machine held by a background job shows Take over. The confirmation sheet opens and the command is sent.
  • Offline: after confirming, a danger toast with the host_unavailable words.
  • Link up, whatever the grade: after confirming, a danger toast with the act-required refusal. The person confirms a destructive act that could never run.
  • Guard to add: HolderActions reads useRemoteUnavailable(appSessionId, 'session.takeOver'), and draws Take over disabled with that sentence before any confirmation.

7. Open externally for a terminal session over RL2

  • Where: lane-b/open-copy.ts:20 (openSessionFile), called from tools/code/viewer/ExternalRow.tsx:23 and tools/maws/actions.ts:31 (a delivered file's Open).
  • Command: files.openExternal (grade view).
  • The route: the branch to "open a copy here" checks isRemoteLaneB alone. A terminal (lane A) session over RL2 takes files.openExternal for a path on the other machine.
  • Offline: "Refused: …" or "Not opened: …" with the host_unavailable words.
  • Link up: the not-offered refusal in the same place.
  • Guard to add: branch on isOverRl2. If lane A's files can't be copied here (the copy reads through lane B's adapter), grey Open with remoteUnavailableOf(appSessionId, 'files.openExternal'), whose sentence already says to open a copy here.

8. Reveal in Finder for a terminal session over RL2

  • Where: tools/maws/actions.ts:36 (revealDelivered). Its caller, transcript/view/rows/Delivery.tsx:30 and :62, disables Reveal by useElsewhereMachine, which is lane B's alone.
  • Command: files.reveal (grade view).
  • The route: a delivered file in a terminal (lane A) session over RL2 offers Reveal, and it is sent.
  • Offline: "Refused: …" with the host_unavailable words.
  • Link up: "Refused: …" with the not-offered words.
  • Guard to add: Delivery reads useRemoteUnavailable(appSessionId, 'files.reveal') in place of useElsewhereMachine for the Reveal button, and shows its sentence as the title.

9. Routes 7 and 8 share one owner question

Both are lane A's half of guards that lane B already has. One change, using isOverRl2 and the helper in place of the lane B predicates, closes both.

Done when

  • Each route above reads the helper, or a predicate that covers both lanes, before it issues its command.
  • Its reported entry in GUARDED_ELSEWHERE is removed, and test/lane-b/renderer-guards.test.ts passes without it.
  • Each fix has a failing-first case: the control is disabled (or nothing is sent) for a session on an RL2 machine, in both lanes where both reach it.

Owners by folder: engine-surface/; owner/report/ and request-card/; stores/ and transcript/view/; composer/editor/ (U4); widgets/ (U11, with U4 inserting there); sessions/; lane-b/ and tools/code/viewer/; tools/maws/ and transcript/view/rows/.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P3
    on Nov 13, 2026
  2. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 20, 2026
  3. SSFSKIM commented on Nov 20, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: batch 7, group C

  4. added
    status:in-review
    and removed
    status:in-progress
    on Nov 20, 2026
  5. SSFSKIM commented on Nov 20, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: batch 7, PR #804

  6. removed
    status:in-review
    on Nov 20, 2026
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

    bugpriority:P3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions