@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifan/pi-review-zh",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Pi AI 并发代码审查扩展(多专家子代理并发 + 门禁裁判系统,中文增强版)",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/config.ts CHANGED
@@ -31,7 +31,6 @@ export const DEFAULT_CONFIG: PiReviewConfig = {
31
31
  schemaVersion: 1,
32
32
  gate: {
33
33
  model: DEFAULT_GATE_MODEL,
34
- thinking: "low",
35
34
  enabled: true,
36
35
  threshold: 8,
37
36
  verdictPolicy: "strict",
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(" gateRun = await runs.run('gate-fallback', {");
391
- lines.push(` agent: ${JSON.stringify(LEAN_GATE_AGENT)},`);
392
- lines.push(" task: gateTask,");
393
- lines.push(` cwd: ${JSON.stringify(workspacePath)},`);
394
- if (gateThinking && gateThinking !== "off" && gateThinking !== "false") {
395
- lines.push(` thinking: ${JSON.stringify(gateThinking)},`);
396
- }
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(" });");
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
  }