Skip to content

fix(web): keep user messages stable - #475

Merged
Yevanchen merged 1 commit into
mainfrom
fix/web-user-message-stability
Jul 30, 2026
Merged

fix(web): keep user messages stable#475
Yevanchen merged 1 commit into
mainfrom
fix/web-user-message-stability

Conversation

@Yevanchen

Copy link
Copy Markdown
Collaborator

Summary

  • Keep optimistic and canonical user messages on one stable assistant-ui identity.
  • Bypass output pacing for content belonging to a role: user message.
  • Add regressions for stable user IDs and immediate delivery of long user input.

Why

The canonical WebSocket echo used a different message ID from the optimistic message, so the user bubble was deleted and remounted. Separately, TEXT_MESSAGE_CONTENT has no role of its own and entered the assistant-output scheduler, making the remounted user input appear to stream.

Verification

  • Commands:
    • just test-file apps/web/tests/session-message-convert.test.ts (8/8)
    • just test-file apps/web/tests/session-stream-render-scheduler.test.ts (22/22)
    • just tc-package @mosoo/web
    • just test-package @mosoo/web (217/217)
    • bash ./init.sh acceptance
    • just react-doctor-diff
    • git diff --check
    • just check (1081 pass, 42 skip, 1 unrelated failure)
  • Manual steps: sent a 308-character Chinese prompt through the local UI and sampled before/after the server echo; exactly one full user bubble remained mounted as user:0 at every sample.
  • Not run: no production deployment. The full gate's sole failure is the unchanged ACP filesystem test expecting /var/... while macOS returns /private/var/...; the focused test reproduces the same path-normalization mismatch.

Impact

  • User/API/contract changes: user input stays fixed; only assistant output is paced. No API or wire-contract change.
  • Generated files / GraphQL / DB / lockfile: N/A
  • Env or config changes: N/A
  • Risk and rollback: limited to Web transcript identity and render scheduling; revert 4981fbc580 to roll back.

Review

  • Closest review areas: assistant-ui external-store message identity; session stream scheduler role tracking.
  • Known trade-offs: user IDs are transcript-position based inside the rendered session; source IDs remain unchanged outside the UI adapter.

@Yevanchen
Yevanchen merged commit d3df8dd into main Jul 30, 2026
9 checks passed
@Yevanchen
Yevanchen deleted the fix/web-user-message-stability branch July 30, 2026 18:08
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