diff --git a/langgraph/src/components/MessageBubble.tsx b/langgraph/src/components/MessageBubble.tsx
index 3e5ffd9..e1efbea 100644
--- a/langgraph/src/components/MessageBubble.tsx
+++ b/langgraph/src/components/MessageBubble.tsx
@@ -501,6 +501,20 @@ export default function MessageBubble({ content: rawContent, role, isStreaming,
);
},
+ li({ children }) {
+ const processedChildren = Array.isArray(children)
+ ? children.flatMap((child, idx) =>
+ typeof child === "string"
+ ? renderWithSourceBadges(child).map((node, ni) =>
+ typeof node === "string" ? node : {node}
+ )
+ : [child]
+ )
+ : typeof children === "string"
+ ? renderWithSourceBadges(children)
+ : children;
+ return
{processedChildren};
+ },
// Paragraphs — inline source badges for [知识库] [工单] [网络] [推断]
p({ children }) {
diff --git a/langgraph/src/main.tsx b/langgraph/src/main.tsx
index 4d2915c..935597e 100644
--- a/langgraph/src/main.tsx
+++ b/langgraph/src/main.tsx
@@ -154,6 +154,12 @@ function App() {
// ── Active messages ──────────────────────────────────────────────────────
const lastMessagesRef = useRef([]);
+ const lastThreadIdRef = useRef(null);
+ // Clear stale messages when thread switches to avoid showing previous thread's content
+ if (currentThreadId !== lastThreadIdRef.current) {
+ lastMessagesRef.current = [];
+ lastThreadIdRef.current = currentThreadId;
+ }
if (thread.messages.length > 0) {
lastMessagesRef.current = thread.messages;
}