From 9038586f5fb8f1c656b7cebfa9e036868e9b77b9 Mon Sep 17 00:00:00 2001 From: YXC0915 Date: Tue, 1 Dec 2026 23:54:21 +0800 Subject: [PATCH] ci: reserve output for GLM review conclusions --- .github/scripts/pr-review.mjs | 9 +++++++-- .github/workflows/pr-review.yml | 2 +- docs/pr-review-guidelines.md | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/scripts/pr-review.mjs b/.github/scripts/pr-review.mjs index 25d9fc0..3340725 100644 --- a/.github/scripts/pr-review.mjs +++ b/.github/scripts/pr-review.mjs @@ -137,7 +137,12 @@ async function reviewDiffs(context, includeDesignGuidelines) { npm: "@ai-sdk/anthropic", env: ["PR_REVIEW_LLM_KEY"], options: { baseURL: base.href }, - models: { [model]: { limit: { context: 512_000, output: 16_384 } } }, + models: { + [model]: { + limit: { context: 512_000, output: 32_768 }, + options: { thinking: { type: "adaptive" }, effort: "low" }, + }, + }, }, }, agent: { @@ -162,7 +167,7 @@ async function reviewDiffs(context, includeDesignGuidelines) { cwd: directory, input, encoding: "utf8", - timeout: 180_000, + timeout: 360_000, maxBuffer: 1024 * 1024, env: { PATH: process.env.PATH, diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 6b75e63..8270fc6 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -23,7 +23,7 @@ jobs: review: if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 12 steps: # For fork PRs, load the reviewer from the trusted workflow commit. - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/docs/pr-review-guidelines.md b/docs/pr-review-guidelines.md index ed15df7..b0a8918 100644 --- a/docs/pr-review-guidelines.md +++ b/docs/pr-review-guidelines.md @@ -68,4 +68,4 @@ 如果公开仓库的 Actions 事件策略阻止 `pull_request_target`,由仓库管理员在 **Settings → Actions → Policies** 为 `.github/workflows/pr-review.yml` 配置允许该事件的策略。工作流从默认分支加载审核脚本,将 GitHub API 返回的差异作为文本交给 [OpenCode](https://docs.bigmodel.cn/cn/coding-plan/tool/opencode),模型工具全部禁用。GitHub 写入权限仅用于提交审核意见。[GitHub 事件策略文档](https://docs.github.com/en/actions/how-tos/administer/control-workflow-execution) -工作流合入默认分支并配置密钥后,可在 **Actions → PR Review → Run workflow** 输入一个开放 PR 的编号。单次读取最多 300 个变更文件,PR 文本差异总量约 40 万字符,单文件约 3.6 万字符。审核会显示范围,使用 512,000 tokens 的模型上下文预算和 16,384 tokens 的输出上限。PR 版本、对照主线和 CI 结果相同时会跳过重复审核。缺少密钥时跳过,模型请求或发布失败时在 Actions 中显示失败。 +工作流合入默认分支并配置密钥后,可在 **Actions → PR Review → Run workflow** 输入一个开放 PR 的编号。单次读取最多 300 个变更文件,PR 文本差异总量约 40 万字符,单文件约 3.6 万字符。审核会显示范围,使用 512,000 tokens 的模型上下文预算和 32,768 tokens 的输出上限。请求采用低档推理强度,给审核正文保留输出预算。PR 版本、对照主线和 CI 结果相同时会跳过重复审核。缺少密钥时跳过,模型请求或发布失败时在 Actions 中显示失败。