[PR #7] Fix: streaming message display in LLM chatbot #7

Open
opened 2026-02-16 08:16:55 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraph-fullstack-python/pull/7
Author: @geminixiang
Created: 3/23/2025
Status: 🔄 Open

Base: mainHead: main


📝 Commits (1)

  • cf07f6c fix: hx_swap from innerHTML to beforeend

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/react_agent/app.py (+1 -1)

📄 Description

Description

This PR changes the hx_swap attribute from innerHTML to beforeend in the AssistantMessagePlaceholder function to correctly handle streaming responses from the LLM. This fixes the issue where only the last streaming chunk was being displayed instead of the complete response.

Changes

Changed hx_swap="innerHTML" to hx_swap="beforeend" in the AssistantMessagePlaceholder function
This modification allows new message chunks to be appended to existing content rather than replacing it
Maintains the complete message history during streaming

ref. https://htmx.org/attributes/hx-swap/


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraph-fullstack-python/pull/7 **Author:** [@geminixiang](https://github.com/geminixiang) **Created:** 3/23/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`cf07f6c`](https://github.com/langchain-ai/langgraph-fullstack-python/commit/cf07f6cd459e9b192bd07b0b02ee306eda00a22e) fix: hx_swap from innerHTML to beforeend ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/react_agent/app.py` (+1 -1) </details> ### 📄 Description ### Description This PR changes the hx_swap attribute from innerHTML to beforeend in the AssistantMessagePlaceholder function to correctly handle streaming responses from the LLM. This fixes the issue where only the last streaming chunk was being displayed instead of the complete response. ### Changes Changed hx_swap="innerHTML" to hx_swap="beforeend" in the AssistantMessagePlaceholder function This modification allows new message chunks to be appended to existing content rather than replacing it Maintains the complete message history during streaming ref. https://htmx.org/attributes/hx-swap/ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 08:16:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph-fullstack-python#7