fx-review-action

August 20, 2026 ยท View on GitHub

AI code review on every pull request, powered by fx, the tiny open coding agent from Vercel Labs.

Pick any model available through Vercel AI Gateway, including cheap ones. A review with the default model costs cents per PR. No subscription required, the whole pipeline is a few hundred lines you can read.

What it does

On each pull request, the action:

  1. Installs a pinned fx binary (about 6 MB, one curl).
  2. Fetches the PR diff and hands it to fx ask --json with a strict review prompt.
  3. Validates every finding against the diff. Comments pointing at lines or files not in the diff are dropped, so hallucinated line numbers never reach your PR.
  4. Posts a single GitHub review: a short summary plus inline comments, capped and sorted by severity.

If anything fails, the job succeeds silently by default. A review bot must never block your merge because a model had a bad day.

Usage

name: fx review
on:
  pull_request:
    types: [opened, synchronize]

permissions:
  contents: read
  pull-requests: write

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: tcarnemolla/fx-review-action@v1
        with:
          ai-gateway-api-key: ${{ secrets.AI_GATEWAY_API_KEY }}

That is the whole setup. Get an AI Gateway key from your Vercel dashboard and add it as a repository secret.

Inputs

InputDefaultNotes
ai-gateway-api-keyrequiredVercel AI Gateway key
modelzai/glm-5.2Any AI Gateway model id (fx models lists them)
fx-versionv0.0.3Pinned. fx is experimental; bump deliberately. latest works but may break.
max-comments10Cap on inline comments per review
max-steps30Cap on fx agent steps, bounds cost per PR
extra-instructionsemptyHouse rules appended to the prompt
fail-on-errorfalseFail the job if the review cannot be produced
github-tokengithub.tokenNeeds pull-requests: write

Choosing a model

The default is deliberately cheap. Review quality scales with the model: point model at a frontier model for important repos, keep the cheap default for high-volume ones. Mediocre comments are easy to ignore; the cap and the severity sort keep noise down either way.

Honest limitations

  • fx is experimental and changes frequently. This action pins a tested fx version and a scheduled canary opens an issue when the latest fx breaks the contract.
  • The review sees the diff plus whatever files fx reads from the checkout for context. It does not run your tests.
  • Diffs above ~300 KB are truncated file by file, and the review says so.
  • This is a review comment bot, not a gatekeeper. It posts COMMENT reviews, never REQUEST_CHANGES.

Why fx

The agent harness adds near-zero overhead to your CI minutes: a 6 MB static binary with instant cold start, no Node runtime to install for the agent itself. The interesting consequence is economic: with a small model, reviewing every PR of an active repo costs less than a coffee per month.

License

Apache-2.0