Skip to content

Set event delivery to streaming for deployments and add optimistic playground messages - #386

Open
SaravanakumarR2018 wants to merge 1 commit into
mainfrom
codex/fix-visibility-issues-in-playground-chat
Open

Set event delivery to streaming for deployments and add optimistic playground messages#386
SaravanakumarR2018 wants to merge 1 commit into
mainfrom
codex/fix-visibility-issues-in-playground-chat

Conversation

@SaravanakumarR2018

Copy link
Copy Markdown
Owner

Motivation

  • Ensure the backend uses streaming event delivery on EBS staging/prod deployments by explicitly setting the environment variable so the frontend receives streaming events by default.
  • Improve playground UX so user messages appear immediately and do not duplicate when the server echo arrives.
  • Prevent the playground chat view from jumping sessions while a build is in progress.

Description

  • Added LANGFLOW_EVENT_DELIVERY=streaming to the deployment .env-file so EBS common staging/prod workflows copy an env file that forces streaming event delivery at startup (.env-file).
  • Implemented optimistic user messages support by adding src/frontend/src/utils/chat/optimistic-messages.ts which builds optimistic messages and reconciles them when the server-echo arrives.
  • Updated the messages store in src/frontend/src/stores/messagesStore.ts to reconcile and remove optimistic user messages before appending incoming server messages so duplicates and streaming partial updates are handled correctly.
  • Updated the playground send flow in src/frontend/src/modals/IOModal/playground-modal.tsx to 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

  • No automated tests were executed for this change.
  • The change is limited to a deployment env file and frontend UI logic; manual/CI validation was not requested in this rollout.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +57 to +61
!(
message.properties?.optimistic &&
message.sender === "User" &&
message.session_id === incomingMessage.session_id &&
message.text === incomingMessage.text

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant