feat: add Copilot engine support via REVIEW_ENGINE toggle

Merged
DO
6mo ago
+316-191

Summary

Add a second LLM engine option (GitHub Copilot) alongside the existing Claude engine, toggled via the REVIEW_ENGINE repo variable.

Key changes

  • scripts/engine.sh — New LLM abstraction layer with run_triage() and run_agentic() functions that dispatch to claude or copilot CLI based on $REVIEW_ENGINE
  • scripts/review-one-pr.sh — Refactored to source engine.sh; engine-agnostic variable names (DELEGATION_ORGS, AI_DELEGATION_ENABLED, deep/audit tiers)
  • All prompts — Engine-agnostic tier names, $ENGINE_LABEL footers, removed hardcoded model names
  • Workflow — Conditional CLI install, REVIEW_ENGINE/COPILOT_GITHUB_TOKEN vars, DELEGATION_ORGS with CLAUDE_ORGS backward compat fallback
  • Docs — Updated AGENT.md and README.md with both engine options

Model mapping

TierClaudeCopilot
TriageHaiku 4.5GPT-5-mini
Deep reviewSonnet 4.6GPT-5.2
Security auditOpus 4.6GPT-5.4
Action/singleSonnet/OpusGPT-5.2/5.4

Usage

# Switch to Copilot engine:
gh variable set REVIEW_ENGINE --body copilot --repo don-petry/self
gh secret set COPILOT_GITHUB_TOKEN --repo don-petry/self

# Switch back to Claude (or leave unset — it's the default):
gh variable set REVIEW_ENGINE --body claude --repo don-petry/self

Backward compatibility

  • Existing Claude setups work without changes (REVIEW_ENGINE defaults to claude)
  • CLAUDE_ORGS is still respected as a fallback for DELEGATION_ORGS
  • JSON field names in prompt output schemas (escalate_to_opus, sonnet_findings_*) kept as-is to avoid breaking the parsing logic