MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / detachBackgroundTask

Method detachBackgroundTask

packages/node-sdk/src/session.ts:367–378  ·  view source on GitHub ↗

* Detach a running foreground task so the current tool call can return while * the task continues under background-task management.

(taskId: string)

Source from the content-addressed store, hash-verified

365 * the task continues under background-task management.
366 */
367 async detachBackgroundTask(taskId: string): Promise<BackgroundTaskInfo | undefined> {
368 this.ensureOpen();
369 const trimmedTaskId = normalizeRequiredString(
370 taskId,
371 'Task id cannot be empty',
372 ErrorCodes.BACKGROUND_TASK_ID_EMPTY,
373 );
374 return this.rpc.detachBackgroundTask({
375 sessionId: this.id,
376 taskId: trimmedTaskId,
377 });
378 }
379
380 /**
381 * Block until every still-running background task (across all agents in this

Callers 2

Calls 2

ensureOpenMethod · 0.95
normalizeRequiredStringFunction · 0.85

Tested by

no test coverage detected