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

Method condenseTaskContext

src/core/webview/ClineProvider.ts:1965–1978  ·  view source on GitHub ↗
(taskId: string)

Source from the content-addressed store, hash-verified

1963
1964 /* Condenses a task's message history to use fewer tokens. */
1965 async condenseTaskContext(taskId: string) {
1966 let task: Task | undefined
1967 for (let i = this.clineStack.length - 1; i >= 0; i--) {
1968 if (this.clineStack[i].taskId === taskId) {
1969 task = this.clineStack[i]
1970 break
1971 }
1972 }
1973 if (!task) {
1974 throw new Error(`Task with id ${taskId} not found in stack`)
1975 }
1976 await task.condenseContext()
1977 await this.postMessageToWebview({ type: "condenseTaskContextResponse", text: taskId })
1978 }
1979
1980 // this function deletes a task from task history, and deletes its checkpoints and delete the task folder
1981 // If the task has subtasks (childIds), they will also be deleted recursively

Callers 1

webviewMessageHandlerFunction · 0.80

Calls 2

postMessageToWebviewMethod · 0.95
condenseContextMethod · 0.80

Tested by

no test coverage detected