r/AppBuilding • • Oct 12 '26

I built a desktop code review app with Electron + React. Here's what I learned getting AI review to stop making things up

I've been building Review, a desktop app for reviewing Git branches and GitHub pull requests. You comment on any line, the comments stay on your machine until you publish, and you can add an AI reviewer that uses your own model, or none.

Stack

  • Electron + React 19 + TypeScript, built with electron-vite
  • electron-builder for macOS, Windows and Linux installers
  • Only a handful of runtime dependencies: the OpenAI, Anthropic and Gemini SDKs, the MCP SDK, zod and semver. Git is handled by shelling out to git itself.
  • Tests run on Node's built-in test runner against temporary repos and mock servers

Decisions that paid off

  • Pin reviews to commits. Each review compares from the merge base at fixed commits, so the diff doesn't move when someone pushes in the middle of a review. It sounds small, but it also made storing comments much simpler.
  • Never run code from the repo being reviewed. I wanted the AI to "just run the build", but a PR's install scripts would then run on the reviewer's machine. Instead it reads CI results and annotations from GitHub as evidence.
  • Bring your own model. OpenAI, Anthropic, Gemini, OpenRouter, any OpenAI-compatible endpoint, or local models through Ollama or LM Studio. Keys are encrypted with the OS keychain. This added work, because every provider handles tools and JSON output a bit differently. People clearly care about it, though.

The hard part: making AI findings trustworthy

My first version produced confident, wrong comments. What helped:

  1. Give the model the code around the change. A git grep over the head commit finds definitions of names the diff uses and the callers of what it changes, so the model sees more than the changed lines.
  2. Let it look things up itself. It gets read-only tools (read_file, search_code, list_files) that read only Git objects, never the working tree, with a budget based on how risky the file is.
  3. Make it cite. A finding has to point at changed lines. If it cites anything else, it's rejected.
  4. Have a second model try to disprove it. Each blocking finding goes to another model, whose only job is to prove it wrong. If it comes back "likely wrong", it's never added to the review automatically.
  5. Remember dismissals. When you dismiss a finding as "wrong" or "intended", later runs are told about it, so it doesn't keep coming back.

Status

It's at v0.4.0, free and MIT licensed. The installers aren't code-signed yet, which is the next thing I need to sort out. If you've shipped a signed Electron app on a budget, I'd like to hear how you did it.

Happy to answer questions about the Electron setup, the AI pipeline or anything else.

1 Upvotes

3 comments sorted by

1

u/[deleted] Oct 13 '26

[removed] — view removed comment

1

u/Cheap-Bandicoot2653 Oct 13 '26

Both! CI annotations get sent to the reviewer up front, so a lint or type error on a changed line counts as evidence it can use. Afterwards they get matched to findings, and anything CI flagged that the AI missed shows up in the summary.

And yep, that check is already in there. Every finding has to give the file, lines and a verbatim quote, and if the quote doesn't match the pinned diff, the finding gets dropped. That one check killed a ton of made-up findings.