#Message corruption
1 messages · Page 1 of 1 (latest)
This solution has been AI generated
This is a known streaming/join issue in the mcp-apps template: adjacent text chunks can be concatenated without spaces (e.g., today?I'd). It happens when Streamdown renders back‑to‑back chunks (reasoning → answer) that lack explicit whitespace.
Why this happens
The mcp-apps starter (V2) renders assistant content with Streamdown:
// CopilotChatAssistantMessage.tsx
export const MarkdownRenderer = ({ content, ...props }) => (
<Streamdown {...props}>{content ?? ""}</Streamdown>
);
In MCP Apps flows, agents often emit a "reasoning" block followed immediately by the final answer. If those events don’t include a trailing newline/space, Streamdown joins them visually.
Fixes (in order of recommendation)
-
Add explicit separators in the agent output
Ensure your agent logic/prompt inserts a newline between blocks, e.g. end reasoning with\n\nbefore the final response. This applies to LangGraph or the Built‑in Agent used by MCP Apps. -
Update CopilotKit/Streamdown packages
npm install @copilotkit/react-ui@latest @copilotkit/react-core@latest @copilotkit/runtime@latest
Early V2 stream handlers occasionally dropped delimiters; latest versions improve chunk joining.
- Optional visual tweak (CSS)
If spacing still looks off due to typography styles, add:
[data-copilotkit] .prose p + p { margin-top: 1em; }
If after adding a newline and upgrading packages you still see concatenation, the remaining cause is likely in how Streamdown or MCP Apps events are joined and may require a library fix.
Was this helpful?
If this solution worked for you, please click on the appropriate option below to help us improve:
Thank you for your feedback! Our team will provide additional assistance. 🔄
need help
Hi @solid grove, Could you open an issue with the details - versions and steps to reproduce? That would really help the team look into it. Thanks!
Thanks for opening the issue. I'll follow up with the team and get back to you!
very need help, i have change many models