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

Method clear

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

* Clear all messages and reset to initial state. * Called when a task is cleared/cancelled.

()

Source from the content-addressed store, hash-verified

259 * Called when a task is cleared/cancelled.
260 */
261 clear(): void {
262 this.updateState({
263 messages: [],
264 agentState: detectAgentState([]),
265 isInitialized: true, // Still initialized, just empty
266 lastUpdatedAt: Date.now(),
267 currentMode: this.state.currentMode, // Preserve mode when clearing task
268 extensionState: undefined,
269 })
270 }
271
272 /**
273 * Set the current mode.

Callers

nothing calls this directly

Calls 2

updateStateMethod · 0.95
detectAgentStateFunction · 0.85

Tested by

no test coverage detected