fix: commit agent changes before opening PR

This commit is contained in:
2026-05-06 16:00:31 +08:00
parent c7d972e5cd
commit 61c194de37
5 changed files with 70 additions and 22 deletions

View File

@@ -34,7 +34,8 @@ Issue URL: {issue.html_url}
Implement the requested change in this workspace. Keep the change scoped to this issue.
Run the relevant tests before finishing.
Write `AGENT_IMPLEMENTATION_REPORT.md` in the workspace root using this exact section contract:
Write `.agent-output/AGENT_IMPLEMENTATION_REPORT.md` using this exact section contract.
Keep the section headings exactly as written below, but write the section content in Chinese:
- Summary
- Files changed
@@ -55,7 +56,9 @@ Issue: #{issue.issue_number} {issue.title}
Review the implementation currently checked out in this workspace. Focus on correctness,
scope control, test evidence, and human risks. Do not modify code.
Write `AGENT_REVIEW_REPORT.md` in the workspace root using this exact section contract:
Write `.agent-output/AGENT_REVIEW_REPORT.md` using this exact section contract.
Keep the section headings exactly as written below. Keep the Verdict token in English,
but write the section content and Suggested PR Comment in Chinese:
- Verdict: APPROVE, REQUEST_CHANGES, or NEEDS_HUMAN_DECISION
- Summary
@@ -69,16 +72,16 @@ Write `AGENT_REVIEW_REPORT.md` in the workspace root using this exact section co
def render_pr_body(issue: IssueRecord, implementation_report: str) -> str:
return f"""Closes #{issue.issue_number}
return f"""关联 Issue#{issue.issue_number}
## Agent Implementation Report
## 代理实现报告
{implementation_report.strip()}
## Human Review Gate
## 人工审核
This PR was opened by the local agent manager. It has not been auto-merged.
Human maintainers must review, decide, and merge manually.
此 PR 由本地 agent-manager 自动创建,但不会自动合并。
请维护者人工审核、决策并手动合并。
"""
@@ -102,13 +105,13 @@ def extract_section(raw: str, title: str) -> str:
def render_human_review_summary(review: ReviewReport) -> str:
return f"""## Agent Review Summary
return f"""## 代理评审摘要
Verdict: `{review.verdict}`
结论:`{review.verdict}`
{review.suggested_pr_comment.strip()}
## Human Action Required
## 需要人工处理
Please review the PR manually. The agent manager will not merge, close, or request changes automatically.
请人工审核该 PR。agent-manager 不会自动合并、关闭 PR 或提交变更请求。
"""