MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / appendRun

Method appendRun

src/app/repo/agent_task.ts:42–50  ·  view source on GitHub ↗
(run: AgentTaskRun)

Source from the content-addressed store, hash-verified

40 }
41
42 async appendRun(run: AgentTaskRun): Promise<void> {
43 const runs = await this.readJsonFile<AgentTaskRun[]>(this.filename(run.taskId), []);
44 runs.unshift(run);
45 // 环形缓冲:超过上限时裁剪最老的记录
46 if (runs.length > MAX_RUNS_PER_TASK) {
47 runs.length = MAX_RUNS_PER_TASK;
48 }
49 await this.writeJsonFile(this.filename(run.taskId), runs);
50 }
51
52 async updateRun(taskId: string, id: string, data: Partial<AgentTaskRun>): Promise<void> {
53 const runs = await this.readJsonFile<AgentTaskRun[]>(this.filename(taskId), []);

Callers 2

executeTaskMethod · 0.80
agent_task.test.tsFile · 0.80

Calls 2

filenameMethod · 0.95
writeJsonFileMethod · 0.80

Tested by

no test coverage detected