MCPcopy
hub / github.com/TanStack/ai / stop

Method stop

packages/ai-client/src/generation-client.ts:297–310  ·  view source on GitHub ↗

* Abort any in-flight generation request.

()

Source from the content-addressed store, hash-verified

295 * Abort any in-flight generation request.
296 */
297 stop(): void {
298 const runId = this.devtoolsBridge.getActiveRunId()
299 if (this.abortController) {
300 this.abortController.abort()
301 this.abortController = null
302 }
303 this.setIsLoading(false)
304 if (this.status === 'generating') {
305 this.setStatus('idle')
306 if (runId) {
307 this.devtoolsBridge.finishRun(runId, 'run:cancelled', 'cancelled')
308 }
309 }
310 }
311
312 /**
313 * Clear the result, error, and return to idle state.

Callers 2

resetMethod · 0.95
disposeMethod · 0.95

Calls 5

setIsLoadingMethod · 0.95
setStatusMethod · 0.95
abortMethod · 0.65
getActiveRunIdMethod · 0.45
finishRunMethod · 0.45

Tested by

no test coverage detected