| 5761 | } |
| 5762 | |
| 5763 | func (p *Server) publishMessagePart(chatID uuid.UUID, role codersdk.ChatMessageRole, part codersdk.ChatMessagePart) { |
| 5764 | if part.Type == "" { |
| 5765 | return |
| 5766 | } |
| 5767 | // Strip internal-only fields before client delivery. |
| 5768 | // Mirrors db2sdk.chatMessageParts stripping for REST. |
| 5769 | part.StripInternal() |
| 5770 | p.publishEvent(chatID, codersdk.ChatStreamEvent{ |
| 5771 | Type: codersdk.ChatStreamEventTypeMessagePart, |
| 5772 | MessagePart: &codersdk.ChatStreamMessagePart{ |
| 5773 | Role: role, |
| 5774 | Part: part, |
| 5775 | }, |
| 5776 | }) |
| 5777 | } |
| 5778 | |
| 5779 | func shouldCancelChatFromControlNotification( |
| 5780 | notify coderdpubsub.ChatStreamNotifyMessage, |