fix(chat): queue messages safely while sessions start - #79
Closed
loganj wants to merge 1 commit into
Closed
Conversation
Allow new chats to accept queued messages before backend creation finishes without dispatching them early. Define the queue's acceptance and dispatch contract, defer Agent Builder draft preparation until the final session ID exists, and discard preparation when its triggering queue record is removed or superseded. Signed-off-by: Logan Johnson <loganj@squareup.com> Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz> Co-authored-by: Chai Landau <chai@block.xyz> Co-authored-by: Morgan Martin <98432065+morgmart@users.noreply.github.com> Co-authored-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Collaborator
Author
|
Closing as superseded — this frozen flatten artifact predates the background-drain repair (its tree lacks commit e05a11e on #78) and the merge plan changed: the stack will be flattened by cascading merges (#78 → #68 → #65 → #64, then #64 → main) rather than via this commit-tree artifact. The four stacked PRs remain the review/merge vehicle. |
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.
🤖
Summary
New chats can now accept messages immediately while their backend session is still starting, without attempting to send those messages before the session is ready. Agent Builder messages follow the same rule: draft preparation waits for the final session identity, and removing or replacing the queued message cancels that preparation without leaving an orphan draft.
This is the one-commit merge vehicle for the reviewed stack #64 → #65 → #68 → #78. Those PRs remain open as the review record; this PR changes topology and attribution only.
Related issue
N/A — consolidates the four linked PRs.
Testing
79491039b7b9c4c6f095e861e54c60543cb6a8de, byte-identical to gated stack tip0385e40855d99e3668dc455772653611ede58839(git diff --exit-codeis empty).b0f489f053def3b93a25ffb1b63a703eb86dab5c, and preserves Chai Landau's and Morgan Martin's contributions throughCo-authored-bytrailers.mainhas moved beyond that base. A localgit merge-tree --write-tree origin/main 206e2277ec97f5a7083345d4a9dd189e0af23a6ecompletes without conflicts. No merge is authorized until Logan rules on merge semantics.Known non-blocking note
The reviewed implementation guards both successful and failed asynchronous preparation with the same queue-record authority predicate. Regression coverage directly exercises successful preparation resolving after removal; it does not include the symmetric rejection-after-removal case. Exact-head review judged the shared guard sufficient and recommended avoiding churn to the green, gated tree.