* Clear all messages and reset to initial state. * Called when a task is cleared/cancelled.
()
| 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. |
nothing calls this directly
no test coverage detected