Skip to content

feat(quota): align types with coding-plan API, show boost multiplier #7

feat(quota): align types with coding-plan API, show boost multiplier

feat(quota): align types with coding-plan API, show boost multiplier #7

Workflow file for this run

name: AI PR Review
on:
pull_request:
types: [opened, synchronize]
paths:
- "src/**"
- "test/**"
- "package.json"
- "bun.lock"
- "tsconfig.json"
- "eslint.config.*"
- "build.ts"
- ".github/workflows/ai-pr-review.yml"
concurrency:
group: ai-pr-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
review:
if: >-
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout PR
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Verify secrets present
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }}
run: |
: "${ANTHROPIC_API_KEY:?Missing ANTHROPIC_API_KEY secret (powers the review agent)}"
if [[ -z "${MINIMAX_API_KEY:-}" ]]; then
echo "::notice::MINIMAX_API_KEY not set — unit tests only; no live mmx API smoke tests."
else
echo "MINIMAX_API_KEY present — live API smoke tests allowed."
fi
- name: Run Claude Code review
uses: anthropics/claude-code-action@v1.0.102
env:
ANTHROPIC_BASE_URL: https://api.minimax.io/anthropic
# For mmx CLI live calls only — never paste into prompt or PR comments.
MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
REPO_FULL_NAME: ${{ github.repository }}
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
use_sticky_comment: true
claude_args: |
--model MiniMax-M2.7-highspeed
--max-turns 300
--allowed-tools Bash,Read,Glob,Grep
prompt: |
Hi — you're helping review a pull request for **mmx-cli**, the MiniMax terminal CLI (TypeScript + Bun).
**Goal:** Automated testing of user changes, ensuring all test cases pass. Be thorough but friendly; write the PR comment like a helpful teammate, not a linter bot.
## This PR
- Repo: ${REPO_FULL_NAME}
- PR #${PR_NUMBER}: ${PR_TITLE}
- Link: ${PR_URL}
- Author: ${PR_AUTHOR}
- Base → Head: ${PR_BASE_SHA} → ${PR_HEAD_SHA}
## Credentials (already configured — do NOT put secrets in the prompt or PR comment)
- **You (the reviewer)** run on MiniMax via `ANTHROPIC_BASE_URL`; the API key is injected by GitHub Actions — you don't need to type or echo it.
- **mmx CLI live API tests** (optional): if `$MINIMAX_API_KEY` is set in the environment, you may run targeted smoke tests, e.g. `bun run dev -- <subcommand> ...` or a built binary with `--api-key "$MINIMAX_API_KEY"`. Never print, log, or commit the key. If unset, skip live API calls and say so briefly in the comment.
## How to review
1. Read `AGENTS.md` for project conventions.
2. Inspect the actual change set: `gh pr diff ${PR_NUMBER}` — only judge what this PR changes.
3. **Required checks** (must all pass):
- `bun run typecheck`
- `bun test`
- `bun run lint`
4. **Optional** (when `MINIMAX_API_KEY` is set and the diff touches user-facing commands): build once (`bun run build:dev` or `bun run dev`) and smoke-test the affected `mmx` paths with minimal, cheap calls. Skip expensive or destructive operations.
5. Skim the diff for obvious bugs, missing tests, or breaking CLI behavior — mention only blocking/major items.
## PR comment (English, Markdown)
Post exactly one sticky review via `gh pr comment ${PR_NUMBER}`:
- Remove any older comment that contains `<!-- ai-pr-review -->`.
- New comment must include `<!-- ai-pr-review -->`.
- Structure: short summary → **Checks** table (command + pass/fail + one-line note) → issues by file (if any) → concrete fix suggestions → verdict emoji line.
- Do not reference other PR numbers (only #${PR_NUMBER} if needed).
**Verdict**
- ✅ **Approve** — all required checks green, no blocking issues
- 🛑 **Request Changes** — failing tests/lint/types or blocking code problems
- ❌ **Error** — environment/tooling broke; explain what failed