Repository navigation
Description
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 belowviewwould 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 thenot-offeredrefusal 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(gradeconverse). - The route: every
plugin.askin 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 aconsole.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 fromrequest-card/RequestCard.tsx:444to:457(the essential item's MarkRead) and from the card's answer and cancel controls. - Commands:
ownerChannel.answeredandownerChannel.cancel(gradeconverse);ownerChannel.markRead(gradeview). - 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_unavailablewords; - cancel shows the error as the card's note;
- an answer's report shows its failure with Retry.
- MarkRead shows the essential item's "not marked" alert with the
- 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.answeredandownerChannel.cancelthe same way.
- MarkRead reads
3. The owner channel's state is read when a transcript mounts
- Where:
stores/owner-channel.ts:36, throughuseOwnerChannel, called fromtranscript/view/TranscriptSlot.tsx:124. - Command:
ownerChannel.state(gradeview). - 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:83to:85,appendHistory. - Command:
session.history.append(gradeconverse). - The route: the early return checks
isRemoteLaneBalone. A terminal (lane A) session on an RL2 machine falls through and appends. - Offline:
host_unavailable, logged byconsole.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 onremoteUnavailableOf(appSessionId, 'session.history.append') !== null, in place ofisRemoteLaneB.
5. /fast off typed in the composer
- Where:
widgets/model.ts:193(applyFlagSettings), reached fromwidgets/typed.ts:87(applyFast). - Command:
session.applyFlagSettings(grademanage, by effect). - The route: the model selector greys its own control for another machine's session, but the typed
/fast offreaches 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:
applyFastchecksremoteUnavailableOf(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 fromsessions/HolderActions.tsx:62to:69. - Command:
session.takeOver(gradespawn). For a terminal holder,session.takeOverPaneis 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_unavailablewords. - 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 fromtools/code/viewer/ExternalRow.tsx:23andtools/maws/actions.ts:31(a delivered file's Open). - Command:
files.openExternal(gradeview). - The route: the branch to "open a copy here" checks
isRemoteLaneBalone. A terminal (lane A) session over RL2 takesfiles.openExternalfor a path on the other machine. - Offline: "Refused: …" or "Not opened: …" with the
host_unavailablewords. - 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 withremoteUnavailableOf(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:30and:62, disables Reveal byuseElsewhereMachine, which is lane B's alone. - Command:
files.reveal(gradeview). - The route: a delivered file in a terminal (lane A) session over RL2 offers Reveal, and it is sent.
- Offline: "Refused: …" with the
host_unavailablewords. - Link up: "Refused: …" with the not-offered words.
- Guard to add: Delivery reads
useRemoteUnavailable(appSessionId, 'files.reveal')in place ofuseElsewhereMachinefor 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
reportedentry inGUARDED_ELSEWHEREis removed, andtest/lane-b/renderer-guards.test.tspasses 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
renderer: red cases, commands sent for another machine's session with…
SSFSKIM commentedon Nov 20, 2026
[board] in-progress: batch 7, group C
renderer: commands for another machine's session read the window's he…
SSFSKIM commentedon Nov 20, 2026
[board] in-review: batch 7, PR #804