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

Method add

packages/agent-core/src/loop/tool-scheduler.ts:32–44  ·  view source on GitHub ↗
(task: ToolCallTask<Result>)

Source from the content-addressed store, hash-verified

30 private queuedTasks: Array<ScheduledToolCallTask<Result>> = [];
31
32 add(task: ToolCallTask<Result>): Promise<Result> {
33 const result = createControlledPromise<Result>();
34 void result.catch(() => undefined);
35
36 const scheduledTask: ScheduledToolCallTask<Result> = { ...task, result };
37 if (this.isBlocked(task, this.queuedTasks)) {
38 this.queuedTasks.push(scheduledTask);
39 } else {
40 this.start(scheduledTask);
41 }
42
43 return result;
44 }
45
46 private isBlocked(
47 task: ToolCallTask<Result>,

Callers 2

makeSchedulerFunction · 0.95
runToolCallBatchFunction · 0.95

Calls 3

isBlockedMethod · 0.95
startMethod · 0.95
pushMethod · 0.45

Tested by 1

makeSchedulerFunction · 0.76