Skip to content

fix(chat): concatenate all text parts in conversation item rendering#901

Merged
harshithmullapudi merged 1 commit into
RedPlanetHQ:mainfrom
omjeem:fix/blank-message-multi-text-parts
Jun 11, 2026
Merged

fix(chat): concatenate all text parts in conversation item rendering#901
harshithmullapudi merged 1 commit into
RedPlanetHQ:mainfrom
omjeem:fix/blank-message-multi-text-parts

Conversation

@omjeem

@omjeem omjeem commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Problem

message.parts.find(p => p.type === "text") returns the first text chunk, which is empty in multi-step agent turns. After a tool call, the AI SDK produces a step-start + empty text part for the tool-use step, followed by another step-start + the real response text. .find() grabs the empty one → editor gets "" → blank message.

Solution

Replace .find() with .filter() + .map().join() to concatenate all non-empty text parts into a single string for the TipTap editor.

Changes

  • apps/webapp/app/components/conversation/conversation-item.client.tsx
  • Replace .find() with .filter() to collect all non-empty text parts
  • Update useEditor initial content and useEffect to use the combined string
SDK_Text_Fix.mov

Fix #900

@harshithmullapudi harshithmullapudi merged commit 47b9eeb into RedPlanetHQ:main Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Assistant message renders blank when AI SDK returns empty text in first step chunk

2 participants