Skip to content

fix(chat): restore double Enter and reliable immediate sends - #8237

Merged
Sg312 merged 1 commit into
stagingfrom
fix/staging-double-enter
Sep 24, 2026
Merged

Sg312 merged 1 commit into
stagingfrom
fix/staging-double-enter

Conversation

@Sg312

@Sg312 Sg312 commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Restore double Enter during streaming in organization Search and Build: the first Enter queues the draft, and the second sends the current queue head after the active response stops. Resolve the head from the live queue instead of a rendered snapshot, consume attachments synchronously to prevent duplicate sends, and poll an acknowledged worker stop within a bounded deadline so normal cleanup does not prematurely return the correction to Retry.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other

Testing

  • 236 tests pass across the organization composer/home, workspace composer/chat, queue handoff, abort authorization, and worker settlement suites.
  • Regression cases reproduced before the fix: missing organization double Enter, duplicate rapid submissions, stale queue-head selection, and early unsettled acknowledgement.
  • bun run type-check and bun run check:api-validation pass.
  • Shutdown deadline, errors, persistent queue recovery, and no-overlap behavior remain covered. Native browser automation is unavailable in this session due to its sandbox rejecting the workspace symlink; UI interactions were exercised through the actual React composers in DOM tests.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • Contributor License Agreement confirmation left to the contributor.

@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 24, 2026 6:29pm UTC

Request Review

@Sg312
Sg312 merged commit 316fea0 into staging Sep 24, 2026
25 checks passed
@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR is not ready to merge until immediate queue dispatch preserves an in-progress edit of the head message.

Findings

  1. P1 Queued edit sent prematurely ▶

Summary

The PR restores double-Enter queue handoff in organization and workspace chat, consumes attachment state synchronously during submission, and polls worker-stop settlement within a deadline.

  • Immediate queue dispatch still needs to respect a head being edited.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Enter[Empty Enter during streaming] --> Head[Resolve live queue head]
  Head --> Check{Head being edited?}
  Check -->|Yes: currently unchecked| Dispatch[Dispatch original queued content]
  Check -->|No| Stop[Stop active response and dispatch head]
Loading

Reviews (1) · Last reviewed commit: "fix(chat): restore double Enter and wait..."

async (id?: string) => {
const queue = useMothershipQueueStore.getState().queues[chatKeyRef.current]
const msg = queue?.find((queued) => queued.id === id)
const msg = id === undefined ? queue?.[0] : queue?.find((queued) => queued.id === id)

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.

P1 Queued edit sent prematurely When someone is editing the first queued message during an active response, they can clear the composer and press Enter. This path sends that message’s original content without checking whether it is being edited, so the correction can go out before the user finishes it. The automatic queue sender already pauses for an edited message, but this immediate-send path bypasses that check; the new organization composer callback exposes the same path there.

This branch was previously deployed

1 inactive deployment
Preview — 500df706 Deployed Sep 24, 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