@mjasnikovs/pi-task 0.4.1 → 0.4.3
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.
|
@@ -59,7 +59,15 @@ export function runChild(spawn, invocation, cwd, signal, opts) {
|
|
|
59
59
|
drainJsonEvents(lineBuffer + '\n', opts);
|
|
60
60
|
lineBuffer = '';
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
let text;
|
|
63
|
+
if (isJsonEvents) {
|
|
64
|
+
const extracted = (finalText || textDeltaAccum).trim();
|
|
65
|
+
// When json-events mode extracts no text but stderr has content,
|
|
66
|
+
// surface the stderr as the text so the caller sees the real error
|
|
67
|
+
// instead of the generic "X child produced no output". Without this,
|
|
68
|
+
// a model API crash that exits 0 with an error on stderr is invisible.
|
|
69
|
+
text = extracted.length > 0 ? extracted : (stderr.trim() || undefined);
|
|
70
|
+
}
|
|
63
71
|
resolve({ stdout, stderr, exitCode: code ?? 0, aborted, text });
|
|
64
72
|
});
|
|
65
73
|
proc.on('error', () => {
|
package/dist/task/phases.js
CHANGED
|
@@ -231,7 +231,7 @@ export async function phaseResearch(deps, refined, researchDeps = {}) {
|
|
|
231
231
|
throw new Error(`Research ${name} worker failed (exit ${result.exitCode}): ${result.stderr.slice(-500)}`);
|
|
232
232
|
}
|
|
233
233
|
if (result.text.trim().length === 0) {
|
|
234
|
-
throw new Error(`Research ${name} worker produced no output`);
|
|
234
|
+
throw new Error(`Research ${name} worker produced no output (exit ${result.exitCode}, ${result.waitMs}ms wait + ${result.workMs}ms work${result.stderr ? ': ' + result.stderr.slice(-300) : ''})`);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
return `FILES\n${files.text}\n\nAPIS\n${apis.text}\n\nCONTEXT\n${context.text}\n\nTOOLING\n${tooling.text}`;
|
|
@@ -19,7 +19,7 @@ export async function runWorker(input) {
|
|
|
19
19
|
const waitMs = tFirstByte === null ? tEnd - tStart : tFirstByte - tStart;
|
|
20
20
|
const workMs = tFirstByte === null ? 0 : tEnd - tFirstByte;
|
|
21
21
|
return {
|
|
22
|
-
text: result.text
|
|
22
|
+
text: result.text || '',
|
|
23
23
|
exitCode: result.exitCode,
|
|
24
24
|
stderr: result.stderr.trim(),
|
|
25
25
|
aborted: result.aborted,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mjasnikovs/pi-task",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Deterministic spec-orchestration for local models, with a bundled real-time remote web view and web/docs/fetch/worker subagent tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|