MCPcopy Create free account
hub / github.com/AI45Lab/Code / script

Function script

sdk/node/ptc_soak.mjs:17–27  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

15
16const WORDS = ['ALPHA', 'BRAVO', 'CHARLIE', 'DELTA', 'ECHO'];
17function script(n) {
18 const tasks = Array.from({ length: n }, (_, i) => ({
19 description: `t${i}`,
20 agent: 'general',
21 prompt: `Write exactly 50 words about the number ${i + 1}. End with the single word ${WORDS[i]}.`,
22 }));
23 return `async function run(ctx, inputs) {
24 const res = await ctx.tool("parallel_task", { tasks: ${JSON.stringify(tasks)} });
25 return JSON.stringify(res);
26}`;
27}
28// NO explicit limits → exercises the DEFAULT script timeout. With 50-word
29// subtasks (each >30s on this model), 4.2.6's 30s default would time out; 4.2.7
30// gives delegation-capable scripts 10min, so it should complete.

Callers 1

promptForFunction · 0.85

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected