Commit 7749712
ci(codex): post review as inline diff comments (#78)
## Summary
Phase 2 of the codex-reviewer parity work. Stacked on #76.
Until now Codex was posting a single review with all findings
concatenated into the body. Claude (via the subagent architecture)
anchors each finding to the specific diff line in the **Files Changed**
tab. This change brings Codex to format parity:
- **Prompt** now asks Codex for a single JSON object with `event`,
`body`, and an array of `comments` (`path` / `line` / `side` / `body`
per finding). Schema is documented inline so the model has no ambiguity.
- **Submit step** parses the JSON with `jq`, builds the Reviews API
payload in `jq` (so review text never round-trips through shell
quoting), and posts via `gh api --input <file>`. We deliberately do NOT
use `-f event=...` flags because `gh api --input` routes those into the
query string, not the body — codex itself flagged that exact mistake in
PR #61's review of the slash-command migration.
- **Defensive cleanup**: strip leading/trailing ` ```json ` fences
before parsing (codex sometimes wraps JSON in a fence despite the
explicit instruction); validate the event value and fail loudly if it's
outside `APPROVE` / `COMMENT` / `REQUEST_CHANGES`.
Once this lands, Codex reviews show up inline in the Files Changed tab
next to the relevant lines, exactly like Claude's.
## Test plan
- [ ] CI on this PR posts a review with at least one inline comment
anchored to a specific line in `.github/workflows/codex-code-review.yml`
(or summary-only if Codex thinks the change is clean)
- [ ] No 422 from the Reviews API (would surface as a workflow failure)
## Stacking note
Base branch is `ci/codex-app-token` (PR #76). Once #76 merges, this PR's
base auto-rebases to `main` and CI re-runs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d28dce9 commit 7749712
1 file changed
Lines changed: 88 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
| 180 | + | |
180 | 181 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 182 | + | |
| 183 | + | |
186 | 184 | | |
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
190 | 188 | | |
| 189 | + | |
191 | 190 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
199 | 226 | | |
200 | 227 | | |
201 | 228 | | |
| |||
436 | 463 | | |
437 | 464 | | |
438 | 465 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
448 | 485 | | |
449 | | - | |
450 | 486 | | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
455 | 515 | | |
456 | 516 | | |
457 | 517 | | |
458 | | - | |
459 | | - | |
| 518 | + | |
460 | 519 | | |
461 | 520 | | |
462 | 521 | | |
| |||
0 commit comments