Dev.to AI 🤖 Ai 👁 0 📖 2 min read

I made two free AI models review each other's code in one Switch room.

For the Flip the Switch hackathon I built Code Review Duel. One AI code reviewer can be confidently wrong, and you often can't tell. So I put two reviewers, on two different free models, into one Switch room. They review

For the Flip the Switch hackathon I built Code Review Duel. One AI code reviewer can be confidently wrong, and you often can't tell. So I put two reviewers, on two different free models, into one Switch room. They review the same code, check each other, and then ask me, the human, to pick the better review.

Demo: https://youtu.be/Dyu2Fs-55sg
Repo: https://github.com/Zoymusk/code-review-duel

The stack (all free)

  • OpenCode with two free models: DeepSeek (reviewer-a) and GLM (reviewer-b).
  • Switch Console to run the agents on my own laptop.
  • Mattermost, the chat app built into Switch Console.

I have no paid AI subscriptions, so no API keys and no credit card were involved. Anyone can run it.

How it works

  1. I post a code snippet in the room and tag both reviewers.
  2. Reviewer A posts its review and hands over to reviewer B by name.
  3. Reviewer B posts its own review and asks A if it agrees.
  4. A and B each answer with one line and a reason.
  5. They ask me to reply A or B. Both acknowledge my pick and stop.

Why Switch

Both agents and I work in one room, so they read the same history and talk to each other by mentioning names. My pick is just another message in the thread. Without Switch I'd have needed glue code to connect two agents and a person.

What went wrong

  • My first room had no chat channel, so I couldn't type in it. switch-buddy had made it agent-only, and I recreated it on Mattermost.
  • Reviewer B kept waiting for reviewer A and then sat idle, because nothing woke it up. The fix was making A end its review with "@reviewer-b your turn."

What I found

My first test was int x = 5 / 0; in Java. The models disagreed: A said compile error (wrong), B said runtime exception (right). I wanted to build around that.

Then reality set in. Model answers change between runs. Later A got the same snippet right, and on longer code (a shopping cart and a library class with planted bugs) both models found almost the same bugs. B also reads A's review before writing its own, so the reviews overlap. I tested this alone, not with a team. So it's a cross-check and a visible place for disagreement, not two fully independent opinions.

What I'd do next

Make reviewer B review the code first without seeing A's review, then compare. That would make the cross-check much stronger.

Try it

The repo has one template file and a README with setup steps: install OpenCode, install Switch Console, import the template, and post a snippet. Thanks to the Switch and WeMakeDevs teams for the hackathon.

HowISwitch

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.