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

Method emitFinalTokenUsageUpdate

src/core/task/Task.ts:2193–2197  ·  view source on GitHub ↗

* Force emit a final token usage update, ignoring throttle. * Called before task completion or abort to ensure final stats are captured. * Triggers the debounce with current values and immediately flushes to ensure emit.

()

Source from the content-addressed store, hash-verified

2191 * Triggers the debounce with current values and immediately flushes to ensure emit.
2192 */
2193 public emitFinalTokenUsageUpdate(): void {
2194 const tokenUsage = this.getTokenUsage()
2195 this.debouncedEmitTokenUsage(tokenUsage, this.toolUsage)
2196 this.debouncedEmitTokenUsage.flush()
2197 }
2198
2199 public async abortTask(isAbandoned = false) {
2200 // Aborting task

Callers 3

abortTaskMethod · 0.95
emitTaskCompletedMethod · 0.80

Calls 2

getTokenUsageMethod · 0.95
flushMethod · 0.65

Tested by

no test coverage detected