Skip to content

feat(skills): improve async-pr-review workflow and logging#21790

Merged
mattKorwel merged 17 commits intomainfrom
feat/update-async-pr-review
Mar 13, 2026
Merged

feat(skills): improve async-pr-review workflow and logging#21790
mattKorwel merged 17 commits intomainfrom
feat/update-async-pr-review

Conversation

@mattKorwel
Copy link
Collaborator

@mattKorwel mattKorwel commented Mar 10, 2026

What

This PR introduces the Async PR Review Skill (async-pr-review), a powerful new capability that allows the Gemini CLI to perform comprehensive, agentic code reviews in the background while you continue working.

Why

Reviewing pull requests is often a context-switching, time-consuming task. We wanted a way to offload the heavy lifting—fetching the PR, provisioning an isolated environment, running the build/tests, and conducting a deep AI-driven code review—without blocking your main terminal or requiring you to wait interactively.

This skill showcases an advanced "Agentic Asynchronous Pattern":

  1. Zero Context Pollution: It automatically provisions ephemeral git worktrees (.gemini/tmp/async-reviews/pr-<number>) so your main workspace and branches remain entirely untouched.
  2. Headless Inference: It utilizes gemini --approval-mode=yolo in a detached background script to perform actual LLM reasoning and code analysis asynchronously.
  3. Multi-Stage Evaluation: Instead of a monolithic check, it breaks the review down into granular, trackable stages (Setup, Build & Lint, Automated Tests, Manual Execution, Code Review).
  4. Reliable Notifications: When the background job finishes (or fails), it alerts you via terminal escape sequences and native macOS notifications (osascript), so you never miss a completed review.

How

The skill is composed of:

  1. async-review.sh: A background dispatcher that fetches the PR, creates the ephemeral worktree, and launches parallel sub-tasks (compilation, testing, and a headless Gemini review). It writes discrete .log and .exit files for each stage. It also includes a robust notify subsystem for macOS and terminal alerts.
  2. check-async-review.sh: A status checker that polls the ephemeral .exit files to report real-time progress (IN_PROGRESS vs COMPLETE).
  3. SKILL.md: The orchestrating prompt that teaches the interactive Gemini agent how to start reviews and how to synthesize the final .md logs into a cohesive recommendation for the user.

Testing

  • Tested manually by triggering the async-pr-review skill to evaluate active PRs in the background.
  • Verified isolation: Confirmed that the user's primary git worktree is unaffected during the review process.
  • Verified status polling: Executed check-async-review.sh during active runs to confirm it correctly parses .exit files to report IN_PROGRESS or COMPLETE.
  • Verified notifications: Confirmed native macOS popups appear reliably upon task completion and simulated failures.

Demo

Launch the skill by asking it to review a PR# in the background

Screenshot 2026-03-10 at 8 37 38 AM

After launching the async PR you can ask cli to check on the status at any time (it will also do this in the background for you)

async 1 async 2 async 3

@mattKorwel mattKorwel requested a review from a team as a code owner March 10, 2026 00:14
@gemini-code-assist
Copy link
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

Size Change: -4 B (0%)

Total Size: 26.5 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 26.1 MB -4 B (0%)
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

Copy link
Collaborator

@NTaylorMullen NTaylorMullen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remove the node/npx bits by default. Alternatively feel free to encourage the model to utilize those within a sandbox that has no network access if you need them

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 12, 2026
@mattKorwel mattKorwel added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit 8d0b2d7 Mar 13, 2026
27 checks passed
@mattKorwel mattKorwel deleted the feat/update-async-pr-review branch March 13, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants