Skip to content

feat(host): a chat write is confirmed once its transaction reaches the followed chat - #4444

Merged
luke-agent[bot] merged 1 commit into
mainfrom
luke/chat-write-txid-wait-v2
Oct 21, 2026
Merged

luke-agent[bot] merged 1 commit into
mainfrom
luke/chat-write-txid-wait-v2

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

The host half of the chat area of the txid rollout, on top of the shared wait (#4423) and the chat service half (#4426, which answers each chat write's txid).

  • followWorkspaceChat takes an optional onTxWait and hands it to liveRows.
  • compose-coding-agents.ts keeps each followed chat's TxWait by workspace (a follow lets go only its own, never a newer one's), and CODING_AGENTS_CHAT_POST waits with confirmWrite on the answer's txid before answering the window.
  • No txid (a no-op write), or no wait (chat not followed, or polled), confirms at once; past 10 s it confirms anyway, as confirmWrite does.

Test: compose-coding-agents.test.ts now drives the shared testing/fake-realtime.ts (its local fake, whose awaitTxId resolved at once, is dropped). A write to a followed chat waits until arrive("78"); a no-op write and a write to an unfollowed workspace answer at once with nothing awaited. The new test fails without the wait.

Ported from #4253 (luke/chat-write-txid-wait, 4f24be7), rewritten onto confirmWrite instead of its hand-rolled wait.

Made with Luke

View guided diff Turn on auto-fix


Devin Review

…e followed chat

As Neon's mutations guide says: the chat follow hands its TxWait on
(onTxWait) while it is subscribed over Realtime, and a write to that
workspace's chat waits with confirmWrite on the txid the service answered
before it answers the window, so the chat pushed to it already holds the
write. A write that changed nothing answers no txid and waits for nothing,
as does one to a chat not followed or polled. The host test drives the
shared fake Realtime, whose awaitTxId settles only once the txid arrives.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Oct 21, 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 9:03pm UTC

Request Review

@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit d0f2b4f Oct 21, 2026
11 of 12 checks passed
@luke-agent
luke-agent Bot deleted the luke/chat-write-txid-wait-v2 branch October 21, 2026 21:13

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread packages/host/src/compose-coding-agents.ts

This branch was successfully deployed

1 active deployment
Preview — 01202d68 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