Repository navigation
feat(database,service,features): a task's and an agent's write answers the transaction it committed in - #4431
Merged
Merged
Conversation
…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. Ported from #4259 onto today's main. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 21, 2026
This branch was successfully deployed
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.
The service half of the txid rollout for tasks and agents, ported from #4259 (closed when Realtime was switched off) onto today's
main; the branch didn't rebase cleanly, so this is a fresh PR.Per Neon's mutations guide, each write reads
pg_current_xact_id()::textin its ownRETURNING, with no extra transaction:createTaskCommitted), change/pin/archive/move (updateTaskCommitted, from the row update or the reader's pin), delete (deleteTaskCommitted).insertAgentrow), rename, archive, pin (*Committedvariants incoding-agent-store.ts).The wire answers (
taskAnswerSchema,taskStartAnswerSchema,taskDeleteAnswerSchema,codingAgentAnswerSchema,codingAgentAgentAnswerSchema) carry an optional decimaltxid, andHostedTaskClienthands it beside the task (TaskWritten). The existing store functions keep their old answers, each mapped from its committed write.The host wait (
onTxWait+confirmWrite) follows in a second PR, after #4423.Tests:
task-list-live.test.tschecks that a task change, a pin, an agent rename and pin, and a delete each return a txid, and that a repeated pin and a delete of a missing task return none.Made with Luke