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

Function waitForOutput

packages/agent-core/test/agent/background/helpers.ts:116–127  ·  view source on GitHub ↗
(
  manager: BackgroundManager,
  taskId: string,
  expected: string,
)

Source from the content-addressed store, hash-verified

114}
115
116export async function waitForOutput(
117 manager: BackgroundManager,
118 taskId: string,
119 expected: string,
120): Promise<void> {
121 for (let i = 0; i < 20; i++) {
122 const output = await manager.readOutput(taskId);
123 if (output.includes(expected)) return;
124 await new Promise((resolve) => setTimeout(resolve, 5));
125 }
126 throw new Error(`Timed out waiting for output: ${expected}`);
127}

Callers 3

task-tools.test.tsFile · 0.90
manager.test.tsFile · 0.90

Calls 1

readOutputMethod · 0.80

Tested by

no test coverage detected