Skip to content

fix(chat): cancel superseded builder preparation - #78

Open
loganj wants to merge 6 commits into
larry/chat-laws-queue-acceptancefrom
larry/queue-deferred-builder-race-fix
Open

fix(chat): cancel superseded builder preparation#78
loganj wants to merge 6 commits into
larry/chat-laws-queue-acceptancefrom
larry/queue-deferred-builder-race-fix

Conversation

@loganj

@loganj loganj commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

🤖

Summary

Prevents a removed or replaced queued Agent Builder message from finishing deferred draft preparation and leaving an orphan draft behind. Preparation now remains tied to the exact queued message that triggered it, and a draft created after that message loses authority is deleted before the chat session is updated.

This is PR 4 in the ordered stack: #64#65#68 → this PR. It builds on Morgan's defer-until-promotion architecture in #68; it does not merge or replace that work.

Related issue

N/A — follow-up correctness fix for #68.

Testing

  • Full Vitest suite at 0385e40855d99e3668dc455772653611ede58839: 539 files, 6309 passed, 1 skipped.
  • Added a regression that removes the triggering queue record while draft creation is in flight, then verifies the orphan draft is deleted and the session is not promoted.
  • The regression fails against the parent branch because the orphan draft is not deleted, and passes with this commit.

loganj and others added 4 commits August 17, 2026 15:30
Enable pending draft composers to queue messages while preserving the existing creation-readiness dispatch gate. Carry draft ownership and Agent Builder draft metadata across session promotion.

Signed-off-by: Logan Johnson <loganj@squareup.com>

Co-authored-by: Chai Landau <chai@block.xyz>
Specify composer-to-queue acceptance before readiness and rewrite chat laws with observable queue, dequeue, dispatch, and remove source-to-sink vocabulary.

Signed-off-by: Logan Johnson <loganj@squareup.com>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
@loganj
loganj marked this pull request as ready for review August 18, 2026 15:09
@loganj
loganj requested a review from a team as a code owner August 18, 2026 15:09
Queued messages no longer pin the model and provider shown at queue
time; dispatch may use whatever model and provider are selected when
the message reaches the session. Persona retention is unchanged.

Signed-off-by: Logan Johnson <loganj@squareup.com>
kalvinnchau
kalvinnchau previously approved these changes Aug 18, 2026
stack merge was automatically disabled August 18, 2026 18:42

Pull Request is not mergeable

stack merge was automatically disabled August 18, 2026 18:42

Pull Request is not mergeable

stack merge was automatically disabled August 18, 2026 18:43

Pull Request is not mergeable

@loganj
loganj dismissed kalvinnchau’s stale review August 18, 2026 18:45

The merge-base changed after approval.

Base automatically changed from morganm/queue-send-during-session-start to larry/chat-laws-queue-acceptance August 18, 2026 19:16
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.

3 participants