@unifan/pi-review-zh 1.0.7 → 1.0.8
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/package.json +1 -1
- package/src/config.ts +0 -1
- package/src/directive.ts +15 -14
package/package.json
CHANGED
package/src/config.ts
CHANGED
package/src/directive.ts
CHANGED
|
@@ -380,28 +380,29 @@ export function buildWorkflowScript(input: {
|
|
|
380
380
|
if (gateModel && gateModel !== "inherit") {
|
|
381
381
|
lines.push(` model: ${JSON.stringify(gateModelWithThinking)},`);
|
|
382
382
|
}
|
|
383
|
-
if (gateThinking && gateThinking !== "off" && gateThinking !== "false") {
|
|
383
|
+
if (gateThinking && gateThinking !== "off" && gateThinking !== "false" && gateThinking !== "undefined") {
|
|
384
384
|
lines.push(` thinking: ${JSON.stringify(gateThinking)},`);
|
|
385
385
|
}
|
|
386
386
|
lines.push(` toolBudget: { soft: ${budgets.gateToolBudget.soft}, hard: ${budgets.gateToolBudget.hard} },`);
|
|
387
387
|
lines.push(` turnBudget: { maxTurns: ${budgets.gateTurnBudget.maxTurns}, graceTurns: ${budgets.gateTurnBudget.graceTurns} },`);
|
|
388
388
|
lines.push(" });");
|
|
389
389
|
lines.push("} catch (gateLaunchError) {");
|
|
390
|
-
lines.push("
|
|
391
|
-
lines.push(
|
|
392
|
-
lines.push(
|
|
393
|
-
lines.push(
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
lines.push(
|
|
398
|
-
lines.push(
|
|
399
|
-
lines.push("
|
|
390
|
+
lines.push(" try {");
|
|
391
|
+
lines.push(" gateRun = await runs.run('gate-fallback', {");
|
|
392
|
+
lines.push(` agent: ${JSON.stringify(LEAN_GATE_AGENT)},`);
|
|
393
|
+
lines.push(" task: gateTask,");
|
|
394
|
+
lines.push(` cwd: ${JSON.stringify(workspacePath)},`);
|
|
395
|
+
lines.push(` toolBudget: { soft: ${budgets.gateToolBudget.soft}, hard: ${budgets.gateToolBudget.hard} },`);
|
|
396
|
+
lines.push(` turnBudget: { maxTurns: ${budgets.gateTurnBudget.maxTurns}, graceTurns: ${budgets.gateTurnBudget.graceTurns} },`);
|
|
397
|
+
lines.push(" });");
|
|
398
|
+
lines.push(" } catch (fallbackError) {");
|
|
399
|
+
lines.push(" gateRun = { ok: false, error: String(fallbackError.message || fallbackError), output: '' };");
|
|
400
|
+
lines.push(" }");
|
|
400
401
|
lines.push("}");
|
|
401
402
|
lines.push("const gate = {");
|
|
402
|
-
lines.push(" ok: gateRun.ok,");
|
|
403
|
-
lines.push(" error: gateRun.error,");
|
|
404
|
-
lines.push(" output: gateRun.output,");
|
|
403
|
+
lines.push(" ok: gateRun ? gateRun.ok : false,");
|
|
404
|
+
lines.push(" error: gateRun ? gateRun.error : 'gate failed',");
|
|
405
|
+
lines.push(" output: gateRun ? gateRun.output : '',");
|
|
405
406
|
lines.push("};");
|
|
406
407
|
lines.push("");
|
|
407
408
|
}
|