Skip to content

#217 Make PR reviewer provider-switchable (OpenRouter/Qwen default)#218

Merged
hubertgajewski merged 4 commits into
mainfrom
feature/217
Apr 14, 2026
Merged

#217 Make PR reviewer provider-switchable (OpenRouter/Qwen default)#218
hubertgajewski merged 4 commits into
mainfrom
feature/217

Conversation

@hubertgajewski
Copy link
Copy Markdown
Owner

@hubertgajewski hubertgajewski commented Apr 14, 2026

Summary

Closes #217. Replaces the hardcoded Claude Sonnet reviewer with a provider-switchable setup. Defaults to Qwen3.6 Plus via OpenRouter (Anthropic-compatible /v1/messages endpoint); flip AI_REVIEW_PROVIDER=anthropic in repo Variables to revert.

  • New repo variables: AI_REVIEW_PROVIDER (openrouter default | anthropic), AI_REVIEW_MODEL (optional model override per provider).
  • Renames the enable-gate CLAUDE_REVIEWAI_REVIEW so the name is vendor-neutral.
  • Resolver step in claude-code-review.yml validates that the required secret is non-empty before the action runs — prevents the Anthropic key from being sent to openrouter.ai if OPENROUTER_API_KEY is missing.
  • New secret requirement: OPENROUTER_API_KEY (documented in .env.example and README.md).

Changes

  • .vars.example — rename CLAUDE_REVIEWAI_REVIEW; add AI_REVIEW_PROVIDER, AI_REVIEW_MODEL.
  • .env.example — add OPENROUTER_API_KEY placeholder.
  • .github/workflows/claude-code-review.yml — resolver step branches on provider, sets ANTHROPIC_BASE_URL, picks the right secret, and passes the right --model.
  • README.md — rename gate in catalog + table, add rows for the two new variables, document OPENROUTER_API_KEY.

Rollout prerequisites (done before merge)

  • OPENROUTER_API_KEY secret created
  • AI_REVIEW=true repo variable created; CLAUDE_REVIEW deleted
  • AI_REVIEW_PROVIDER=openrouter and AI_REVIEW_MODEL=qwen/qwen3.6-plus set

Test plan

Design superseded by #220. The qwen/qwen3.6-plus path failed pre-flight (Claude Code SDK client-side slug validation) on the first live run. Follow-up #220 / #221 / #222 replaced AI_REVIEW_PROVIDER + AI_REVIEW_MODEL with direct ANTHROPIC_BASE_URL + ANTHROPIC_DEFAULT_{SONNET,HAIKU}_MODEL pass-through. Most of this test plan is moot — the vars it references no longer exist.

Assumptions flagged for verification

  1. anthropics/claude-code-action@v1 forwards the ANTHROPIC_BASE_URL env var into the Claude Code runtime.
  2. OpenRouter's /v1/messages endpoint accepts qwen/qwen3.6-plus (Anthropic-compatible routing).
  3. Qwen via OpenRouter supports Anthropic-style tool use (required for mcp__github_inline_comment__create_inline_comment and Bash(gh pr review:*)).

If any of these fail during the Test plan checks, the fallback is a custom Python script (scripts/pr-review.py) following the self-healing.py dispatch pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci] Make PR reviewer provider-switchable (OpenRouter/Qwen default, Anthropic fallback)

1 participant