@mjasnikovs/pi-task 0.13.9 → 0.13.10

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.
@@ -91,7 +91,15 @@ export async function runPhaseChild(deps, name, tools, prompt) {
91
91
  throw new Error(`${name} child failed: ${r.stderr || '(no stderr)'}`);
92
92
  }
93
93
  if (r.text.trim().length === 0) {
94
- throw new Error(`${name} child produced no output${r.stderr ? ' stderr: ' + r.stderr : ''}`);
94
+ // An empty completion (exit 0, no assistant text, no stderr) is almost
95
+ // always transient — a model/API error swallowed inside --mode json,
96
+ // not a repeatable mistake — so re-spawn rather than fail the phase.
97
+ // There's nothing to correct, so we carry no hint. Reuses the leak
98
+ // retry budget: MAX_LEAK_RETRIES+1 attempts, then surface the error.
99
+ if (attempt === MAX_LEAK_RETRIES) {
100
+ throw new Error(`${name} child produced no output${r.stderr ? ' — stderr: ' + r.stderr : ''}`);
101
+ }
102
+ continue;
95
103
  }
96
104
  if (r.leakedToolCall) {
97
105
  if (attempt === MAX_LEAK_RETRIES) {
@@ -154,7 +162,15 @@ export async function runPhaseWithLoopGuard(deps, name, tools, buildPrompt) {
154
162
  throw new Error(`${name} child failed: ${r.stderr || '(no stderr)'}`);
155
163
  }
156
164
  if (r.text.trim().length === 0) {
157
- throw new Error(`${name} child produced no output${r.stderr ? ' stderr: ' + r.stderr : ''}`);
165
+ // An empty completion (exit 0, no assistant text, no stderr) is almost
166
+ // always transient — a model/API error swallowed inside --mode json,
167
+ // not a repeatable mistake — so re-spawn rather than fail the phase.
168
+ // Nothing to correct, so leave nextHint as-is. Reuses the strike
169
+ // budget shared with loop/leak restarts: MAX_LOOP_RESTARTS+1 attempts.
170
+ if (strike === MAX_LOOP_RESTARTS) {
171
+ throw new Error(`${name} child produced no output${r.stderr ? ' — stderr: ' + r.stderr : ''}`);
172
+ }
173
+ continue;
158
174
  }
159
175
  if (r.leakedToolCall) {
160
176
  if (strike === MAX_LOOP_RESTARTS) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjasnikovs/pi-task",
3
- "version": "0.13.9",
3
+ "version": "0.13.10",
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",