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

Method updateTaskHistory

src/core/webview/ClineProvider.ts:2703–2717  ·  view source on GitHub ↗

* Updates a task in the task history and optionally broadcasts the updated history to the webview. * Now delegates to TaskHistoryStore for per-task file persistence. * * @param item The history item to update or add * @param options.broadcast Whether to broadcast the updated history to the w

(item: HistoryItem, options: { broadcast?: boolean } = {})

Source from the content-addressed store, hash-verified

2701 * @returns The updated task history array
2702 */
2703 async updateTaskHistory(item: HistoryItem, options: { broadcast?: boolean } = {}): Promise<HistoryItem[]> {
2704 const { broadcast = true } = options
2705
2706 const history = await this.taskHistoryStore.upsert(item)
2707 this.recentTasksCache = undefined
2708
2709 // Broadcast the updated history to the webview if requested.
2710 // Prefer per-item updates to avoid repeatedly cloning/sending the full history.
2711 if (broadcast && this.isViewLaunched) {
2712 const updatedItem = this.taskHistoryStore.get(item.id) ?? item
2713 await this.postMessageToWebview({ type: "taskHistoryItemUpdated", taskHistoryItem: updatedItem })
2714 }
2715
2716 return history
2717 }
2718
2719 /**
2720 * Schedule a debounced write-through of task history to globalState.

Calls 3

postMessageToWebviewMethod · 0.95
upsertMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected