rivet-design 0.13.4 → 0.14.0
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.
- package/dist/agent-variants/SessionStore.d.ts +14 -3
- package/dist/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/agent-variants/SessionStore.js +9 -1
- package/dist/agent-variants/SessionStore.js.map +1 -1
- package/dist/agent-variants/WorkerExecutorService.d.ts +140 -0
- package/dist/agent-variants/WorkerExecutorService.d.ts.map +1 -0
- package/dist/agent-variants/WorkerExecutorService.js +496 -0
- package/dist/agent-variants/WorkerExecutorService.js.map +1 -0
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +24 -1
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +82 -3
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/contracts.d.ts +30 -13
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js +11 -4
- package/dist/agent-variants/contracts.js.map +1 -1
- package/dist/agent-variants/directionAuthoring.d.ts +36 -0
- package/dist/agent-variants/directionAuthoring.d.ts.map +1 -0
- package/dist/agent-variants/directionAuthoring.js +348 -0
- package/dist/agent-variants/directionAuthoring.js.map +1 -0
- package/dist/agent-variants/runLabel.d.ts +5 -4
- package/dist/agent-variants/runLabel.d.ts.map +1 -1
- package/dist/agent-variants/runLabel.js +16 -8
- package/dist/agent-variants/runLabel.js.map +1 -1
- package/dist/agent-variants/videoKeyframes.d.ts +19 -0
- package/dist/agent-variants/videoKeyframes.d.ts.map +1 -0
- package/dist/agent-variants/videoKeyframes.js +109 -0
- package/dist/agent-variants/videoKeyframes.js.map +1 -0
- package/dist/agent-variants/workItemBriefing.d.ts +3 -1
- package/dist/agent-variants/workItemBriefing.d.ts.map +1 -1
- package/dist/agent-variants/workItemBriefing.js +34 -2
- package/dist/agent-variants/workItemBriefing.js.map +1 -1
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +57 -25
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/variants.d.ts.map +1 -1
- package/dist/cli/commands/variants.js +294 -4
- package/dist/cli/commands/variants.js.map +1 -1
- package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
- package/dist/cli/hostWorkNextAction.js +6 -1
- package/dist/cli/hostWorkNextAction.js.map +1 -1
- package/dist/cli/router.js +2 -2
- package/dist/cli/router.js.map +1 -1
- package/dist/hosts/workerDefaults.d.ts +42 -0
- package/dist/hosts/workerDefaults.d.ts.map +1 -1
- package/dist/hosts/workerDefaults.js +40 -1
- package/dist/hosts/workerDefaults.js.map +1 -1
- package/dist/mcp/changeBatchClassification.d.ts +2 -0
- package/dist/mcp/changeBatchClassification.d.ts.map +1 -1
- package/dist/mcp/changeBatchClassification.js +5 -0
- package/dist/mcp/changeBatchClassification.js.map +1 -1
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +34 -2
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/routes/emptyStatePage.d.ts +14 -0
- package/dist/routes/emptyStatePage.d.ts.map +1 -0
- package/dist/routes/emptyStatePage.js +601 -0
- package/dist/routes/emptyStatePage.js.map +1 -0
- package/dist/routes/static.d.ts.map +1 -1
- package/dist/routes/static.js +2 -73
- package/dist/routes/static.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts +36 -1
- package/dist/services/VariantGenerationService.d.ts.map +1 -1
- package/dist/services/VariantGenerationService.js +334 -13
- package/dist/services/VariantGenerationService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +8 -0
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +31 -6
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/services/VariantsRuntime.d.ts.map +1 -1
- package/dist/services/VariantsRuntime.js +9 -0
- package/dist/services/VariantsRuntime.js.map +1 -1
- package/dist/types/change-request-types.d.ts +19 -0
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +2 -2
- package/dist/utils/skills/claude-skill.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.js +1 -1
- package/dist/utils/skills/cli-guidance.d.ts +2 -2
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +11 -8
- package/dist/utils/skills/cli-guidance.js.map +1 -1
- package/dist/utils/skills/cursor-rules.d.ts +2 -2
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
- package/dist/utils/skills/cursor-rules.js +1 -1
- package/package.json +1 -1
- package/src/ui/dist/assets/main-CobdEReL.css +1 -0
- package/src/ui/dist/assets/main-DJjaeK_0.js +422 -0
- package/src/ui/dist/index.html +2 -2
- package/src/ui/dist/assets/main-Dyos9I29.css +0 -1
- package/src/ui/dist/assets/main-T3U4Gt16.js +0 -419
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkerExecutorService = exports.isWorkerExecutorEnabled = exports.EXECUTOR_LEASE_OWNER = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const logger_1 = require("../utils/logger");
|
|
6
|
+
const workItemBriefing_1 = require("./workItemBriefing");
|
|
7
|
+
const workerDefaults_1 = require("../hosts/workerDefaults");
|
|
8
|
+
const contracts_1 = require("./contracts");
|
|
9
|
+
const log = (0, logger_1.createLogger)('WorkerExecutor');
|
|
10
|
+
/** Lease owner marking work the executor runs — hosts must not implement it. */
|
|
11
|
+
exports.EXECUTOR_LEASE_OWNER = 'rivet-executor';
|
|
12
|
+
/**
|
|
13
|
+
* The executor is the DEFAULT execution path for variant workers: leaner,
|
|
14
|
+
* cheaper, and deterministic vs host-agent subagents (see PR #948 evidence).
|
|
15
|
+
* RIVET_EXECUTOR=0 opts a machine out; the runtime preflight falls back to
|
|
16
|
+
* the host path automatically when no worker binary is available. Fresh
|
|
17
|
+
* (zero-to-one / vite) lanes remain host-executed pending executor ownership
|
|
18
|
+
* of scaffold and source-plan steps.
|
|
19
|
+
*/
|
|
20
|
+
const isWorkerExecutorEnabled = (env = process.env) => {
|
|
21
|
+
const flag = (env.RIVET_EXECUTOR ?? '').trim().toLowerCase();
|
|
22
|
+
return flag !== '0' && flag !== 'false' && flag !== 'off';
|
|
23
|
+
};
|
|
24
|
+
exports.isWorkerExecutorEnabled = isWorkerExecutorEnabled;
|
|
25
|
+
/** Parse the final result object the headless CLI prints on stdout. Returns
|
|
26
|
+
* undefined on any shape surprise — usage capture must never fail a run. */
|
|
27
|
+
const parseWorkerUsage = (stdout) => {
|
|
28
|
+
try {
|
|
29
|
+
const trimmed = stdout.trim();
|
|
30
|
+
const start = trimmed.indexOf('{');
|
|
31
|
+
if (start === -1)
|
|
32
|
+
return undefined;
|
|
33
|
+
const parsed = JSON.parse(trimmed.slice(start));
|
|
34
|
+
const usage = parsed.usage;
|
|
35
|
+
if (!usage && typeof parsed.total_cost_usd !== 'number')
|
|
36
|
+
return undefined;
|
|
37
|
+
const sum = (...values) => values.reduce((total, value) => total + (typeof value === 'number' ? value : 0), 0);
|
|
38
|
+
return {
|
|
39
|
+
...(usage
|
|
40
|
+
? {
|
|
41
|
+
tokensIn: sum(usage.input_tokens, usage.cache_read_input_tokens, usage.cache_creation_input_tokens),
|
|
42
|
+
tokensOut: sum(usage.output_tokens),
|
|
43
|
+
}
|
|
44
|
+
: {}),
|
|
45
|
+
...(typeof parsed.total_cost_usd === 'number'
|
|
46
|
+
? { costUsd: parsed.total_cost_usd }
|
|
47
|
+
: {}),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const defaultSpawn = ({ command, args, cwd }) => (0, child_process_1.spawn)(command, args, {
|
|
55
|
+
cwd,
|
|
56
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
57
|
+
// Own process group so a timeout/cancel kills the whole worker tree.
|
|
58
|
+
detached: process.platform !== 'win32',
|
|
59
|
+
});
|
|
60
|
+
const DEFAULT_TIMEOUT_MS = 10 * 60 * 1000;
|
|
61
|
+
const DEFAULT_MAX_CONCURRENT = 3;
|
|
62
|
+
const isExecutableImplementationItem = (item) => ('workspace' in item &&
|
|
63
|
+
(item.kind === 'static_preview' || item.kind === 'refine_variant') &&
|
|
64
|
+
item.workspace.kind === 'artifact_directory') ||
|
|
65
|
+
('workspace' in item &&
|
|
66
|
+
item.kind === 'code_gen' &&
|
|
67
|
+
item.workspace.kind === 'git_worktree');
|
|
68
|
+
/**
|
|
69
|
+
* M0 worker executor: runs artifact-backed implementation work items as
|
|
70
|
+
* headless worker processes instead of host-agent subagents. The briefing is
|
|
71
|
+
* the entire prompt; completion is observed (process exit) and reported by
|
|
72
|
+
* the executor — workers cannot forget, batch, or mis-transport it. One QA
|
|
73
|
+
* requeue is honored per item, matching the host path's single retry.
|
|
74
|
+
*/
|
|
75
|
+
class WorkerExecutorService {
|
|
76
|
+
orchestrator;
|
|
77
|
+
telemetry;
|
|
78
|
+
workerCommand;
|
|
79
|
+
workerModel;
|
|
80
|
+
workerEffort;
|
|
81
|
+
referenceCreateModel;
|
|
82
|
+
referenceCreateEffort;
|
|
83
|
+
workerTierOverridden;
|
|
84
|
+
referenceCreateTierOverridden;
|
|
85
|
+
timeoutMs;
|
|
86
|
+
runtimeAvailable;
|
|
87
|
+
childrenBySession = new Map();
|
|
88
|
+
maxConcurrent;
|
|
89
|
+
spawnWorker;
|
|
90
|
+
active = 0;
|
|
91
|
+
waiters = [];
|
|
92
|
+
constructor(options) {
|
|
93
|
+
this.orchestrator = options.orchestrator;
|
|
94
|
+
this.telemetry = options.telemetry;
|
|
95
|
+
this.workerCommand =
|
|
96
|
+
options.workerCommand ?? process.env.RIVET_EXECUTOR_COMMAND ?? 'claude';
|
|
97
|
+
// Explicit tier overrides (constructor options or env) are the ops
|
|
98
|
+
// escape hatch and outrank the user's per-run fidelity selection.
|
|
99
|
+
this.workerTierOverridden = Boolean(options.workerModel ??
|
|
100
|
+
options.workerEffort ??
|
|
101
|
+
process.env.RIVET_EXECUTOR_MODEL ??
|
|
102
|
+
process.env.RIVET_EXECUTOR_EFFORT);
|
|
103
|
+
this.referenceCreateTierOverridden = Boolean(options.referenceCreateModel ??
|
|
104
|
+
options.referenceCreateEffort ??
|
|
105
|
+
process.env.RIVET_EXECUTOR_REFERENCE_CREATE_MODEL ??
|
|
106
|
+
process.env.RIVET_EXECUTOR_REFERENCE_CREATE_EFFORT);
|
|
107
|
+
this.workerModel =
|
|
108
|
+
options.workerModel ??
|
|
109
|
+
process.env.RIVET_EXECUTOR_MODEL ??
|
|
110
|
+
workerDefaults_1.RIVET_WORKER_DEFAULTS.model;
|
|
111
|
+
this.workerEffort =
|
|
112
|
+
options.workerEffort ??
|
|
113
|
+
process.env.RIVET_EXECUTOR_EFFORT ??
|
|
114
|
+
workerDefaults_1.RIVET_WORKER_DEFAULTS.effort;
|
|
115
|
+
this.referenceCreateModel =
|
|
116
|
+
options.referenceCreateModel ??
|
|
117
|
+
process.env.RIVET_EXECUTOR_REFERENCE_CREATE_MODEL ??
|
|
118
|
+
workerDefaults_1.RIVET_WORKER_REFERENCE_CREATE_DEFAULTS.model;
|
|
119
|
+
this.referenceCreateEffort =
|
|
120
|
+
options.referenceCreateEffort ??
|
|
121
|
+
process.env.RIVET_EXECUTOR_REFERENCE_CREATE_EFFORT ??
|
|
122
|
+
workerDefaults_1.RIVET_WORKER_REFERENCE_CREATE_DEFAULTS.effort;
|
|
123
|
+
this.timeoutMs =
|
|
124
|
+
options.timeoutMs ??
|
|
125
|
+
Number(process.env.RIVET_EXECUTOR_TIMEOUT_MS ?? DEFAULT_TIMEOUT_MS);
|
|
126
|
+
this.maxConcurrent = options.maxConcurrent ?? DEFAULT_MAX_CONCURRENT;
|
|
127
|
+
this.spawnWorker = options.spawnWorker ?? defaultSpawn;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* True when the worker runtime binary is invocable. Checked once —
|
|
131
|
+
* callers use this to fall back to the host-agent path BEFORE leasing,
|
|
132
|
+
* so an executor-less machine behaves exactly as before the flag.
|
|
133
|
+
*/
|
|
134
|
+
isRuntimeAvailable() {
|
|
135
|
+
if (this.runtimeAvailable === undefined) {
|
|
136
|
+
try {
|
|
137
|
+
(0, child_process_1.execFileSync)(this.workerCommand, ['--version'], {
|
|
138
|
+
stdio: 'ignore',
|
|
139
|
+
timeout: 10_000,
|
|
140
|
+
});
|
|
141
|
+
this.runtimeAvailable = true;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
log.warn(`worker runtime '${this.workerCommand}' unavailable — executor falling back to host path`);
|
|
145
|
+
this.runtimeAvailable = false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return this.runtimeAvailable;
|
|
149
|
+
}
|
|
150
|
+
/** Kill every in-flight worker for a session (cancel/teardown). */
|
|
151
|
+
cancelSession(sessionId) {
|
|
152
|
+
for (const pid of this.childrenBySession.get(sessionId) ?? []) {
|
|
153
|
+
this.killTree(pid);
|
|
154
|
+
}
|
|
155
|
+
this.childrenBySession.delete(sessionId);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Run the given leased work items to terminal state. Fire-and-forget from
|
|
159
|
+
* the caller's perspective; failures surface as failed variants, never as
|
|
160
|
+
* thrown errors on the intake path. Pass the caller's lease so ids that
|
|
161
|
+
* never appear in the session snapshot can still be terminal-failed.
|
|
162
|
+
*/
|
|
163
|
+
async run(sessionId, workItemIds, lease) {
|
|
164
|
+
const claimed = new Set(workItemIds);
|
|
165
|
+
const claimedItems = this.orchestrator
|
|
166
|
+
.getHostWork(sessionId)
|
|
167
|
+
.filter((item) => claimed.has(item.workId));
|
|
168
|
+
const runnable = claimedItems.filter(isExecutableImplementationItem);
|
|
169
|
+
// Anything we claimed but cannot execute must still reach a terminal
|
|
170
|
+
// state — a silently dropped executor lease would strand the variant
|
|
171
|
+
// (hosts skip executor-owned items in nextAction).
|
|
172
|
+
const stranded = claimedItems.filter((item) => !runnable.some((candidate) => candidate.workId === item.workId));
|
|
173
|
+
// Claimed ids missing from the snapshot entirely (raced session mutation,
|
|
174
|
+
// filtered state) hold an executor lease no host can see — terminal-fail
|
|
175
|
+
// them on the caller's lease rather than stranding until lease expiry.
|
|
176
|
+
const unseen = workItemIds.filter((workItemId) => !claimedItems.some((item) => item.workId === workItemId));
|
|
177
|
+
await Promise.all([
|
|
178
|
+
...runnable.map((item) => this.runOne(sessionId, item, { retried: false })),
|
|
179
|
+
...stranded.map((item) => this.reportSafely(sessionId, {
|
|
180
|
+
workItemId: item.workId,
|
|
181
|
+
leaseId: item.leaseId,
|
|
182
|
+
attempt: item.attempt,
|
|
183
|
+
status: 'failed',
|
|
184
|
+
error: {
|
|
185
|
+
code: 'EXECUTOR_UNSUPPORTED_ITEM',
|
|
186
|
+
message: `executor cannot run kind=${item.kind}`,
|
|
187
|
+
},
|
|
188
|
+
})),
|
|
189
|
+
...unseen.map((workItemId) => {
|
|
190
|
+
if (!lease) {
|
|
191
|
+
log.error(`executor claimed ${workItemId} but it is missing from the session snapshot and no lease context was provided — item may be stranded until lease expiry`);
|
|
192
|
+
return Promise.resolve({});
|
|
193
|
+
}
|
|
194
|
+
return this.reportSafely(sessionId, {
|
|
195
|
+
workItemId,
|
|
196
|
+
leaseId: lease.leaseId,
|
|
197
|
+
attempt: lease.items.find((item) => item.id === workItemId)?.attempt ?? 1,
|
|
198
|
+
status: 'failed',
|
|
199
|
+
error: {
|
|
200
|
+
code: 'EXECUTOR_ITEM_UNSEEN',
|
|
201
|
+
message: 'claimed work item missing from the session snapshot at run time',
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
}),
|
|
205
|
+
]);
|
|
206
|
+
}
|
|
207
|
+
/** reportComplete that can never strand a lease: a throw on a succeeded
|
|
208
|
+
* report (e.g. invalid artifact) is converted into a failed report so the
|
|
209
|
+
* item reaches a terminal state either way. */
|
|
210
|
+
async reportSafely(sessionId, args) {
|
|
211
|
+
try {
|
|
212
|
+
return await this.orchestrator.reportComplete({ sessionId, ...args });
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
216
|
+
if (args.status === 'failed') {
|
|
217
|
+
log.warn(`executor failed-report rejected for ${args.workItemId}`, error);
|
|
218
|
+
return {};
|
|
219
|
+
}
|
|
220
|
+
log.warn(`executor success report rejected for ${args.workItemId} — recording failure`, error);
|
|
221
|
+
try {
|
|
222
|
+
return await this.orchestrator.reportComplete({
|
|
223
|
+
sessionId,
|
|
224
|
+
workItemId: args.workItemId,
|
|
225
|
+
leaseId: args.leaseId,
|
|
226
|
+
attempt: args.attempt,
|
|
227
|
+
status: 'failed',
|
|
228
|
+
error: { code: 'EXECUTOR_ARTIFACT_INVALID', message },
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
catch (secondError) {
|
|
232
|
+
log.warn(`executor terminal-failure report rejected for ${args.workItemId}`, secondError);
|
|
233
|
+
return {};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/** Model/effort tier for one work item.
|
|
238
|
+
*
|
|
239
|
+
* Precedence: explicit ops overrides (constructor options / RIVET_EXECUTOR_*
|
|
240
|
+
* env) > the run's user-selected fidelity ({@link FIDELITY_WORKER_TIERS})
|
|
241
|
+
* > lane defaults. Reference-backed creates keep their own override lane
|
|
242
|
+
* because reference fidelity is the deliverable there. */
|
|
243
|
+
workerTierFor(item) {
|
|
244
|
+
const referenceBacked = Boolean(item.contextFiles?.length || item.contextBundlePath);
|
|
245
|
+
const isReferenceCreate = item.mode === 'create' && referenceBacked;
|
|
246
|
+
const overridden = isReferenceCreate
|
|
247
|
+
? this.referenceCreateTierOverridden
|
|
248
|
+
: this.workerTierOverridden;
|
|
249
|
+
if (!overridden && (0, contracts_1.isWorkerFidelity)(item.fidelity)) {
|
|
250
|
+
return workerDefaults_1.FIDELITY_WORKER_TIERS[item.fidelity];
|
|
251
|
+
}
|
|
252
|
+
if (isReferenceCreate) {
|
|
253
|
+
return {
|
|
254
|
+
model: this.referenceCreateModel,
|
|
255
|
+
effort: this.referenceCreateEffort,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
return { model: this.workerModel, effort: this.workerEffort };
|
|
259
|
+
}
|
|
260
|
+
async runOne(sessionId, item, state) {
|
|
261
|
+
await this.acquire();
|
|
262
|
+
const startedAt = Date.now();
|
|
263
|
+
const tier = this.workerTierFor(item);
|
|
264
|
+
this.telemetry?.track('agent_variants.executor_worker_started', {
|
|
265
|
+
source: 'mcp',
|
|
266
|
+
sessionId,
|
|
267
|
+
workItemId: item.workId,
|
|
268
|
+
model: tier.model,
|
|
269
|
+
effort: tier.effort,
|
|
270
|
+
fidelity: item.fidelity ?? null,
|
|
271
|
+
attempt: item.attempt,
|
|
272
|
+
});
|
|
273
|
+
let outcome;
|
|
274
|
+
try {
|
|
275
|
+
outcome = await this.spawnAndWait(sessionId, item);
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
outcome = {
|
|
279
|
+
status: 'failed',
|
|
280
|
+
message: error instanceof Error ? error.message : String(error),
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
finally {
|
|
284
|
+
this.release();
|
|
285
|
+
}
|
|
286
|
+
this.telemetry?.track('agent_variants.executor_worker_exited', {
|
|
287
|
+
source: 'mcp',
|
|
288
|
+
sessionId,
|
|
289
|
+
workItemId: item.workId,
|
|
290
|
+
durationMs: Date.now() - startedAt,
|
|
291
|
+
status: outcome.status,
|
|
292
|
+
tokensIn: outcome.usage?.tokensIn ?? null,
|
|
293
|
+
tokensOut: outcome.usage?.tokensOut ?? null,
|
|
294
|
+
costUsd: outcome.usage?.costUsd ?? null,
|
|
295
|
+
});
|
|
296
|
+
const result = await this.reportSafely(sessionId, {
|
|
297
|
+
workItemId: item.workId,
|
|
298
|
+
leaseId: item.leaseId,
|
|
299
|
+
attempt: item.attempt,
|
|
300
|
+
status: outcome.status,
|
|
301
|
+
...(outcome.usage?.tokensIn !== undefined
|
|
302
|
+
? { tokensIn: outcome.usage.tokensIn }
|
|
303
|
+
: {}),
|
|
304
|
+
...(outcome.usage?.tokensOut !== undefined
|
|
305
|
+
? { tokensOut: outcome.usage.tokensOut }
|
|
306
|
+
: {}),
|
|
307
|
+
...(outcome.usage?.costUsd !== undefined
|
|
308
|
+
? { costUsd: outcome.usage.costUsd }
|
|
309
|
+
: {}),
|
|
310
|
+
model: tier.model,
|
|
311
|
+
...(outcome.status === 'succeeded' &&
|
|
312
|
+
item.kind === 'code_gen' &&
|
|
313
|
+
item.workspace.kind === 'git_worktree'
|
|
314
|
+
? {
|
|
315
|
+
output: {
|
|
316
|
+
worktreePath: item.workspace.rootPath,
|
|
317
|
+
changedFiles: [],
|
|
318
|
+
},
|
|
319
|
+
}
|
|
320
|
+
: {}),
|
|
321
|
+
...(outcome.status === 'failed'
|
|
322
|
+
? {
|
|
323
|
+
error: {
|
|
324
|
+
code: 'EXECUTOR_WORKER_FAILED',
|
|
325
|
+
message: outcome.message ?? 'worker failed',
|
|
326
|
+
},
|
|
327
|
+
}
|
|
328
|
+
: {}),
|
|
329
|
+
});
|
|
330
|
+
if (result.requeuedForRegeneration && !state.retried) {
|
|
331
|
+
try {
|
|
332
|
+
const renewedLease = this.orchestrator.requestWork({
|
|
333
|
+
sessionId,
|
|
334
|
+
workItemIds: [item.workId],
|
|
335
|
+
leaseOwner: exports.EXECUTOR_LEASE_OWNER,
|
|
336
|
+
});
|
|
337
|
+
const renewed = this.orchestrator
|
|
338
|
+
.getHostWork(sessionId)
|
|
339
|
+
.filter(isExecutableImplementationItem)
|
|
340
|
+
.find((candidate) => candidate.workId === item.workId);
|
|
341
|
+
if (renewed) {
|
|
342
|
+
await this.runOne(sessionId, renewed, { retried: true });
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
// Renewed lease exists but the item is not visible/executable —
|
|
346
|
+
// terminal-fail it on the new lease rather than stranding it.
|
|
347
|
+
const renewedAttempt = renewedLease.leasedWorkItems.find((leased) => leased.id === item.workId)?.attempt ?? item.attempt + 1;
|
|
348
|
+
await this.reportSafely(sessionId, {
|
|
349
|
+
workItemId: item.workId,
|
|
350
|
+
leaseId: renewedLease.leaseId,
|
|
351
|
+
attempt: renewedAttempt,
|
|
352
|
+
status: 'failed',
|
|
353
|
+
error: {
|
|
354
|
+
code: 'EXECUTOR_REQUEUE_LOST',
|
|
355
|
+
message: 'requeued item was not re-runnable by the executor',
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
catch (error) {
|
|
360
|
+
log.warn(`executor requeue retry failed for ${item.workId}`, error);
|
|
361
|
+
// Terminal-state invariant: a requeued item left pending with no
|
|
362
|
+
// lease is invisible to hosts (they skip executor-owned work) and
|
|
363
|
+
// would strand the session. Make one more lease attempt purely to
|
|
364
|
+
// record a terminal failure.
|
|
365
|
+
try {
|
|
366
|
+
const salvageLease = this.orchestrator.requestWork({
|
|
367
|
+
sessionId,
|
|
368
|
+
workItemIds: [item.workId],
|
|
369
|
+
leaseOwner: exports.EXECUTOR_LEASE_OWNER,
|
|
370
|
+
});
|
|
371
|
+
const salvageAttempt = salvageLease.leasedWorkItems.find((leased) => leased.id === item.workId)?.attempt ?? item.attempt + 1;
|
|
372
|
+
await this.reportSafely(sessionId, {
|
|
373
|
+
workItemId: item.workId,
|
|
374
|
+
leaseId: salvageLease.leaseId,
|
|
375
|
+
attempt: salvageAttempt,
|
|
376
|
+
status: 'failed',
|
|
377
|
+
error: {
|
|
378
|
+
code: 'EXECUTOR_REQUEUE_LOST',
|
|
379
|
+
message: 'executor requeue retry failed; recording terminal failure',
|
|
380
|
+
},
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
catch (salvageError) {
|
|
384
|
+
log.error(`executor could not terminal-fail requeued ${item.workId} — item may be stranded until lease expiry`, salvageError);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
spawnAndWait(sessionId, item) {
|
|
390
|
+
const tier = this.workerTierFor(item);
|
|
391
|
+
const prompt = (0, workItemBriefing_1.renderWorkItemBriefing)(item, { completion: 'executor' });
|
|
392
|
+
const child = this.spawnWorker({
|
|
393
|
+
command: this.workerCommand,
|
|
394
|
+
args: [
|
|
395
|
+
'--print',
|
|
396
|
+
'--output-format',
|
|
397
|
+
'json',
|
|
398
|
+
'--model',
|
|
399
|
+
tier.model,
|
|
400
|
+
'--effort',
|
|
401
|
+
tier.effort,
|
|
402
|
+
'--dangerously-skip-permissions',
|
|
403
|
+
'--allowed-tools',
|
|
404
|
+
'Read,Write,Edit,Bash,Glob,Grep',
|
|
405
|
+
// Workers of one session differ only by cwd/briefing; moving the
|
|
406
|
+
// per-machine sections out of the system prompt lets the N parallel
|
|
407
|
+
// workers (and QA-requeue retries) share one prompt-cache prefix.
|
|
408
|
+
'--exclude-dynamic-system-prompt-sections',
|
|
409
|
+
],
|
|
410
|
+
cwd: item.workspace.kind === 'git_worktree'
|
|
411
|
+
? item.workspace.projectPath
|
|
412
|
+
: item.workspace.rootPath,
|
|
413
|
+
prompt,
|
|
414
|
+
});
|
|
415
|
+
if (child.pid) {
|
|
416
|
+
const children = this.childrenBySession.get(sessionId) ?? new Set();
|
|
417
|
+
children.add(child.pid);
|
|
418
|
+
this.childrenBySession.set(sessionId, children);
|
|
419
|
+
child.on('close', () => children.delete(child.pid));
|
|
420
|
+
}
|
|
421
|
+
child.stdin?.write(prompt);
|
|
422
|
+
child.stdin?.end();
|
|
423
|
+
let stderrTail = '';
|
|
424
|
+
child.stderr?.on('data', (chunk) => {
|
|
425
|
+
stderrTail = (stderrTail + chunk.toString()).slice(-2000);
|
|
426
|
+
});
|
|
427
|
+
// Keep stdout drained (a full pipe would block the worker). The JSON
|
|
428
|
+
// result object is the final output — retain a bounded tail for usage.
|
|
429
|
+
let stdoutTail = '';
|
|
430
|
+
child.stdout?.on('data', (chunk) => {
|
|
431
|
+
stdoutTail = (stdoutTail + chunk.toString()).slice(-131072);
|
|
432
|
+
});
|
|
433
|
+
return new Promise((resolve) => {
|
|
434
|
+
const timer = setTimeout(() => {
|
|
435
|
+
this.killTree(child.pid);
|
|
436
|
+
resolve({
|
|
437
|
+
status: 'failed',
|
|
438
|
+
message: `worker timed out after ${this.timeoutMs}ms`,
|
|
439
|
+
});
|
|
440
|
+
}, this.timeoutMs);
|
|
441
|
+
child.on('error', (error) => {
|
|
442
|
+
clearTimeout(timer);
|
|
443
|
+
resolve({ status: 'failed', message: error.message });
|
|
444
|
+
});
|
|
445
|
+
child.on('close', (code) => {
|
|
446
|
+
clearTimeout(timer);
|
|
447
|
+
const usage = parseWorkerUsage(stdoutTail);
|
|
448
|
+
resolve(code === 0
|
|
449
|
+
? { status: 'succeeded', ...(usage ? { usage } : {}) }
|
|
450
|
+
: {
|
|
451
|
+
status: 'failed',
|
|
452
|
+
message: `worker exited ${code}: ${stderrTail.slice(-400)}`,
|
|
453
|
+
...(usage ? { usage } : {}),
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
killTree(pid) {
|
|
459
|
+
if (!pid)
|
|
460
|
+
return;
|
|
461
|
+
try {
|
|
462
|
+
if (process.platform === 'win32') {
|
|
463
|
+
process.kill(pid, 'SIGKILL');
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
process.kill(-pid, 'SIGKILL');
|
|
467
|
+
}
|
|
468
|
+
catch {
|
|
469
|
+
// Not a group leader (or group already gone) — kill the process itself.
|
|
470
|
+
try {
|
|
471
|
+
process.kill(pid, 'SIGKILL');
|
|
472
|
+
}
|
|
473
|
+
catch {
|
|
474
|
+
// Already gone.
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
acquire() {
|
|
479
|
+
if (this.active < this.maxConcurrent) {
|
|
480
|
+
this.active += 1;
|
|
481
|
+
return Promise.resolve();
|
|
482
|
+
}
|
|
483
|
+
return new Promise((resolve) => this.waiters.push(() => {
|
|
484
|
+
this.active += 1;
|
|
485
|
+
resolve();
|
|
486
|
+
}));
|
|
487
|
+
}
|
|
488
|
+
release() {
|
|
489
|
+
this.active -= 1;
|
|
490
|
+
const next = this.waiters.shift();
|
|
491
|
+
if (next)
|
|
492
|
+
next();
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
exports.WorkerExecutorService = WorkerExecutorService;
|
|
496
|
+
//# sourceMappingURL=WorkerExecutorService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkerExecutorService.js","sourceRoot":"","sources":["../../src/agent-variants/WorkerExecutorService.ts"],"names":[],"mappings":";;;AAAA,iDAAoD;AACpD,4CAA+C;AAC/C,yDAA4D;AAC5D,4DAKiC;AACjC,2CAIqB;AAErB,MAAM,GAAG,GAAG,IAAA,qBAAY,EAAC,gBAAgB,CAAC,CAAC;AAE3C,gFAAgF;AACnE,QAAA,oBAAoB,GAAG,gBAAgB,CAAC;AAErD;;;;;;;GAOG;AACI,MAAM,uBAAuB,GAAG,CACrC,MAAyB,OAAO,CAAC,GAAG,EAC3B,EAAE;IACX,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7D,OAAO,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,KAAK,CAAC;AAC5D,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC;AA2BF;6EAC6E;AAC7E,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAA2B,EAAE;IACnE,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,G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AC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,QAAQ,CAAC,GAAuB;QACtC,IAAI,CAAC,GAAG;YAAE,OAAO;QACjB,IAAI,CAAC;YACH,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;gBACjC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;gBAC7B,OAAO;YACT,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,wEAAwE;YACxE,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAC/B,CAAC;YAAC,MAAM,CAAC;gBACP,gBAAgB;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAEO,OAAO;QACb,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;YACjB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;YACrB,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,OAAO;QACb,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,IAAI;YAAE,IAAI,EAAE,CAAC;IACnB,CAAC;CACF;AA1eD,sDA0eC"}
|
|
@@ -393,6 +393,10 @@ export declare class AgentVariantsOrchestrator {
|
|
|
393
393
|
/** Build the snapshot the chip cares about. Reads from SessionStore +
|
|
394
394
|
* per-resource state; safe to call at any time. */
|
|
395
395
|
buildActiveSnapshot(): ActiveSnapshot;
|
|
396
|
+
/** User reference files stored in the work item's context bundle (uploaded
|
|
397
|
+
* or copied local images). Surfaced on the snapshot so briefings can point
|
|
398
|
+
* workers at the files directly — one Read instead of a bundle walk. */
|
|
399
|
+
private static contextFilesOf;
|
|
396
400
|
getHostWork(sessionId: string): HostVariantWorkItemSnapshot[];
|
|
397
401
|
private getAssignedWorkspace;
|
|
398
402
|
private getVariantsTelemetryMode;
|
|
@@ -447,6 +451,7 @@ export declare class AgentVariantsOrchestrator {
|
|
|
447
451
|
instruction: string;
|
|
448
452
|
count?: number;
|
|
449
453
|
briefs?: StartVariantsBriefContent[];
|
|
454
|
+
runLabel?: string;
|
|
450
455
|
element?: StaticPreviewTargetElement;
|
|
451
456
|
relevantFiles?: string[];
|
|
452
457
|
requestId?: string;
|
|
@@ -555,6 +560,17 @@ export declare class AgentVariantsOrchestrator {
|
|
|
555
560
|
getProjectCwdInWorktree(worktreePath: string): Promise<string>;
|
|
556
561
|
/** Resolve the dev server port for a code-gen work item, if running. */
|
|
557
562
|
getDevServerPort(sessionId: string, workItemId: string): number | undefined;
|
|
563
|
+
/**
|
|
564
|
+
* Restores a Rivet-owned variant preview that the active-session idle timer
|
|
565
|
+
* reclaimed. Other missing-preview causes remain terminal so this path never
|
|
566
|
+
* attempts to restart user-owned or repeatedly failing servers.
|
|
567
|
+
*
|
|
568
|
+
* @effect Clears the idle marker, starts the worktree dev server, and emits
|
|
569
|
+
* preview-state snapshots.
|
|
570
|
+
* @deps Uses the live session resources, project context, and dev-server
|
|
571
|
+
* manager owned by this orchestrator.
|
|
572
|
+
*/
|
|
573
|
+
restoreVariantPreview(sessionId: string, workItemId: string): Promise<number | undefined>;
|
|
558
574
|
/**
|
|
559
575
|
* @effect Resolves the dev server port for a preview request and refreshes
|
|
560
576
|
* active-preview retention for that session while the port is still live.
|
|
@@ -625,7 +641,7 @@ export declare class AgentVariantsOrchestrator {
|
|
|
625
641
|
* bundle (whose on-disk path embeds the session id) before the session
|
|
626
642
|
* exists, then hand both in together. Defaults to a fresh id. */
|
|
627
643
|
sessionId?: string;
|
|
628
|
-
/** Agent-supplied
|
|
644
|
+
/** Agent-supplied short label for the run's intent (heuristic fallback
|
|
629
645
|
* when absent). Shared by every variant in the run. */
|
|
630
646
|
runLabel?: string;
|
|
631
647
|
/** When provided, the orchestrator leases all spawned variant work
|
|
@@ -655,6 +671,10 @@ export declare class AgentVariantsOrchestrator {
|
|
|
655
671
|
/** Known project files from the initiating selection. Workers inspect
|
|
656
672
|
* these first and expand only when dependencies require it. */
|
|
657
673
|
relevantFiles?: string[];
|
|
674
|
+
/** User-selected design fidelity (worker tier selector). New sessions
|
|
675
|
+
* stamp it onto every implementation item; accumulated batches inherit
|
|
676
|
+
* the existing session's fidelity. */
|
|
677
|
+
fidelity?: import('./contracts').WorkerFidelity;
|
|
658
678
|
}): Promise<{
|
|
659
679
|
sessionId: string;
|
|
660
680
|
variants: Array<{
|
|
@@ -720,6 +740,9 @@ export declare class AgentVariantsOrchestrator {
|
|
|
720
740
|
tokensIn?: number;
|
|
721
741
|
tokensOut?: number;
|
|
722
742
|
model?: string;
|
|
743
|
+
/** Worker cost in USD (executor-run workers bill outside any host
|
|
744
|
+
* session; this keeps them cost-accountable in telemetry). */
|
|
745
|
+
costUsd?: number;
|
|
723
746
|
title?: string;
|
|
724
747
|
description?: string;
|
|
725
748
|
}): Promise<ReportCompleteResult>;
|