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

Method setMessages

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

* Set the complete messages array. * This is typically called when receiving a full state update from the extension. * * @param messages - The new messages array * @returns The previous agent state (for comparison)

(messages: ClineMessage[])

Source from the content-addressed store, hash-verified

209 * @returns The previous agent state (for comparison)
210 */
211 setMessages(messages: ClineMessage[]): AgentStateInfo {
212 const previousAgentState = this.state.agentState
213 const newAgentState = detectAgentState(messages)
214
215 this.updateState({
216 messages,
217 agentState: newAgentState,
218 isInitialized: true,
219 lastUpdatedAt: Date.now(),
220 currentMode: this.state.currentMode, // Preserve mode across message updates
221 })
222
223 return previousAgentState
224 }
225
226 /**
227 * Add a single message to the end of the messages array.

Callers 4

addMessageMethod · 0.95
updateMessageMethod · 0.95
setExtensionStateMethod · 0.95
handleStateMessageMethod · 0.80

Calls 2

updateStateMethod · 0.95
detectAgentStateFunction · 0.85

Tested by

no test coverage detected