Set event delivery to streaming for deployments and add optimistic playground messages - #386
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8a484c5bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| !( | ||
| message.properties?.optimistic && | ||
| message.sender === "User" && | ||
| message.session_id === incomingMessage.session_id && | ||
| message.text === incomingMessage.text |
There was a problem hiding this comment.
Remove only one optimistic message per server echo
The reconciliation removes all optimistic user messages that share the same session_id and text. If a user sends identical messages in the same session (e.g., “hi” twice, or file-only sends with empty text), the first server echo will clear every optimistic copy, causing later sends to disappear from the UI until the server replies. This can drop or reorder messages in the chat history. Consider matching a single optimistic message (e.g., by client id/timestamp) instead of filtering all matching text.
Useful? React with 👍 / 👎.
Motivation
Description
LANGFLOW_EVENT_DELIVERY=streamingto the deployment.env-fileso EBS common staging/prod workflows copy an env file that forces streaming event delivery at startup (.env-file).src/frontend/src/utils/chat/optimistic-messages.tswhich builds optimistic messages and reconciles them when the server-echo arrives.src/frontend/src/stores/messagesStore.tsto reconcile and remove optimistic user messages before appending incoming server messages so duplicates and streaming partial updates are handled correctly.src/frontend/src/modals/IOModal/playground-modal.tsxto insert an optimistic user message on send, use the trimmed text for build requests, and guard automatic session refetch/switching while a build is active to prevent mid-response jumps.Testing
Codex Task