feat(desktop): address a request to a screen, instead of asking the room - #194
Merged
Conversation
Directed requests — desktop_read / desktop_call / desktop_screenshot and the rest of _desktop_request — now resolve the chat's anchor and stamp the event with that viewport's id. Every other viewport hears it and ignores it. That retires the Web Locks election for these. The election worked, but anonymously: a copy acted and nobody could say afterwards which one had, which was the single hardest thing about debugging this layer. Two limits fall away with it. The ping is gone. It existed because a fresh chat's first request could beat the UI's subscription to that chat's stream, and streams do not replay — so every request paid a handshake round trip first. The stream is pod-scoped now and a lease is better evidence of a live screen than a probe that races, so there is nothing left to handshake. And a chat context is no longer required. `_desktop_request` used to refuse with "no chat context — cannot reach the desktop", which is why desktop_open could not be called from a standalone desktop page at all. It now resolves to the pod's most recently active viewport. The failure text is specific for the same reason: "no desktop to ask — no viewport is open on this pod" sends someone to open one, where "the desktop did not answer" sent them looking for a bug. `_publish` and `_desktop_ping` are deleted with their last callers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ups1TP9FXNqxbaaUXuEDrn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Directed requests —
desktop_read/desktop_call/desktop_screenshotandeverything else through
_desktop_request— now resolve the chat's anchor(#192) and stamp the event with that viewport's id. Every other viewport hears
it and ignores it.
That retires the Web Locks election for these. The election worked, but
anonymously: a copy acted and nobody could say afterwards which one had,
which was the single hardest thing about debugging this layer.
Two limits fall away with it.
The ping is gone. It existed because a fresh chat's first request could beat
the UI's subscription to that chat's stream, and streams do not replay — so
every directed request paid a handshake round trip first. The stream is
pod-scoped now, and a lease is better evidence of a live screen than a probe
that races.
_desktop_pingand_publishare deleted with their last callers.A chat context is no longer required.
_desktop_requestused to refuse with"no chat context — cannot reach the desktop", which is why
desktop_opencouldnot be called from a standalone desktop page at all. It now resolves to the
pod's most recently active viewport.
The failure text is specific for the same reason: "no desktop to ask — no
viewport is open on this pod" sends someone to open one, where "the desktop
did not answer" sent them looking for a bug in a desktop that was simply not
open.
Verified on staging (
sha-97b3648):desktop_openfrom a page with no chatwin-30— previously a hard refusaldesktop_anchorvs the page's real__pantheonViewportIddesktop_readon a Terminal windowdesktop_windowswith no desktop open at all71 desktop tests pass. Browser half is on pantheon-ui
feat/absorb-atrium: itacts when addressed, and falls back to the old election only when an event
carries no
viewport_id(a pod that predates this).