← Back to PRs

#16361: Gateway: suppress NO_REPLY in webchat

by shadril238 open 2026-02-14 17:39 View on GitHub →
app: web-ui gateway stale size: S trusted-contributor
- Filter NO_REPLY silent tokens from webchat chat deltas and final payloads so they never render in the UI. - Exclude NO_REPLY-only assistant messages from chat history responses. - Add gateway test coverage for silent-token suppression. <!-- greptile_comment --> <h3>Greptile Summary</h3> Filtered `NO_REPLY` silent tokens from webchat responses to prevent them from rendering in the UI. Added helper functions `extractChatTextContent` and `isSilentChatMessage` to detect and filter assistant messages containing only the silent token. Updated streaming logic in `server-chat.ts` to suppress `NO_REPLY` deltas, and modified chat history endpoint to exclude silent messages. Test updated to use `SILENT_REPLY_TOKEN` constant for consistency. Key implementation details: - `isSilentChatMessage` only filters assistant-role messages with text-only content (preserves messages with images/tools) - Falls back to `record.text` field if content array doesn't contain text - Uses existing `isSilentReplyText` utility for token matching with proper regex handling - Chat history filtering happens after sanitization but before byte-capping for efficiency <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with no identified issues - The implementation is clean, well-tested, and follows existing patterns. The logic correctly handles edge cases (non-text content, role filtering, whitespace trimming). The filtering happens at appropriate points in the request flow. Tests verify both streaming suppression and final message filtering. No breaking changes or security concerns identified. - No files require special attention <sub>Last reviewed commit: f1dee85</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs