openairev 0.3.8 → 0.3.10

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": "openairev",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "Cross-model AI code reviewer — independent review for AI-assisted coding workflows",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli/init.js CHANGED
@@ -257,13 +257,15 @@ ${marker}
257
257
 
258
258
  This project uses OpenAIRev for independent AI code review. When the user asks to "review", "get a review", or "check my changes":
259
259
 
260
- 1. Call \`openairev_review\` (MCP tool) with \`executor: "claude_code"\` and \`diff_cmd\` scoped to the files you changed (e.g. \`"git diff HEAD -- src/auth.ts src/routes.ts"\`). It returns immediately.
261
- 2. Run \`openairev wait\` via Bash. It streams live progress and blocks until the verdict is ready — one command, that's it.
260
+ 1. Call \`openairev_review\` (MCP tool) with \`executor: "claude_code"\` and \`diff_cmd\` scoped to the files you changed (e.g. \`"git diff HEAD -- src/auth.ts src/routes.ts"\`). It returns immediately with a progress file path.
261
+ 2. Run \`openairev wait --file <progress_file_path>\` via Bash using the path from step 1. It streams live progress and blocks until the verdict is ready.
262
262
 
263
263
  **Rules — you MUST follow these:**
264
+ - ALWAYS pass \`--file\` to \`openairev wait\` with the exact path from the review response. Without it, wait may look in the wrong directory.
264
265
  - ALWAYS scope \`diff_cmd\` to your changed files. Never send the full repo diff — the reviewer will run out of budget.
265
- - NEVER use \`sleep\`, polling loops, or manually read progress.json. \`openairev wait\` handles everything.
266
+ - NEVER use \`sleep\`, polling loops, or manually read progress.json. \`openairev wait --file\` handles everything.
266
267
  - NEVER call \`openairev_status\`. Use \`openairev wait\` instead.
268
+ - NEVER re-call \`openairev_review\` if wait fails — the progress file may take a few seconds to appear. Just retry \`openairev wait --file\`.
267
269
  - If a review is stuck or you want to retry, call \`openairev_cancel\` to kill the running review, then start a new one.
268
270
  - You MAY launch the review + wait in a sub-agent and continue other work in parallel.
269
271
  - Treat review feedback as peer review — use your judgment, focus on \`critical_issues\` and \`repair_instructions\`.
@@ -313,13 +315,15 @@ ${marker}
313
315
 
314
316
  This project uses OpenAIRev for independent AI code review. When the user asks to "review", "get a review", or "check my changes":
315
317
 
316
- 1. Call \`openairev_review\` (MCP tool) with \`executor: "codex"\` and \`diff_cmd\` scoped to the files you changed (e.g. \`"git diff HEAD -- src/auth.ts src/routes.ts"\`). It returns immediately.
317
- 2. Run \`openairev wait\` via Bash. It streams live progress and blocks until the verdict is ready — one command, that's it.
318
+ 1. Call \`openairev_review\` (MCP tool) with \`executor: "codex"\` and \`diff_cmd\` scoped to the files you changed (e.g. \`"git diff HEAD -- src/auth.ts src/routes.ts"\`). It returns immediately with a progress file path.
319
+ 2. Run \`openairev wait --file <progress_file_path>\` via Bash using the path from step 1. It streams live progress and blocks until the verdict is ready.
318
320
 
319
321
  **Rules — you MUST follow these:**
322
+ - ALWAYS pass \`--file\` to \`openairev wait\` with the exact path from the review response. Without it, wait may look in the wrong directory.
320
323
  - ALWAYS scope \`diff_cmd\` to your changed files. Never send the full repo diff — the reviewer will run out of budget.
321
- - NEVER use \`sleep\`, polling loops, or manually read progress.json. \`openairev wait\` handles everything.
324
+ - NEVER use \`sleep\`, polling loops, or manually read progress.json. \`openairev wait --file\` handles everything.
322
325
  - NEVER call \`openairev_status\`. Use \`openairev wait\` instead.
326
+ - NEVER re-call \`openairev_review\` if wait fails — the progress file may take a few seconds to appear. Just retry \`openairev wait --file\`.
323
327
  - If a review is stuck or you want to retry, call \`openairev_cancel\` to kill the running review, then start a new one.
324
328
  - Treat review feedback as peer review — use your judgment, focus on \`critical_issues\` and \`repair_instructions\`.
325
329
  ${marker}
package/src/cli/wait.js CHANGED
@@ -5,6 +5,12 @@ import { getConfigDir } from '../config/config-loader.js';
5
5
  export async function waitCommand(options) {
6
6
  const progressFile = options.file || join(getConfigDir(), 'progress.json');
7
7
 
8
+ // Wait up to 30s for the progress file to appear (race with MCP server)
9
+ let waited = 0;
10
+ while (!existsSync(progressFile) && waited < 30_000) {
11
+ await sleep(1000);
12
+ waited += 1000;
13
+ }
8
14
  if (!existsSync(progressFile)) {
9
15
  console.log('No review in progress. Call openairev_review first.');
10
16
  process.exit(1);
@@ -32,6 +38,10 @@ export async function waitCommand(options) {
32
38
  });
33
39
  }
34
40
 
41
+ function sleep(ms) {
42
+ return new Promise((resolve) => setTimeout(resolve, ms));
43
+ }
44
+
35
45
  function readProgress(path) {
36
46
  try {
37
47
  return JSON.parse(readFileSync(path, 'utf-8'));
@@ -96,7 +96,7 @@ server.tool(
96
96
  return {
97
97
  content: [{
98
98
  type: 'text',
99
- text: `Review started. Reviewer: ${reviewerName}\nProgress file: ${PROGRESS_FILE}\n\nRun \`openairev wait\` from ${cwd} or read ${PROGRESS_FILE} directly to stream progress and get the verdict.`,
99
+ text: `Review started. Reviewer: ${reviewerName}\nProgress file: ${PROGRESS_FILE}\n\nRun \`openairev wait --file ${PROGRESS_FILE}\` via Bash to stream progress and get the verdict. The file may take a few seconds to appear — wait will handle this automatically. Do NOT re-call openairev_review or use sleep/polling.`,
100
100
  }],
101
101
  };
102
102
  }