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

Function finalizeHeadlessRun

apps/kimi-code/src/cli/headless-exit.ts:88–96  ·  view source on GitHub ↗
(
  proc: ExitableProcess,
  streams: readonly Writable[],
  getExitCode: () => number,
  options: { drainTimeoutMs?: number; graceMs?: number } = {},
)

Source from the content-addressed store, hash-verified

86 * the backstop is for.
87 */
88export async function finalizeHeadlessRun(
89 proc: ExitableProcess,
90 streams: readonly Writable[],
91 getExitCode: () => number,
92 options: { drainTimeoutMs?: number; graceMs?: number } = {},
93): Promise<void> {
94 await drainStdio(streams, options.drainTimeoutMs ?? HEADLESS_STDIO_DRAIN_TIMEOUT_MS);
95 scheduleHeadlessForceExit(proc, getExitCode, options.graceMs);
96}

Callers 2

mainFunction · 0.90

Calls 2

drainStdioFunction · 0.85

Tested by

no test coverage detected