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

Method getBackgroundTaskOutput

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

* Read a background task's captured output. Returns the in-memory * ring buffer if available, otherwise falls back to the persisted * ` /tasks/ /output.log`. `tail` caps the returned * string to that many trailing characters.

(
    taskId: string,
    options: { tail?: number } = {},
  )

Source from the content-addressed store, hash-verified

320 * string to that many trailing characters.
321 */
322 async getBackgroundTaskOutput(
323 taskId: string,
324 options: { tail?: number } = {},
325 ): Promise<string> {
326 this.ensureOpen();
327 const trimmedTaskId = normalizeRequiredString(
328 taskId,
329 'Task id cannot be empty',
330 ErrorCodes.BACKGROUND_TASK_ID_EMPTY,
331 );
332 return this.rpc.getBackgroundTaskOutput({
333 sessionId: this.id,
334 taskId: trimmedTaskId,
335 tail: options.tail,
336 });
337 }
338
339 /**
340 * Request a running background task to stop. Sends SIGTERM with a

Callers 4

refreshOutputViewerMethod · 0.80
handleOpenOutputMethod · 0.80
loadTailMethod · 0.80

Calls 2

ensureOpenMethod · 0.95
normalizeRequiredStringFunction · 0.85

Tested by

no test coverage detected