@melaya/runner 1.0.29 → 1.0.30
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/connection.js +46 -55
- package/dist/pythonEnv.js +1 -0
- package/package.json +1 -1
package/dist/connection.js
CHANGED
|
@@ -117,38 +117,35 @@ export async function connect(opts) {
|
|
|
117
117
|
// Surface bootstrap progress to the FE so the launching
|
|
118
118
|
// animation reflects the real state instead of staying on a
|
|
119
119
|
// generic spinner during the 1-2 min first-time install.
|
|
120
|
+
// FLAT shape — server reads payload.run_id at top level
|
|
121
|
+
// (runnerNamespace.ts:202). My earlier nested {runId, payload:{}}
|
|
122
|
+
// shape was silently dropped by `if (!runId) return`.
|
|
120
123
|
socket.emit("runner:event", {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
label: `venv: ${msg}`,
|
|
129
|
-
status: "started",
|
|
130
|
-
},
|
|
124
|
+
run_id: payload.runId,
|
|
125
|
+
event_type: "pipeline_phase",
|
|
126
|
+
project: payload.project,
|
|
127
|
+
step: 1,
|
|
128
|
+
total: 5,
|
|
129
|
+
label: `venv: ${msg}`,
|
|
130
|
+
status: "started",
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
133
|
if (!envResult.ok) {
|
|
134
134
|
console.log(chalk.red(` ✗ python venv bootstrap failed: ${envResult.reason}`));
|
|
135
135
|
socket.emit("runner:event", {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
metadata: {},
|
|
150
|
-
timestamp: new Date().toISOString(),
|
|
151
|
-
},
|
|
136
|
+
run_id: payload.runId,
|
|
137
|
+
event_type: "agent_message",
|
|
138
|
+
project: payload.project,
|
|
139
|
+
replyId: `venv-${payload.runId}`,
|
|
140
|
+
replyName: "Runner",
|
|
141
|
+
replyRole: "system",
|
|
142
|
+
msg: {
|
|
143
|
+
id: `venv-${payload.runId}`,
|
|
144
|
+
name: "Runner",
|
|
145
|
+
role: "system",
|
|
146
|
+
content: [{ type: "text", text: `Python env bootstrap failed: ${envResult.reason}` }],
|
|
147
|
+
metadata: {},
|
|
148
|
+
timestamp: new Date().toISOString(),
|
|
152
149
|
},
|
|
153
150
|
});
|
|
154
151
|
socket.emit("runner:runComplete", { runId: payload.runId, status: "failed" });
|
|
@@ -178,20 +175,17 @@ export async function connect(opts) {
|
|
|
178
175
|
const { preflightModel } = await import("./modelLoader.js");
|
|
179
176
|
const onPreflightProgress = (msg) => {
|
|
180
177
|
console.log(chalk.gray(` [model] ${msg}`));
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
//
|
|
178
|
+
// Flat shape — server reads payload.run_id at top level
|
|
179
|
+
// (runnerNamespace.ts:202). Earlier nested {runId, payload:{}}
|
|
180
|
+
// was silently dropped by `if (!runId) return`.
|
|
184
181
|
socket.emit("runner:event", {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
label: msg,
|
|
193
|
-
status: "started",
|
|
194
|
-
},
|
|
182
|
+
run_id: payload.runId,
|
|
183
|
+
event_type: "pipeline_phase",
|
|
184
|
+
project: payload.project,
|
|
185
|
+
step: 1,
|
|
186
|
+
total: 5,
|
|
187
|
+
label: msg,
|
|
188
|
+
status: "started",
|
|
195
189
|
});
|
|
196
190
|
};
|
|
197
191
|
const preflight = await preflightModel(payload.configJson, onPreflightProgress);
|
|
@@ -199,22 +193,19 @@ export async function connect(opts) {
|
|
|
199
193
|
const detail = `${preflight.reason ?? "unknown"}${preflight.hint ? ` — ${preflight.hint}` : ""}`;
|
|
200
194
|
console.log(chalk.red(` ✗ model preflight failed: ${detail}`));
|
|
201
195
|
socket.emit("runner:event", {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
metadata: {},
|
|
216
|
-
timestamp: new Date().toISOString(),
|
|
217
|
-
},
|
|
196
|
+
run_id: payload.runId,
|
|
197
|
+
event_type: "agent_message",
|
|
198
|
+
project: payload.project,
|
|
199
|
+
replyId: `preflight-${payload.runId}`,
|
|
200
|
+
replyName: "Runner",
|
|
201
|
+
replyRole: "system",
|
|
202
|
+
msg: {
|
|
203
|
+
id: `preflight-${payload.runId}`,
|
|
204
|
+
name: "Runner",
|
|
205
|
+
role: "system",
|
|
206
|
+
content: [{ type: "text", text: `Model preflight failed: ${detail}` }],
|
|
207
|
+
metadata: {},
|
|
208
|
+
timestamp: new Date().toISOString(),
|
|
218
209
|
},
|
|
219
210
|
});
|
|
220
211
|
socket.emit("runner:runComplete", { runId: payload.runId, status: "failed" });
|
package/dist/pythonEnv.js
CHANGED