You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ai(claude[commands]) Add agent CLI fallback and rename Codex to GPT
why: The agent CLI (Cursor) can access Gemini and GPT models via
--model flag, providing a fallback when native gemini/codex binaries
are missing. Renaming "Codex" to "GPT" decouples the reviewer identity
from the specific CLI tool used to reach the model family.
what:
- Add Bash(agent:*) to allowed-tools in review.md
- Add agent detection to Phase 2 reviewer discovery
- Add fallback resolution table: native CLI → agent --model → unavailable
- Add agent -p -f fallback commands for Gemini and GPT reviewers
- Rename "Codex" reviewer slot to "GPT" throughout review.md and solve.md
Run code review using up to three AI models (Claude, Gemini, Codex) in parallel, then synthesize their findings into a unified report with consensus-weighted confidence.
8
+
Run code review using up to three AI models (Claude, Gemini, GPT) in parallel, then synthesize their findings into a unified report with consensus-weighted confidence.
9
9
10
10
---
11
11
@@ -35,21 +35,32 @@ Run code review using up to three AI models (Claude, Gemini, Codex) in parallel,
35
35
36
36
## Phase 2: Detect Available Reviewers
37
37
38
-
**Goal**: Check which AI CLI tools are installed locally.
38
+
**Goal**: Check which AI CLI tools are installed locally and resolve each reviewer slot.
39
39
40
40
Run these checks in parallel:
41
41
42
42
```bash
43
43
which gemini 2>/dev/null &&echo"gemini:available"||echo"gemini:missing"
44
44
which codex 2>/dev/null &&echo"codex:available"||echo"codex:missing"
45
+
which agent 2>/dev/null &&echo"agent:available"||echo"agent:missing"
45
46
```
46
47
47
-
Claude (this agent) is always available. Build a list of available reviewers:
48
-
-**Claude** — always available
49
-
-**Gemini** — available if `gemini` binary is found
50
-
-**Codex** — available if `codex` binary is found
48
+
### Reviewer resolution (priority order)
51
49
52
-
Report which reviewers will participate. If only Claude is available, proceed with Claude-only review and note the missing tools.
50
+
Each reviewer slot is resolved independently using a **native CLI first, `agent` fallback** strategy:
1. If the native CLI is found → use it (direct API, fewer layers)
60
+
2. Else if `agent` is found → use `agent` with the corresponding `--model` flag
61
+
3. Else → slot is unavailable, note in report
62
+
63
+
Report which reviewers will participate and which backend is used (native or agent fallback). If only Claude is available, proceed with Claude-only review and note the missing tools.
53
64
54
65
---
55
66
@@ -84,41 +95,64 @@ Launch a Task agent with `subagent_type: "general-purpose"` to perform Claude's
84
95
85
96
### Gemini Review (if available)
86
97
87
-
Run Gemini CLI in non-interactive mode. Execute via Bash:
98
+
Use the resolved backend from Phase 2. The review prompt is the same regardless of backend.
99
+
100
+
**Review prompt** (used by both backends):
101
+
> You are a code reviewer. Analyze the changes since the trunk in this branch, consider AGENTS.md.
102
+
>
103
+
> Run git diff origin/<trunk>...HEAD to see the changes. Read AGENTS.md or CLAUDE.md for project conventions.
104
+
>
105
+
> For each issue, report: severity (Critical/Important/Suggestion), file and line, description, and recommendation. Focus on bugs, logic errors, security issues, and convention violations.
106
+
107
+
**Native (`gemini` CLI)**:
88
108
89
109
```bash
90
-
gemini -p "You are a code reviewer. Analyze the changes since the trunk in this branch, consider AGENTS.md.
110
+
timeout 300 gemini -p "<review prompt>"
111
+
```
91
112
92
-
Run git diff origin/<trunk>...HEAD to see the changes. Read AGENTS.md or CLAUDE.md for project conventions.
113
+
**Fallback (`agent` CLI)**:
93
114
94
-
For each issue, report: severity (Critical/Important/Suggestion), file and line, description, and recommendation. Focus on bugs, logic errors, security issues, and convention violations."
**Important**: Use the actual trunk branch name detected in Phase 1 in the prompt. Capture the full stdout output.
98
120
99
-
### Codex Review (if available)
121
+
### GPT Review (if available)
122
+
123
+
Use the resolved backend from Phase 2. The review prompt is the same regardless of backend.
100
124
101
-
Run Codex CLI with full sandbox access. Execute via Bash:
125
+
**Review prompt** (used by both backends):
126
+
> You are a code reviewer. Analyze the changes since the trunk in this branch, consider AGENTS.md.
127
+
>
128
+
> Run git diff origin/<trunk>...HEAD to see the changes. Read AGENTS.md or CLAUDE.md for project conventions.
129
+
>
130
+
> For each issue, report: severity (Critical/Important/Suggestion), file and line, description, and recommendation. Focus on bugs, logic errors, security issues, and convention violations.
131
+
132
+
**Native (`codex` CLI)**:
102
133
103
134
```bash
104
-
codex \
135
+
timeout 300 codex \
105
136
--sandbox danger-full-access \
106
137
--ask-for-approval never \
107
138
-c model_reasoning_effort=medium \
108
-
exec"You are a code reviewer - Analyze the changes since the trunk in this branch, consider AGENTS.md.
139
+
exec"<review prompt>"
140
+
```
109
141
110
-
Run git diff origin/<trunk>...HEAD to see the changes. Read AGENTS.md or CLAUDE.md for project conventions.
142
+
**Fallback (`agent` CLI)**:
111
143
112
-
For each issue, report: severity (Critical/Important/Suggestion), file and line, description, and recommendation. Focus on bugs, logic errors, security issues, and convention violations."
0 commit comments