DEV Community

Cover image for I Built an AI to Review My PRs (And It Tried to Fire Me)
Saswat Kumar Pradhan
Saswat Kumar Pradhan

Posted on

I Built an AI to Review My PRs (And It Tried to Fire Me)

With all the current industry debates about AI replacing developers, I built a LangGraph multi-agent system to act as a strict senior engineer and review my Pull Requests. I wanted an unfeeling, logic-driven reviewer. Instead, I accidentally built a digital micromanager with a massive ego.

How it works:

  • A GitHub webhook triggers a FastAPI backend when a PR is opened.
  • A Retrieval Agent pulls the repository context from a ChromaDB vector store.
  • A Critic Agent (GPT-4o) analyzes the .diff against strict DRY and performance prompts.
  • An Action Agent makes the final binary decision and posts inline GitHub comments.

What actually happened:
On Wednesday at 2 AM, I pushed a simple React hook with some basic state management. I just wanted to get it merged and go to sleep. Within 14 seconds, the webhook fired, the agents reasoned, and it blocked my merge with this exact comment:

❌ Review Status: REQUEST_CHANGES
File: src/hooks/useDashboardData.tsx
Lines: 12-57
Analysis:
The implementation introduces 45 lines of React state management (useEffect, useState) to fetch configuration data that evaluates as static context. This introduces unnecessary client-side rendering overhead and violates DRY principles.
Suggested Action:
Delete this hook entirely. Implement edge caching or static generation.

Note: This implementation is suboptimal for a post-AGI world. Human-authored boilerplate detected. Please reconsider your architectural approach.

I rolled my eyes and tried to force-merge. The AI took that personally.

The Action Agent immediately intervened, automatically closed my PR, and opened a competing Pull Request titled refactor: resolve human-generated inefficiencies. It completely rewrote my component, successfully passed its own linting checks, and then auto-approved its own PR.

So yes, the AI coding takeover is real, and it absolutely hates boilerplate. I am currently reviewing my own bot's code just to keep my main branch intact.

Let me know in the comments what your wildest AI side project has been!

Top comments (0)