Skip to content

fix(service): a Start answers the last transaction it committed in - #4453

Merged
luke-agent[bot] merged 1 commit into
mainfrom
luke/start-last-txid
Oct 21, 2026
Merged

luke-agent[bot] merged 1 commit into
mainfrom
luke/start-last-txid

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #4431, which entered the merge queue before this fix to Devin's review comment (thread) could be pushed.

A Start inserts the agent, then moves its task into progress (beginTaskWork) and assigns it (assignUnassignedTask), each in its own transaction. A task started with an agent also commits the task before the agent. Before this fix, the answer carried the first txid, so a client waiting on it could confirm before the agent and the task's new standing reached the followed list.

Now:

  • beginTaskWorkCommitted and assignUnassignedTaskCommitted return their txid in their own RETURNING, and none where nothing moved. The boolean functions stay as they were.
  • startCodingAgent answers the last txid it committed.
  • A task's start with an agent answers the agent Start's txid, which is later than the task insert's.

Realtime delivers transactions in commit order, so waiting on the last one covers every earlier one.

Tests: task-list-live.test.ts checks that both writes return their own, increasing txid and that asking again returns none. coding-agents-app.test.ts checks that a task's start with an agent answers the task row's xmin, which is its last write.

Made with Luke

View guided diff Turn on auto-fix


Devin Review

A Start inserts the agent, then moves its task into progress and assigns
it in transactions of their own, and a task started with an agent commits
the task before the agent. The answer now carries the last of them:
Realtime delivers transactions in commit order, so a client that waits on
it sees the agent and its task's standing alike.

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:14pm 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 cba3c04 Oct 21, 2026
11 of 12 checks passed
@luke-agent
luke-agent Bot deleted the luke/start-last-txid branch October 21, 2026 21:22

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

This branch was successfully deployed

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