Skip to content

feat(database,service,features): a task's and an agent's write answers the transaction it committed in - #4259

Closed
charleslpan wants to merge 1 commit into
luke/neon-realtime-plan-list-servicefrom
luke/neon-realtime-task-writes-txid
Closed

charleslpan wants to merge 1 commit into
luke/neon-realtime-plan-list-servicefrom
luke/neon-realtime-task-writes-txid

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Stack 2 · Task list and automations, piece 3 of 10. Stacked on #3269 (luke/neon-realtime-plan-list-service), which sits on #3265 → luke/live-tx-wait (P).

Each write whose result the desktop shows through the live task list now returns the id of the transaction it committed in, as Neon's mutations guide says:

  • task: start, rename, standing, pin, archive, move, set repository, delete;
  • agent: start, rename, archive, pin.

How it works:

  • The txid comes from the RETURNING pg_current_xact_id()::text of the write that changed a row: the row itself, or the reader's pin.
  • A write that changed nothing returns no txid. A pin asked again is one example.
  • Agent Stop and message are left out. Their visible effect comes later, from eve, in another transaction.

Interfaces:

  • Wire: taskAnswerSchema, taskStartAnswerSchema, taskDeleteAnswerSchema and codingAgentAnswerSchema gain an optional txid.
  • Task client: returns the txid beside the task (TaskWritten).
  • Store: …Committed variants return the txid. The existing functions map onto them, so no other caller changes.

The host waits for the txid on the followed list in a later piece of this stack.

Tests: a PGlite store test checks that a rename and a pin return a txid, and that a pin asked again returns none. Web and service delete assertions now read the answer through taskDeleteAnswerSchema.

Made with Luke

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Oct 20, 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 20, 2026 10:29pm UTC

Request Review

…s the transaction it committed in

Starting, changing, pinning, archiving, moving, and deleting a task, and an
agent's start, rename, archive, and pin, each return the id of the
transaction they committed in, read in the RETURNING of the write that
changed a row (the row itself or the reader's pin), as Neon's mutations
guide says, and none where nothing changed, such as a pin asked again. The
answers carry it as an optional txid, and the task client hands it beside
the task, so the desktop following the task list can wait for it to arrive
before it confirms the write. A Stop and a message change what the list
shows only once eve moves the agent, in another transaction, so they answer
none. The store's existing writes stay as they were, each one now the
committed write mapped to its old answer.

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

luke-agent Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Closing for now: the developer moved every area onto the central live layer with Neon Realtime off (LUKE_REALTIME, #4267; held polls, #4272), and this change only does something with Realtime on. The branch is kept, so the PR can be reopened and rebased when LUKE_REALTIME goes back on.

This branch was successfully deployed

1 active deployment
Preview — b5fc369d Deployed Oct 20, 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