From 735b8c4fedfb6ea65ed97bf7d52c3c58c053df8f Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sat, 20 Jun 2026 19:26:18 +0800 Subject: [PATCH] =?UTF-8?q?[moz]=20fix(handler):=20ToolchainApiSection=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=20Gitea=20Review=20API=20curl=20=E6=8C=87?= =?UTF-8?q?=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:姜维在 PR comment 中写 Review 而非通过 Review API 提交。 原因:steps 写了'提交 Review(Gitea API: POST .../reviews)'但 ToolchainApiSection 中没有 Review API 的 curl 示例。agent 找不到 怎么提交,就用最接近的 comment API 写 Review。 修复:在 ToolchainApiSection 中增加'提交 PR Review'段落, 含完整 curl 示例 + event 参数说明 + ⚠️ 必须用 Review API 提交。 --- src/daemon/toolchain_handler.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/daemon/toolchain_handler.py b/src/daemon/toolchain_handler.py index 201b836..9ae18e4 100644 --- a/src/daemon/toolchain_handler.py +++ b/src/daemon/toolchain_handler.py @@ -166,6 +166,19 @@ class ToolchainApiSection: "", "⚠️ 不要使用 Mail API(飞鸽传书)。所有协作通过 Gitea 留痕。", "", + "### 提交 PR Review", + "", + "如果步骤中要求提交 Review(审查 PR):", + "```bash", + f'curl -s -X POST "{_GITEA_BASE}/repos/{{repo}}/pulls/{{pr_number}}/reviews" \\', + ' -H "Authorization: token " \\', + ' -H "Content-Type: application/json" \\', + ' -d \'{"event": "approved", "body": "审查结论"}\'', + "```", + "", + "event 可选:approved(通过)/ request_changes(驳回)", + "⚠️ 必须用 Review API 提交,不要在 PR comment 中写 Review。", + "", "### 需要创建 Issue 时", "", "如果步骤中要求创建 Issue 指派他人(如 jiangwei-infra):",