Repository navigation
Conversation
e1aade3 to
1be8a58
Compare
Context on prior artThis is a recurrence of #18079. The original UI-side fix (PR #18093, commit e24e465) added a local How this PR differs from the reverted approachInstead of duplicating the regex, this PR imports If the team prefers a server-side fix in the |
1be8a58 to
c043a9c
Compare
During streaming the Pi agent strips [[reply_to_current]] and [[reply_to:<id>]] tags before emitting text, so the WebChat UI displays clean output. However, when finalized messages are loaded from chat history, the raw text (with tags still present) is returned to the UI layer. The extractText() function in the message renderer only stripped thinking tags but not reply directive tags, causing [[reply_to_current]] to appear in the rendered chat bubble once the stream completes. Apply parseInlineDirectives() (already used by the backend delivery path) to assistant messages in extractText(), so reply tags are consistently stripped regardless of whether the message arrives via streaming or history retrieval. Closes openclaw#23053 Co-Authored-By: Claude Opus 4.6 <[email protected]>
c043a9c to
e206475
Compare
|
Closing — this was independently fixed by steipete in f6c7e09 which landed before this PR was reviewed. Thanks! |
Summary
[[reply_to_current]](and[[reply_to:<id>]]) tags in chat bubbles after a message finishes streaming, even though the tags are invisible during streamingextractText()only stripped thinking tags — not reply directive tagsparseInlineDirectives()(already used by the backend delivery path inreply-directives.ts) to assistant messages insideextractText(), so reply tags are stripped regardless of whether the message arrives via streaming or history retrievalChanges
ui/src/ui/chat/message-extract.tsparseInlineDirectivesand chain it afterstripThinkingTags()in all 3 assistant-message branches ofextractText()ui/src/ui/chat/message-extract.test.ts.textfield, and user-message passthroughTest plan
pnpm format:check— passespnpm tsgo— type-check passes with zero errorspnpm test -- src/auto-reply/reply/reply-utils.test.ts— 64 related tests pass[[reply_to_current]]no longer appears after streaming completesCloses #23053
🤖 Generated with Claude Code
Greptile Summary
Fixes a bug where reply directive tags like
[[reply_to_current]]and[[reply_to:<id>]]were visible in finalized WebChat messages loaded from history, even though they were correctly hidden during streaming.The root cause was that during streaming, the backend already strips these tags via
parseInlineDirectives()before emitting text, but when messages are loaded from history, the raw text (with tags intact) is returned and the UI'sextractText()function only stripped thinking tags.The fix applies
parseInlineDirectives()to all three assistant-message branches inextractText()(string content, array content, and text field), ensuring reply tags are stripped consistently regardless of whether the message arrives via streaming or history retrieval. User messages are correctly left unchanged.extractText()by chainingparseInlineDirectives()afterstripThinkingTags()Confidence Score: 5/5
parseInlineDirectives) that is already being used for the same purpose inreply-directives.ts, ensuring consistency. Tests cover all message content formats and verify the fix works correctly. The modification is purely additive (chaining an additional processing step) with no breaking changes.Last reviewed commit: e1aade3
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!