Skip to content

fix(chat): admit messages while sessions start - #64

Merged
loganj merged 1 commit into
mainfrom
larry/queue-pending-session-admission
Aug 18, 2026
Merged

fix(chat): admit messages while sessions start#64
loganj merged 1 commit into
mainfrom
larry/queue-pending-session-admission

Conversation

@loganj

@loganj loganj commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

🤖

Summary

  • Lets the composer accept a message into a draft chat's queue while its backend session is still being prepared.
  • Keeps dispatch blocked until session preparation completes, including Agent Builder draft identity migration.
  • Preserves failed-creation, read-only, Agent Builder preparation, and workspace preparation blocks.

This is PR 1 of 2. PR #65 updates the chat laws on top of this behavior.

Adapted from chailandau's squareup/berd#1076 for block/berd, while retaining the dispatch ownership introduced by block/berd#61.

Related issue

None found. Related pull requests: squareup/berd#1076 and #61.

Testing

  • just check
  • just test — 6,308 passed, 1 skipped
  • Pre-push fmt, frontend check, Tauri check, and Clippy gate
  • Focused queue-admission, promotion/migration interleaving, failure, and draft-preservation regressions

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>
@loganj
loganj force-pushed the larry/queue-pending-session-admission branch from 0f4a07e to 21d7663 Compare August 17, 2026 19:30
@loganj
loganj marked this pull request as ready for review August 17, 2026 21:09
@loganj
loganj requested a review from a team August 17, 2026 21:09

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

REQUEST_CHANGES. Static review of the exact three-dot comparison found two blocking Agent Builder migration defects. Final self-check covered pending-session composer admission, ordinary and Agent Builder queue dispatch, draft-ID promotion, creation and migration failure, newer-draft preservation, navigation/consent guards, accessibility, i18n, async never-completes and race behavior, lifecycle, test honesty, design-system/project laws, duplicate overlap, and blocking user-effect evidence. The supplied GitHub evidence was inspected: all 8 captured check runs completed successfully; no local execution was performed. The findings are distinct: one concerns concurrent write/data-loss behavior, while the other concerns adopting a path returned by a successful rename. No review threads were supplied, so no findings were suppressed as duplicates.

Deterministic publication result: 2 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/agents/lib/agentBuilderSession.ts
Comment thread src/features/agents/lib/agentBuilderSession.ts
@loganj

loganj commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

Changes requested here #64 (review) are addressed down-stack in PRs #68 and #78

@loganj
loganj dismissed morgmart’s stale review August 18, 2026 17:10

Both P1 findings were confirmed as real at this PR's head, then resolved structurally by the stacked follow-up work: the defer-prep stack deletes migratePendingDraftAgent entirely (zero references remain), and the full stack is flattened into a single change before anything merges, so no unpatched interim window exists. Details in the resolved review threads. Dismissing on Logan's instruction so the stack can proceed.

@loganj
loganj merged commit fbecf21 into main Aug 18, 2026
8 checks passed
@loganj
loganj deleted the larry/queue-pending-session-admission branch August 18, 2026 18:45
loganj added a commit that referenced this pull request Aug 18, 2026
🤖

## Summary

- Requires composer→queue acceptance even before the selected chat's
session is ready.
- Replaces ambiguous send/sending language with explicit queue, dequeue,
dispatch, steer, and remove operations.
- Names the source and sink for each chat queue law so acceptance and
dispatch remain distinct observable behaviors.

This is PR 2 of 2, stacked on [PR
#64](#64). Review the resulting laws
in
[`LAWS/CHAT.md`](https://github.com/block/berd/blob/larry/chat-laws-queue-acceptance/LAWS/CHAT.md).

### Related issue

None found. This canonizes the queue-admission behavior adapted from
[squareup/berd#1076](squareup/berd#1076) and
preserves the dispatch hold from
[#61](#61).

### Testing

- `just check`
- `just test` — 6,308 passed, 1 skipped
- Both stacked PR boundaries pass `git diff --check`

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Co-authored-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
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