diff --git a/docs/users/features/code-review.md b/docs/users/features/code-review.md index 068b815ce..33f054665 100644 --- a/docs/users/features/code-review.md +++ b/docs/users/features/code-review.md @@ -120,15 +120,15 @@ You can review PRs from other repositories by passing the full URL: This runs in **lightweight mode** — no worktree, no linter, no build/test, no autofix. The review is based on the diff text only (fetched via GitHub API). PR comments can still be posted if you have write access. -| Capability | Same-repo | Cross-repo | -| ---------------------------------------------- | --------- | ----------------------------- | -| LLM review (5 agents + verify + reverse audit) | ✅ | ✅ | -| Deterministic analysis (linter/typecheck) | ✅ | ❌ | -| Build & test | ✅ | ❌ | -| Cross-file impact analysis | ✅ | ❌ | -| Autofix | ✅ | ❌ | -| PR inline comments | ✅ | ✅ (if you have write access) | -| Incremental review cache | ✅ | ❌ | +| Capability | Same-repo | Cross-repo | +| ------------------------------------------------ | --------- | ----------------------------- | +| LLM review (Agents 1-4 + verify + reverse audit) | ✅ | ✅ | +| Agent 5: Build & test | ✅ | ❌ (no local codebase) | +| Deterministic analysis (linter/typecheck) | ✅ | ❌ | +| Cross-file impact analysis | ✅ | ❌ | +| Autofix | ✅ | ❌ | +| PR inline comments | ✅ | ✅ (if you have write access) | +| Incremental review cache | ✅ | ❌ | ## PR Inline Comments diff --git a/packages/core/src/skills/bundled/review/SKILL.md b/packages/core/src/skills/bundled/review/SKILL.md index 775eb1527..c3df389a6 100644 --- a/packages/core/src/skills/bundled/review/SKILL.md +++ b/packages/core/src/skills/bundled/review/SKILL.md @@ -33,7 +33,7 @@ Based on the remaining arguments: - **PR number or same-repo URL** (e.g., `123` or a URL whose owner/repo matches the current repo — cross-repo URLs are handled by the lightweight mode above): - **Create an ephemeral worktree** to avoid modifying the user's working tree. This eliminates all stash/checkout/restore complexity: - 1. **Clean up stale worktree** from a previously interrupted review (if any): if `.qwen/tmp/review-pr-` exists, remove it with `git worktree remove .qwen/tmp/review-pr- --force` and delete the stale ref `git branch -D qwen-review/pr-` if it exists. This ensures a fresh start. + 1. **Clean up stale worktree** from a previously interrupted review (if any): if `.qwen/tmp/review-pr-` exists, remove it with `git worktree remove .qwen/tmp/review-pr- --force` and delete the stale ref `git branch -D qwen-review/pr- 2>/dev/null || true`. This ensures a fresh start. 2. Fetch the PR branch into a unique local ref: `git fetch origin pull//head:qwen-review/pr-` (do NOT use `gh pr checkout` — it modifies the current working tree). If fetch fails (auth, network, PR doesn't exist), inform the user and stop. 3. Get the PR's remote branch name for later push: `gh pr view --json headRefName --jq '.headRefName'`. If this fails, inform the user and stop. 4. Create a temporary worktree: `git worktree add .qwen/tmp/review-pr- qwen-review/pr-`. If this fails, inform the user and stop. @@ -483,7 +483,7 @@ Remove all temp files (`/tmp/qwen-review-{target}-context.md`, `/tmp/qwen-review If a PR worktree was created in Step 1, remove it and its local ref: 1. `git worktree remove .qwen/tmp/review-pr- --force` (the `--force` flag handles cases where autofix left uncommitted changes) -2. `git branch -D qwen-review/pr-` (clean up the local ref created during fetch) +2. `git branch -D qwen-review/pr- 2>/dev/null || true` (clean up the local ref; ignore errors if already deleted) This step runs **after** Step 9 because Step 9 may still need the worktree for reading file contents when composing inline comments.