Skip to content

feat(service,host): a task's planning conversation is followed through the shared live layer - #3267

Merged
luke-agent[bot] merged 2 commits into
mainfrom
luke/neon-realtime-planning-conversation
Oct 21, 2026
Merged

luke-agent[bot] merged 2 commits into
mainfrom
luke/neon-realtime-planning-conversation

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

On main. This moves the open task's planning conversation onto the shared live layer (liveRows and the sealed live procedures), in place of the host's own loop of held reads woken by the call's words. Realtime is used only where LUKE_REALTIME=on (#4267); otherwise the follow rides the held poll (#4272).

What changes

  • Service: taskConversationLiveStatements (brain-transcript.ts) holds two parts, every statement immutable:
    • mark: one row keyed by the task, carrying the cursor (messageCursorNow) and the newest turn with its status;
    • workers: the running worker turns, one row each keyed by turn id.
  • Live procedure live.taskConversation (GET /api/live/task-conversation?id=&userId=) reads the task as the account and seals both parts. It answers not-found for a task the account doesn't reach, signed-out for another account's userId, and polled (held past after) like main's other live reads.
  • messages.task with hold=none answers brainPageNow, a single look. The service's own held read (brainPagePast) is unchanged.
  • Host (compose-tasks.ts and the new conversation-follow.ts):
    • the open task's conversation is followed through liveRows, and asked past its cursor in one look each time the mark or the workers move;
    • the call's activity and end no longer need to wake it, so wakeConversation and the parked-read machinery are gone;
    • a seal that isn't answered, or a follow that stops, is sealed again after a pause and resumes from the cursor held;
    • signed out, or a task no longer held, ends it.

Tests

  • task-work.test.ts (PGlite): the live mark and workers equal the held read's own reads at each step of a planning turn, and every step moves them. A teammate sees the start and a stranger sees nothing. brainPageNow answers at once.
  • live-statements.test.ts: the conversation's statements pass mutableFunctionsOf and the seal check.
  • live-procedures.test.ts: sealed for the bearer and the task, not found for a stranger, and polled without Realtime.
  • apps/web/tests/tasks-app.test.ts: hold=none is accepted only with after.
  • compose-tasks.test.ts with scripted Realtime:
    • each move of the mark or the workers asks one look, and the same rows, the call's words or a long wait ask nothing;
    • workers arriving in another order don't move it;
    • a mark Realtime stops is polled, and a polled mark that moved asks on from the cursor;
    • an unsealed task is sealed again after a pause.
  • Locally: features, host and service typecheck; vitest on those suites; knip, oxlint and task-names.

@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 12:49am UTC

Request Review

@luke-agent
luke-agent Bot changed the base branch from main to luke/neon-realtime-scope-inbox October 17, 2026 01:09
@luke-agent
luke-agent Bot changed the base branch from luke/neon-realtime-scope-inbox to luke/neon-realtime-service-wake October 17, 2026 01:25
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from c5e0422 to 594058c Compare October 17, 2026 01:25
@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-service-wake branch from 6c9622d to f835f49 Compare October 18, 2026 19:40
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch 2 times, most recently from 89c32e2 to 2463895 Compare October 18, 2026 19:45
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from f835f49 to 2180711 Compare October 18, 2026 21:40
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from 2463895 to 62aaa52 Compare October 18, 2026 21:40
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from 2180711 to e46eaf4 Compare October 19, 2026 18:52
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from 62aaa52 to 3fb748d Compare October 19, 2026 18:52
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from e46eaf4 to b3338fd Compare October 20, 2026 01:36
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from 3fb748d to 7f931ca Compare October 20, 2026 01:36
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-service-wake branch from b3338fd to a768591 Compare October 20, 2026 02:06
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from 7f931ca to 9f27a39 Compare October 20, 2026 02:06
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from 9f27a39 to d860efb Compare October 20, 2026 02:43
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from d860efb to fa9cf82 Compare October 20, 2026 23:30
@luke-agent luke-agent Bot changed the title feat(service,host): a plan's planning conversation is asked once its mark moves over Neon Realtime feat(service,host): a task's planning conversation is followed through the shared live layer Oct 20, 2026
@luke-agent
luke-agent Bot changed the base branch from luke/neon-realtime-service-wake to luke/live-same-user October 20, 2026 23:30
@luke-agent luke-agent Bot closed this Oct 20, 2026
@luke-agent luke-agent Bot reopened this Oct 20, 2026
@luke-agent
luke-agent Bot marked this pull request as ready for review October 20, 2026 23:40
devin-ai-integration[bot]

This comment was marked as resolved.

Base automatically changed from luke/live-same-user to main October 20, 2026 23:55
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from 1035c4b to 50f0a36 Compare October 21, 2026 00:09
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from 50f0a36 to abaa13b Compare October 21, 2026 00:24
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 21, 2026
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from abaa13b to fae9fbf Compare October 21, 2026 00:42
charleslpan and others added 2 commits October 21, 2026 00:44
…h the shared live layer

The service seals the planning conversation's mark (its cursor and newest
turn, keyed by the task) and its running workers' turns, a row each, as the
live procedure taskConversation, named for the account it is read for, and
answers the messages read in one look where hold=none asks. The host follows
them through liveRows while the task is open, asking the conversation past
its cursor in one look each time they move, in place of its own loop of held
reads woken by the call's words: over Neon Realtime where LUKE_REALTIME is
on, and on the held poll otherwise. Every statement passes the immutability
check. The service's own held read of the conversation is kept.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…r's own, and ends once its task is gone

taskConversation now refuses a read naming another account than the
bearer's as signed out (sameUser), as every other live read does. The
host marks a seal or poll the service answers not found or signed out as
gone, so a task deleted while its conversation is polled ends the follow.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot force-pushed the luke/neon-realtime-planning-conversation branch from fae9fbf to 770f428 Compare October 21, 2026 00:44
@luke-agent
luke-agent Bot enabled auto-merge October 21, 2026 00:45
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 86bd341 Oct 21, 2026
13 checks passed
@luke-agent
luke-agent Bot deleted the luke/neon-realtime-planning-conversation branch October 21, 2026 00:56

This branch was successfully deployed

1 active deployment
Preview — 770f428f 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