@_mustachio/ai-review-agent 1.0.0 → 1.0.2

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/dist/index.js CHANGED
@@ -26125,11 +26125,24 @@ function runReview(prompt, id, { log = console.log } = {}) {
26125
26125
  fs.writeFileSync(tmpFile, prompt, 'utf-8');
26126
26126
 
26127
26127
  try {
26128
- const stdout = execSync(
26129
- `cat "${tmpFile}" | opencode run --format json --title "PR Review #${id}"`,
26130
- { encoding: 'utf-8', maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'] }
26131
- );
26128
+ let stderr = '';
26129
+ let stdout;
26130
+ try {
26131
+ stdout = execSync(
26132
+ `opencode run --format json --title "PR Review #${id}" "$(cat "${tmpFile}")"`,
26133
+ { encoding: 'utf-8', maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'], shell: '/bin/bash' }
26134
+ );
26135
+ } catch (execErr) {
26136
+ stderr = execErr.stderr || '';
26137
+ stdout = execErr.stdout || '';
26138
+ log(`OpenCode stderr: ${stderr}`);
26139
+ if (!stdout) {
26140
+ log(`OpenCode exited with code ${execErr.status}, no stdout`);
26141
+ return DEFAULT_REVIEW;
26142
+ }
26143
+ }
26132
26144
 
26145
+ log(`OpenCode stdout (first 500 chars): ${stdout.slice(0, 500)}`);
26133
26146
  return parseReviewOutput(stdout, { log });
26134
26147
  } finally {
26135
26148
  try { fs.unlinkSync(tmpFile); } catch {}