﻿---
title: "GitLab MR 同样写 @codex review，但要先接通环境和 webhook"
summary: "Beta。GitLab.com 要项目环境才能审。自建实例还要服务账号 PAT。组级 webhook 只能审，不能改代码。"
category: cloud
level: intermediate
surfaces: [cloud]
tags: ["GitLab", "@codex", "code review"]
canonical: /tips/gitlab-mr-codex-review/
---

# GitLab MR 同样写 @codex review，但要先接通环境和 webhook

Beta。GitLab.com 要项目环境才能审。自建实例还要服务账号 PAT。组级 webhook 只能审，不能改代码。

评论：

```text
@codex review
@codex review for issues in the database migration
@codex fix the P1 issue
```

和 GitHub 一样：`@codex review` 才是审查。只写 `@codex` 会开 Cloud 聊天。手动审可以到 P2；自动审默认只报 P0/P1。

GitLab.com：给项目建 Cloud 环境，并打开 Enable Codex activity from GitLab（要 Maintainer/Owner 才能装 webhook）。自建 / Dedicated：管理员在 Connectors 里让 Codex 建服务账号，或粘贴带 `api` 范围、至少 30 天有效期的 PAT。组级 webhook 能覆盖子项目的审查，但改文件、提交、推分支必须另建项目环境。

桌面应用里的「Create pull request」不在这个 beta 里。签名 webhook 要 GitLab 19.0+。

## 来源

- [OpenAI · Review GitLab merge requests](https://learn.chatgpt.com/docs/third-party/gitlab)
