MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / updateMessage

Method updateMessage

apps/cli/src/agent/state-store.ts:245–255  ·  view source on GitHub ↗

* Update a message in place (e.g., when partial becomes complete). * Finds the message by timestamp and replaces it. * * @param message - The updated message * @returns The previous agent state, or undefined if message not found

(message: ClineMessage)

Source from the content-addressed store, hash-verified

243 * @returns The previous agent state, or undefined if message not found
244 */
245 updateMessage(message: ClineMessage): AgentStateInfo | undefined {
246 const index = this.state.messages.findIndex((m) => m.ts === message.ts)
247 if (index === -1) {
248 // Message not found, add it instead
249 return this.addMessage(message)
250 }
251
252 const newMessages = [...this.state.messages]
253 newMessages[index] = message
254 return this.setMessages(newMessages)
255 }
256
257 /**
258 * Clear all messages and reset to initial state.

Callers 1

handleMessageUpdatedMethod · 0.45

Calls 2

addMessageMethod · 0.95
setMessagesMethod · 0.95

Tested by

no test coverage detected