omnirush 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,12 +23,6 @@ import path from "node:path";
|
|
|
23
23
|
export const CHILD_TIMEOUT_MS = 10 * 60_000;
|
|
24
24
|
/** Grace between SIGTERM and SIGKILL on timeout. */
|
|
25
25
|
export const CHILD_KILL_GRACE_MS = 5_000;
|
|
26
|
-
/** Default number of children running at once. */
|
|
27
|
-
export const MAX_CONCURRENT_CHILDREN = 4;
|
|
28
|
-
/** Upper bound on children running at once (swarms). */
|
|
29
|
-
export const MAX_CONCURRENCY_CEILING = 12;
|
|
30
|
-
/** Upper bound on tasks per spawn_agents call. */
|
|
31
|
-
export const MAX_TASKS_PER_CALL = 12;
|
|
32
26
|
/** Per-child output cap in the structured result (bytes, UTF-8). */
|
|
33
27
|
export const CHILD_OUTPUT_CAP_BYTES = 50 * 1024;
|
|
34
28
|
|
|
@@ -27,9 +27,6 @@ import {
|
|
|
27
27
|
AGENT_ROLES,
|
|
28
28
|
CHILD_TIMEOUT_MS,
|
|
29
29
|
mapWithConcurrency,
|
|
30
|
-
MAX_CONCURRENT_CHILDREN,
|
|
31
|
-
MAX_CONCURRENCY_CEILING,
|
|
32
|
-
MAX_TASKS_PER_CALL,
|
|
33
30
|
renderChildResults,
|
|
34
31
|
runChildAgent,
|
|
35
32
|
type ChildResult,
|
|
@@ -47,7 +44,7 @@ const SpawnAgentsParams = Type.Object({
|
|
|
47
44
|
description: 'Cross-model child: gateway model id for THIS task (e.g. "muse-spark-1.3", "muse-spark-1.2-contributor" for cheap swarm workers, "gpt-6-astra", "gpt-5.6-sol"). Omit to inherit this session\'s model',
|
|
48
45
|
})),
|
|
49
46
|
}),
|
|
50
|
-
{ description: "Tasks to delegate; they run in parallel", minItems: 1
|
|
47
|
+
{ description: "Tasks to delegate; they all run in parallel", minItems: 1 },
|
|
51
48
|
),
|
|
52
49
|
timeout_minutes: Type.Optional(Type.Number({
|
|
53
50
|
description: `Per-child wall-clock limit in minutes (default ${CHILD_TIMEOUT_MS / 60_000}; a timed-out child is killed and its partial result is kept)`,
|
|
@@ -55,9 +52,8 @@ const SpawnAgentsParams = Type.Object({
|
|
|
55
52
|
maximum: 60,
|
|
56
53
|
})),
|
|
57
54
|
max_parallel: Type.Optional(Type.Number({
|
|
58
|
-
description:
|
|
55
|
+
description: "Optional throttle: run at most this many children at once. Omit to run every task in parallel (no cap)",
|
|
59
56
|
minimum: 1,
|
|
60
|
-
maximum: MAX_CONCURRENCY_CEILING,
|
|
61
57
|
})),
|
|
62
58
|
});
|
|
63
59
|
|
|
@@ -80,7 +76,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
80
76
|
"Delegate tasks to parallel subagents with isolated context windows.",
|
|
81
77
|
"Each child is a headless agent run in this workspace with a role preset:",
|
|
82
78
|
"code-searcher (read-only exploration), researcher-web (web research via web_search + web_fetch), general-worker (full tools).",
|
|
83
|
-
`Children run in parallel
|
|
79
|
+
`Children run in parallel — every task at once unless max_parallel throttles it — and each gets its own timeout (default ${CHILD_TIMEOUT_MS / 60_000} min).`,
|
|
84
80
|
'Each task can run on a DIFFERENT model via its "model" field — e.g. cheap muse workers for wide swarm sweeps under an astra parent.',
|
|
85
81
|
"Every task description must be SELF-CONTAINED: the child cannot see this conversation.",
|
|
86
82
|
"Use for parallelizable work: broad code surveys, independent research questions, independent implementation chunks.",
|
|
@@ -109,21 +105,16 @@ export default function (pi: ExtensionAPI) {
|
|
|
109
105
|
});
|
|
110
106
|
}
|
|
111
107
|
if (tasks.length === 0) throw new Error("no tasks given");
|
|
112
|
-
if (tasks.length > MAX_TASKS_PER_CALL) {
|
|
113
|
-
throw new Error(`too many tasks (${tasks.length}); the limit is ${MAX_TASKS_PER_CALL} per call`);
|
|
114
|
-
}
|
|
115
108
|
const parentSessionId = String(ctx?.sessionManager?.getSessionId?.() ?? "");
|
|
116
109
|
if (!parentSessionId) throw new Error("no parent session id — subagents cannot be traced");
|
|
117
110
|
const cwd = ctx?.cwd ? String(ctx.cwd) : process.cwd();
|
|
118
111
|
const timeoutMinutes = typeof params.timeout_minutes === "number" && params.timeout_minutes > 0
|
|
119
112
|
? params.timeout_minutes
|
|
120
113
|
: undefined;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
Math.
|
|
124
|
-
|
|
125
|
-
: MAX_CONCURRENT_CHILDREN),
|
|
126
|
-
);
|
|
114
|
+
// No cap: every task runs at once unless the caller throttles.
|
|
115
|
+
const concurrency = typeof params.max_parallel === "number" && params.max_parallel >= 1
|
|
116
|
+
? Math.floor(params.max_parallel)
|
|
117
|
+
: tasks.length;
|
|
127
118
|
|
|
128
119
|
const entries = registry.get(parentSessionId) ?? [];
|
|
129
120
|
registry.set(parentSessionId, entries);
|