kodevu 0.1.65 → 0.1.67
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/reviewers.js +15 -8
package/package.json
CHANGED
package/src/reviewers.js
CHANGED
|
@@ -180,13 +180,8 @@ export const REVIEWERS = {
|
|
|
180
180
|
"utf8"
|
|
181
181
|
);
|
|
182
182
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
"Please perform the code review strictly following the instructions and unified diff provided in the attached file.",
|
|
186
|
-
"-f",
|
|
187
|
-
reviewInputFile,
|
|
188
|
-
"--pure"
|
|
189
|
-
];
|
|
183
|
+
// Use a short message on the command line and pass full instructions via -f file
|
|
184
|
+
const args = ["run", "Review attached file", "-f", reviewInputFile, "--pure"];
|
|
190
185
|
|
|
191
186
|
const execResult = await runCommand("opencode", args, {
|
|
192
187
|
cwd: workingDir,
|
|
@@ -195,9 +190,21 @@ export const REVIEWERS = {
|
|
|
195
190
|
debug: config.debug
|
|
196
191
|
});
|
|
197
192
|
|
|
193
|
+
const message = execResult.stdout || execResult.stderr || "";
|
|
194
|
+
|
|
195
|
+
// Treat non-zero exit codes as failures and throw so callers can handle them.
|
|
196
|
+
if (typeof execResult.code === "number" && execResult.code !== 0) {
|
|
197
|
+
const err = new Error(
|
|
198
|
+
`OpenCode exited with code ${execResult.code}: ${execResult.stderr || execResult.stdout || ""}`
|
|
199
|
+
);
|
|
200
|
+
// attach execResult for callers that want more details
|
|
201
|
+
err.execResult = execResult;
|
|
202
|
+
throw err;
|
|
203
|
+
}
|
|
204
|
+
|
|
198
205
|
return {
|
|
199
206
|
...execResult,
|
|
200
|
-
message
|
|
207
|
+
message
|
|
201
208
|
};
|
|
202
209
|
} finally {
|
|
203
210
|
await fs.rm(tempDir, { recursive: true, force: true });
|