MCPcopy
hub / github.com/wavetermdev/waveterm / RemoveMessage

Method RemoveMessage

pkg/aiusechat/chatstore/chatstore.go:114–129  ·  view source on GitHub ↗
(chatId string, messageId string)

Source from the content-addressed store, hash-verified

112}
113
114func (cs *ChatStore) RemoveMessage(chatId string, messageId string) bool {
115 cs.lock.Lock()
116 defer cs.lock.Unlock()
117
118 chat := cs.chats[chatId]
119 if chat == nil {
120 return false
121 }
122
123 initialLen := len(chat.NativeMessages)
124 chat.NativeMessages = slices.DeleteFunc(chat.NativeMessages, func(msg uctypes.GenAIMessage) bool {
125 return msg.GetMessageId() == messageId
126 })
127
128 return len(chat.NativeMessages) < initialLen
129}

Callers 4

RemoveToolUseCallFunction · 0.80
RemoveToolUseCallFunction · 0.80
RemoveToolUseCallFunction · 0.80
RemoveToolUseCallFunction · 0.80

Calls 1

GetMessageIdMethod · 0.65

Tested by

no test coverage detected