chore(ci): tune PR Agent config

- split per-model banners so two model jobs no longer overwrite each other
- raise reviewer findings cap to 8, broaden /improve to readability/cleanup
- enable dual-publishing for high-score suggestions (inline annotations)
- switch Claude model from opus-4-7 to opus-4-6 (fallback sonnet-4-6)
- raise reasoning_effort to high, response_language to zh-CN
- drop two dead config keys silently ignored by upstream schema
- add best_practices.md with 6 project-specific invariants for /improve
This commit is contained in:
yuanzonghao
2026-06-07 15:23:25 +08:00
parent df48e73d62
commit 81b99625d3
3 changed files with 98 additions and 21 deletions
+40 -13
View File
@@ -9,38 +9,56 @@ on:
jobs:
review-claude:
if: >
github.event_name == 'pull_request' ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
github.event.sender.type != 'Bot' &&
(
github.event_name == 'pull_request' ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
)
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: read
steps:
- name: PR Agent - Claude Opus 4.7
- name: PR Agent - Claude Opus 4.6
uses: the-pr-agent/pr-agent@main
env:
OPENAI.KEY: ${{ secrets.PR_REVIEW_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
config.model: "openai/claude-opus-4-7"
config.fallback_models: '["openai/claude-opus-4-6"]'
config.model: "openai/claude-opus-4-6"
config.fallback_models: '["openai/claude-sonnet-4-6"]'
config.custom_model_max_tokens: 200000
config.reasoning_effort: "high"
openai.api_base: ${{ secrets.PR_REVIEW_BASE_URL }}
github_action_config.auto_review: "true"
github_action_config.auto_describe: "true"
github_action_config.auto_improve: "true"
github_action_config.pr_actions: '["opened", "reopened", "ready_for_review", "synchronize"]'
pr_reviewer.extra_instructions: |
在评审正文最顶部,单独一行以引用块格式输出:
> 🤖 Reviewed by **Claude Opus 4.6**
不要评论纯代码风格或格式问题。
pr_code_suggestions.extra_instructions: |
在建议表格上方,单独一行以引用块格式输出:
> 🤖 Suggested by **Claude Opus 4.6**
best_practices.md 已包含项目规则,请优先围绕规则违反给出建议。
pr_description.extra_instructions: |
在描述顶部以引用块单独一行输出:
> 🤖 Described by **Claude Opus 4.6**
review-gpt:
if: >
github.event_name == 'pull_request' ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
github.event.sender.type != 'Bot' &&
(
github.event_name == 'pull_request' ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
)
runs-on: ubuntu-latest
permissions:
issues: write
@@ -55,8 +73,17 @@ jobs:
config.model: "openai/gpt-5.5"
config.fallback_models: '["openai/gpt-5.4-mini"]'
config.custom_model_max_tokens: 200000
config.reasoning_effort: "high"
openai.api_base: ${{ secrets.PR_REVIEW_BASE_URL }}
github_action_config.auto_review: "true"
github_action_config.auto_describe: "false"
github_action_config.auto_improve: "true"
github_action_config.pr_actions: '["opened", "reopened", "ready_for_review", "synchronize"]'
pr_reviewer.extra_instructions: |
在评审正文最顶部,单独一行以引用块格式输出:
> 🤖 Reviewed by **GPT 5.5**
不要评论纯代码风格或格式问题。
pr_code_suggestions.extra_instructions: |
在建议表格上方,单独一行以引用块格式输出:
> 🤖 Suggested by **GPT 5.5**
best_practices.md 已包含项目规则,请优先围绕规则违反给出建议。