@unifan/pi-review-zh 1.0.7 → 1.0.9
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 +17 -14
package/package.json
CHANGED
package/src/config.ts
CHANGED
package/src/directive.ts
CHANGED
|
@@ -237,6 +237,8 @@ export function buildWorkflowScript(input: {
|
|
|
237
237
|
const READ_ONLY_PREFIX =
|
|
238
238
|
"只读任务(READ-ONLY)——仅执行审查分析与基准测试。严禁修改源码文件。仅返回审查发现。所有分析总结、问题描述与建议必须使用纯正中文。";
|
|
239
239
|
|
|
240
|
+
const lines: string[] = [];
|
|
241
|
+
lines.push("");
|
|
240
242
|
lines.push("let reviewers;");
|
|
241
243
|
lines.push("try {");
|
|
242
244
|
lines.push(" reviewers = await runs.all([");
|
|
@@ -380,28 +382,29 @@ export function buildWorkflowScript(input: {
|
|
|
380
382
|
if (gateModel && gateModel !== "inherit") {
|
|
381
383
|
lines.push(` model: ${JSON.stringify(gateModelWithThinking)},`);
|
|
382
384
|
}
|
|
383
|
-
if (gateThinking && gateThinking !== "off" && gateThinking !== "false") {
|
|
385
|
+
if (gateThinking && gateThinking !== "off" && gateThinking !== "false" && gateThinking !== "undefined") {
|
|
384
386
|
lines.push(` thinking: ${JSON.stringify(gateThinking)},`);
|
|
385
387
|
}
|
|
386
388
|
lines.push(` toolBudget: { soft: ${budgets.gateToolBudget.soft}, hard: ${budgets.gateToolBudget.hard} },`);
|
|
387
389
|
lines.push(` turnBudget: { maxTurns: ${budgets.gateTurnBudget.maxTurns}, graceTurns: ${budgets.gateTurnBudget.graceTurns} },`);
|
|
388
390
|
lines.push(" });");
|
|
389
391
|
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("
|
|
392
|
+
lines.push(" try {");
|
|
393
|
+
lines.push(" gateRun = await runs.run('gate-fallback', {");
|
|
394
|
+
lines.push(` agent: ${JSON.stringify(LEAN_GATE_AGENT)},`);
|
|
395
|
+
lines.push(" task: gateTask,");
|
|
396
|
+
lines.push(` cwd: ${JSON.stringify(workspacePath)},`);
|
|
397
|
+
lines.push(` toolBudget: { soft: ${budgets.gateToolBudget.soft}, hard: ${budgets.gateToolBudget.hard} },`);
|
|
398
|
+
lines.push(` turnBudget: { maxTurns: ${budgets.gateTurnBudget.maxTurns}, graceTurns: ${budgets.gateTurnBudget.graceTurns} },`);
|
|
399
|
+
lines.push(" });");
|
|
400
|
+
lines.push(" } catch (fallbackError) {");
|
|
401
|
+
lines.push(" gateRun = { ok: false, error: String(fallbackError.message || fallbackError), output: '' };");
|
|
402
|
+
lines.push(" }");
|
|
400
403
|
lines.push("}");
|
|
401
404
|
lines.push("const gate = {");
|
|
402
|
-
lines.push(" ok: gateRun.ok,");
|
|
403
|
-
lines.push(" error: gateRun.error,");
|
|
404
|
-
lines.push(" output: gateRun.output,");
|
|
405
|
+
lines.push(" ok: gateRun ? gateRun.ok : false,");
|
|
406
|
+
lines.push(" error: gateRun ? gateRun.error : 'gate failed',");
|
|
407
|
+
lines.push(" output: gateRun ? gateRun.output : '',");
|
|
405
408
|
lines.push("};");
|
|
406
409
|
lines.push("");
|
|
407
410
|
}
|