integrations/github.md +78 −14
11# Use Codex in GitHub# Codex code review in GitHub
2 2
33Use Codex to review pull requests without leaving GitHub. Add a pull request comment with `@codex review`, and Codex replies with a standard GitHub code review.Use Codex code review to get another high-signal review pass on GitHub pull
4requests. Codex reviews the pull request diff, follows your repository guidance,
5and posts a standard GitHub code review focused on serious issues.
4 6
57## Set up code review<YouTubeEmbed
8 title="Codex code review walkthrough"
9 videoId="HwbSWVg5Ln4"
10 class="max-w-md mr-auto"
11/>
12<br />
13
14## Before you start
15
16Make sure you have:
17
18- [Codex cloud](https://developers.openai.com/codex/cloud) set up for the repository you want to review.
19- Access to [Codex code review settings](https://chatgpt.com/codex/settings/code-review).
20- An `AGENTS.md` file if you want Codex to follow repository-specific review guidance.
21
22## Set up Codex code review
6 23
71. Set up [Codex cloud](https://developers.openai.com/codex/cloud).241. Set up [Codex cloud](https://developers.openai.com/codex/cloud).
8252. Go to [Codex settings](https://chatgpt.com/codex/settings/code-review) and turn on **Code review** for your repository.2. Go to [Codex settings](https://chatgpt.com/codex/settings/code-review).
263. Turn on **Code review** for your repository.
9 27
1028<div class="not-prose max-w-3xl mr-auto">
29 <img src="https://developers.openai.com/images/codex/code-review/code-review-settings.png"
30 alt="Codex settings showing the Code review toggle"
31 class="block h-auto w-full mx-0!"
32 />
33</div>
34<br />
11 35
1236## Request a review## Request a Codex review
13 37
141. In a pull request comment, mention `@codex review`.381. In a pull request comment, mention `@codex review`.
152. Wait for Codex to react (👀) and post a review.392. Wait for Codex to react (👀) and post a review.
16 40
1741<div class="not-prose max-w-xl mr-auto">
1842 <img src="https://developers.openai.com/images/codex/code-review/review-trigger.png"
1943Codex posts a review on the pull request, just like a teammate would. alt="A pull request comment with @codex review"
2044 class="block h-auto w-full mx-0!"
2145 />
46</div>
47<br />
48
49Codex posts a review on the pull request, just like a teammate would. In
50GitHub, Codex flags only P0 and P1 issues so review comments stay focused on
51high-priority risks.
52
53<div class="not-prose max-w-3xl mr-auto">
54 <img src="https://developers.openai.com/images/codex/code-review/review-example.png"
55 alt="Example Codex code review on a pull request"
56 class="block h-auto w-full mx-0!"
57 />
58</div>
59<br />
22 60
23## Enable automatic reviews61## Enable automatic reviews
24 62
2563If you want Codex to review every pull request automatically, turn on **Automatic reviews** in [Codex settings](https://chatgpt.com/codex/settings/code-review). Codex will post a review whenever a new PR is opened for review, without needing an `@codex review` comment.If you want Codex to review every pull request automatically, turn on
64**Automatic reviews** in [Codex settings](https://chatgpt.com/codex/settings/code-review).
65Codex will post a review whenever someone opens a new PR for review, without
66needing an `@codex review` comment.
26 67
27## Customize what Codex reviews68## Customize what Codex reviews
28 69
39 80
40Codex applies guidance from the closest `AGENTS.md` to each changed file. You can place more specific instructions deeper in the tree when particular packages need extra scrutiny.81Codex applies guidance from the closest `AGENTS.md` to each changed file. You can place more specific instructions deeper in the tree when particular packages need extra scrutiny.
41 82
4283For a one-off focus, add it to your pull request comment, for example:For a one-off focus, add it to your pull request comment:
43 84
44`@codex review for security regressions`85`@codex review for security regressions`
45 86
4687In GitHub, Codex flags only P0 and P1 issues. If you want Codex to flag typos in documentation, add guidance in `AGENTS.md` (for example, “Treat typos in docs as P1.”).If you want Codex to flag typos in documentation, add guidance in `AGENTS.md`
88(for example, “Treat typos in docs as P1.”).
89
90## Act on review findings
91
92After Codex posts a review, you can ask it to fix issues in the same pull
93request by leaving another comment:
94
95```md
96@codex fix the P1 issue
97```
98
99Codex starts a cloud task with the pull request as context and can push a fix
100back to the branch when it has permission to do so.
47 101
48## Give Codex other tasks102## Give Codex other tasks
49 103
52```md106```md
53@codex fix the CI failures107@codex fix the CI failures
54```108```
109
110## Troubleshoot code review
111
112If Codex doesn't react or post a review:
113
114- Confirm you turned on **Code review** for the repository in [Codex settings](https://chatgpt.com/codex/settings/code-review).
115- Confirm the pull request belongs to a repository with [Codex cloud](https://developers.openai.com/codex/cloud) set up.
116- Use the exact trigger `@codex review` in a pull request comment.
117- For automatic reviews, check that you turned on **Automatic reviews** and that
118 the pull request event matches your review trigger settings.