MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / waitUntilCompleted

Function waitUntilCompleted

apps/vscode-e2e/src/suite/utils.ts:59–75  ·  view source on GitHub ↗
({
	api,
	taskId: passedTaskId,
	start,
	...options
}: WaitUntilCompletedOptions)

Source from the content-addressed store, hash-verified

57}
58
59export const waitUntilCompleted = async ({
60 api,
61 taskId: passedTaskId,
62 start,
63 ...options
64}: WaitUntilCompletedOptions): Promise<string> => {
65 const completed = new Set<string>()
66 const handler = (id: string) => completed.add(id)
67 api.on(RooCodeEventName.TaskCompleted, handler)
68 try {
69 const taskId = passedTaskId ?? (await start!())
70 await waitFor(() => completed.has(taskId), options)
71 return taskId
72 } finally {
73 api.off(RooCodeEventName.TaskCompleted, handler)
74 }
75}
76
77export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))

Callers 12

subtasks.test.tsFile · 0.90
task.test.tsFile · 0.90
modes.test.tsFile · 0.90
apply-diff.test.tsFile · 0.90
bedrock.test.tsFile · 0.90
openrouter.test.tsFile · 0.90
zai.test.tsFile · 0.90
gemini.test.tsFile · 0.90

Calls 4

waitForFunction · 0.85
onMethod · 0.65
hasMethod · 0.65
offMethod · 0.65

Tested by

no test coverage detected