kodevu 0.1.56 → 0.1.58

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": "kodevu",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Poll SVN revisions or Git commits, send each change diff to a reviewer CLI, and write configurable review reports.",
package/src/config.js CHANGED
@@ -17,7 +17,7 @@ const defaultConfig = {
17
17
  lang: "auto",
18
18
  outputDir: defaultStorageDir,
19
19
  logsDir: path.join(defaultStorageDir, "logs"),
20
- commandTimeoutMs: 600000,
20
+ commandTimeoutMs: 120000,
21
21
  prompt: "",
22
22
  maxRevisionsPerRun: 5,
23
23
  outputFormats: ["markdown"],
package/src/logger.js CHANGED
@@ -90,7 +90,7 @@ class Logger {
90
90
  fs.mkdirSync(config.logsDir, { recursive: true });
91
91
  }
92
92
  const date = formatDate(new Date()).split(" ")[0];
93
- this.logFile = path.join(config.logsDir, `run-${date}-${this.sessionId}.log`);
93
+ this.logFile = path.join(config.logsDir, `run-${date}.log`);
94
94
 
95
95
  // Simple rotation: Clean up logs older than 7 days
96
96
  this._cleanupOldLogs(config.logsDir);
@@ -105,7 +105,8 @@ async function reviewChange(config, backend, targetInfo, changeId, progress) {
105
105
  reviewer: reviewerName,
106
106
  console: false
107
107
  });
108
- // If it's the last one, it will throw below or break loop anyway
108
+ // Store the result so the final throw can include stderr/exit code details
109
+ reviewerResult = err?.result ?? null;
109
110
  }
110
111
 
111
112
  if (reviewerName !== reviewersToTry[reviewersToTry.length - 1]) {
@@ -120,9 +121,23 @@ async function reviewChange(config, backend, targetInfo, changeId, progress) {
120
121
  }
121
122
 
122
123
  if (!reviewerResult || reviewerResult.code !== 0 || reviewerResult.timedOut) {
123
- throw new Error(
124
- `${reviewer?.displayName || config.reviewer} failed for ${details.displayId}`
125
- );
124
+ const displayName = reviewer?.displayName || config.reviewer;
125
+ const reasonParts = [`${displayName} failed for ${details.displayId}`];
126
+
127
+ if (reviewerResult?.timedOut) {
128
+ reasonParts.push("(timed out)");
129
+ } else if (reviewerResult?.code != null && reviewerResult.code !== 0) {
130
+ reasonParts.push(`(exit code: ${reviewerResult.code})`);
131
+ } else if (!reviewerResult) {
132
+ reasonParts.push("(reviewer produced no result)");
133
+ }
134
+
135
+ const detail = (reviewerResult?.stderr || reviewerResult?.stdout || "").trim();
136
+ if (detail) {
137
+ reasonParts.push(`\n${detail}`);
138
+ }
139
+
140
+ throw new Error(reasonParts.join(" "));
126
141
  }
127
142
 
128
143
  progress?.update(0.82, "writing report");