Skip to content

feat(host): the Mac follows its commands over Neon Realtime and says it listens on a slow timer - #3285

Merged
luke-agent[bot] merged 3 commits into
mainfrom
luke/neon-realtime-mac-commands-host
Oct 21, 2026
Merged

luke-agent[bot] merged 3 commits into
mainfrom
luke/neon-realtime-mac-commands-host

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Stack 4 · Mac commands, on #3274. compose-mac-commands.ts follows the account's unclaimed commands through the live layer, in place of one held read after another.

  • Follow: uses liveRows with reseal and poll. Realtime is off (no LUKE_REALTIME), so this is the poll the service holds until the rows move (feat(service,host): hold a live read's poll until its rows move #4272). Every read names accountId (LIVE_USER_QUERY) and the Mac's kinds (RUNS, shell). When the service answers signed out, the follow ends.
  • Claim: each new command is claimed by id, earliest queued first, and run or refused by its kind, as before feat(service,host): a Mac command carries a kind #4273. Only what the service grants runs, so two Macs never run one command.
  • Presence, the one timer that remains: macCommands.listening(RUNS) is sent at once and then every 15 s, inside the service's 45 s LISTENER_FRESH. No row change can say the process is alive. Each beat reads the gate first. When it shuts, the follow and the beats end, and running commands are stopped.
  • No fallback: an unanswered read is asked again after 5 s. The client's held read waiting() is removed, because the desktop no longer asks for it. The service still answers it.

compose-mac-commands.test.ts runs against a scripted service with Realtime off: answered polled, and held until the rows move. It covers:

  • the gate;
  • claim order;
  • a browser command refused while the shell one runs;
  • a command queued later heard within about a second;
  • every read naming the account and shell;
  • the 15 s beat, and stopping when the setting is switched off;
  • a signed-out read following nothing and being asked again.

Checked piece by piece: tsc for features and host; vitest over all of host and the client; knip; oxlint; discarded-effect.

@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
luke-web Ready Ready Preview Oct 21, 2026 1:00am UTC

Request Review

@luke-agent
luke-agent Bot changed the base branch from main to luke/neon-realtime-mac-commands October 17, 2026 01:26
@luke-agent luke-agent Bot closed this Oct 17, 2026
@luke-agent luke-agent Bot reopened this Oct 17, 2026
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from 540286a to ec49c51 Compare October 18, 2026 19:50
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 9d16ee2 to 83e02df Compare October 18, 2026 19:51
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from ec49c51 to b3d46c5 Compare October 18, 2026 21:41
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 83e02df to 307b1ea Compare October 18, 2026 21:41
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from b3d46c5 to 1fc8bac Compare October 19, 2026 18:52
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 307b1ea to 597a507 Compare October 19, 2026 18:52
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 597a507 to 7ebccf4 Compare October 20, 2026 01:24
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from 1fc8bac to 3612722 Compare October 20, 2026 01:24
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 7ebccf4 to 79b18ae Compare October 20, 2026 01:30
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from 3612722 to f5099ab Compare October 20, 2026 01:30
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 79b18ae to 109843f Compare October 20, 2026 01:53
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from f5099ab to c078c53 Compare October 20, 2026 01:53
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 109843f to 5554106 Compare October 20, 2026 02:19
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from 7516be4 to 846b137 Compare October 20, 2026 21:55
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 5554106 to 605803d Compare October 20, 2026 21:55
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from 846b137 to 372d3e2 Compare October 20, 2026 23:30
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 605803d to 4b578f2 Compare October 20, 2026 23:33
@luke-agent
luke-agent Bot marked this pull request as ready for review October 20, 2026 23:42
devin-ai-integration[bot]

This comment was marked as resolved.

@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from 372d3e2 to 740b9b3 Compare October 21, 2026 00:07
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from 4b578f2 to ced6ac2 Compare October 21, 2026 00:07
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands branch from 740b9b3 to abf8d9a Compare October 21, 2026 00:21
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-mac-commands-host branch from ced6ac2 to 6bd3c67 Compare October 21, 2026 00:21
Base automatically changed from luke/neon-realtime-mac-commands to main October 21, 2026 00:32
…ays it listens on a slow timer

The Mac follows its account's unclaimed commands of the kinds it runs
through liveRows (the poll the service holds until the rows move while
Realtime is off, Realtime where LUKE_REALTIME turns it on), claims each
new one by its id, and runs or refuses what the service grants it by its
kind, in place of one held read after another. Every read names the
account the follow started for, so a session the service signs out ends
the follow.

Presence is a POST every fifteen seconds for the Mac's kinds, well inside
the service's forty-five-second freshness window. It is the one timer
that remains, since no row change can say this process is alive. Each
beat reads the gate first, so switching the setting off or signing out
ends the follow and stops every running command.

The client's held read goes: nothing on the desktop asks it any more,
though the service still answers it for released desktops.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
charleslpan and others added 2 commits October 21, 2026 00:54
…Mac lets it go

The client now tells a claim the service refused (another Mac took it, or
it waited too long) from one that never reached it, and the follow asks an
unanswered claim again a second apart, a few times, inside the claim
window, since the rows that named it may not change again to say so.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
… an account switch ends the follow

A claim and its answer now run uninterruptibly on the concern's own set
rather than the follow's fiber, so a command the service granted just as
the setting was switched off is still answered as not run, not left for
its call to wait out. The presence beat also ends the follow when the
account signed in is no longer the one it started for, so the next
follow names the new account.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit bae007a Oct 21, 2026
12 checks passed
@luke-agent
luke-agent Bot deleted the luke/neon-realtime-mac-commands-host branch October 21, 2026 01:08

This branch was successfully deployed

1 active deployment
Preview — 372dadb3 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant