mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-03-16 18:33:08 +00:00
chore: enhance PR review workflow and add GLM 5 model
- Add merge conflict detection as step 2 in PR review command, surfacing conflicts early before the rest of the review proceeds - Refine merge recommendations: always fix issues on the PR branch before merging rather than merging first and fixing on main afterward - Update verdict definitions (MERGE / MERGE after fixes / DON'T MERGE) with clearer action guidance for each outcome - Add GLM 5 model to the GLM API provider in registry - Clean up ui/package-lock.json (remove unnecessary peer flags) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,13 @@ Pull request(s): $ARGUMENTS
|
||||
1. **Retrieve PR Details**
|
||||
- Use the GH CLI tool to retrieve the details (descriptions, diffs, comments, feedback, reviews, etc)
|
||||
|
||||
2. **Assess PR Complexity**
|
||||
2. **Check for Merge Conflicts**
|
||||
- After retrieving PR details, check whether the PR has merge conflicts against the target branch
|
||||
- Use `gh pr view <number> --json mergeable,mergeStateStatus` or attempt a local merge check with `git merge-tree`
|
||||
- If conflicts exist, note the conflicting files — these must be resolved on the PR branch before merging
|
||||
- Surface conflicts early so they inform the rest of the review (don't discover them as a surprise at merge time)
|
||||
|
||||
3. **Assess PR Complexity**
|
||||
|
||||
After retrieving PR details, assess complexity based on:
|
||||
- Number of files changed
|
||||
@@ -34,13 +40,13 @@ Pull request(s): $ARGUMENTS
|
||||
- >15 files, OR >500 lines, OR >2 contributors, OR touches core architecture
|
||||
- Spawn up to 3 agents to analyze different aspects (e.g., security, performance, architecture)
|
||||
|
||||
3. **Analyze Codebase Impact**
|
||||
4. **Analyze Codebase Impact**
|
||||
- Based on the complexity tier determined above, spawn the appropriate number of deep dive subagents
|
||||
- For Simple PRs: analyze directly without spawning agents
|
||||
- For Medium PRs: spawn 1-2 agents focusing on the most impacted areas
|
||||
- For Complex PRs: spawn up to 3 agents to cover security, performance, and architectural concerns
|
||||
|
||||
4. **PR Scope & Title Alignment Check**
|
||||
5. **PR Scope & Title Alignment Check**
|
||||
- Compare the PR title and description against the actual diff content
|
||||
- Check whether the PR is focused on a single coherent change or contains multiple unrelated changes
|
||||
- If the title/description describe one thing but the PR contains significantly more (e.g., title says "fix typo in README" but the diff touches 20 files across multiple domains), flag this as a **scope mismatch**
|
||||
@@ -48,45 +54,53 @@ Pull request(s): $ARGUMENTS
|
||||
- Suggest specific ways to split the PR (e.g., "separate the refactor from the feature addition")
|
||||
- Reviewing large, unfocused PRs is impractical and error-prone; the review cannot provide adequate assurance for such changes
|
||||
|
||||
5. **Vision Alignment Check**
|
||||
6. **Vision Alignment Check**
|
||||
- Read the project's README.md and CLAUDE.md to understand the application's core purpose
|
||||
- Assess whether this PR aligns with the application's intended functionality
|
||||
- If the changes deviate significantly from the core vision or add functionality that doesn't serve the application's purpose, note this in the review
|
||||
- This is not a blocker, but should be flagged for the reviewer's consideration
|
||||
|
||||
6. **Safety Assessment**
|
||||
7. **Safety Assessment**
|
||||
- Provide a review on whether the PR is safe to merge as-is
|
||||
- Provide any feedback in terms of risk level
|
||||
|
||||
7. **Improvements**
|
||||
8. **Improvements**
|
||||
- Propose any improvements in terms of importance and complexity
|
||||
|
||||
8. **Merge Recommendation**
|
||||
- Based on all findings, provide a clear merge/don't-merge recommendation
|
||||
- If all concerns are minor (cosmetic issues, naming suggestions, small style nits, missing comments, etc.), recommend **merging the PR** and note that the reviewer can address these minor concerns themselves with a quick follow-up commit pushed directly to master
|
||||
- If there are significant concerns (bugs, security issues, architectural problems, scope mismatch), recommend **not merging** and explain what needs to be resolved first
|
||||
9. **Merge Recommendation**
|
||||
- Based on all findings (including merge conflict status from step 2), provide a clear recommendation
|
||||
- **If no concerns and no conflicts**: recommend merging as-is
|
||||
- **If concerns are minor/fixable and/or merge conflicts exist**: recommend fixing on the PR branch first, then merging. Never merge a PR with known issues to main — always fix on the PR branch first
|
||||
- **If there are significant concerns** (bugs, security issues, architectural problems, scope mismatch) that require author input or are too risky to fix: recommend **not merging** and explain what needs to be resolved
|
||||
|
||||
9. **TLDR**
|
||||
- End the review with a `## TLDR` section
|
||||
- In 3-5 bullet points maximum, summarize:
|
||||
- What this PR is actually about (one sentence)
|
||||
- The key concerns, if any (or "no significant concerns")
|
||||
- **Verdict: MERGE** / **MERGE (with minor follow-up)** / **DON'T MERGE** with a one-line reason
|
||||
- This section should be scannable in under 10 seconds
|
||||
10. **TLDR**
|
||||
- End the review with a `## TLDR` section
|
||||
- In 3-5 bullet points maximum, summarize:
|
||||
- What this PR is actually about (one sentence)
|
||||
- Merge conflict status (clean or conflicting files)
|
||||
- The key concerns, if any (or "no significant concerns")
|
||||
- **Verdict: MERGE** / **MERGE (after fixes)** / **DON'T MERGE** with a one-line reason
|
||||
- This section should be scannable in under 10 seconds
|
||||
|
||||
10. **Post-Review Action**
|
||||
Verdict definitions:
|
||||
- **MERGE** — no issues, clean to merge as-is
|
||||
- **MERGE (after fixes)** — minor issues and/or conflicts exist, but can be resolved on the PR branch first, then merged
|
||||
- **DON'T MERGE** — needs author attention, too complex or risky to fix without their input
|
||||
|
||||
11. **Post-Review Action**
|
||||
- Immediately after the TLDR, provide a `## Recommended Action` section
|
||||
- Based on the verdict, recommend one of the following actions:
|
||||
|
||||
**If verdict is MERGE (no concerns):**
|
||||
- Recommend merging as-is. No further action needed.
|
||||
- Merge as-is. No further action needed.
|
||||
|
||||
**If verdict is MERGE (with minor follow-up):**
|
||||
- If the concerns are low-risk and straightforward to fix (e.g., naming tweaks, small refactors, missing type annotations, minor style issues, trivial bug fixes), recommend merging the PR now and offer to immediately address the concerns in a follow-up commit directly on the target branch
|
||||
- List the specific changes you would make in the follow-up
|
||||
- Ask the user: *"Should I merge this PR and push a follow-up commit addressing these concerns?"*
|
||||
**If verdict is MERGE (after fixes):**
|
||||
- List the specific changes that need to be made (fixes, conflict resolutions, etc.)
|
||||
- Offer to: check out the PR branch, resolve any merge conflicts, apply the minor fixes identified during review, push the updated branch, then merge the now-clean PR
|
||||
- Ask the user: *"Should I check out the PR branch, apply these fixes, and then merge?"*
|
||||
- **Never merge first and fix on main later** — always fix on the PR branch before merging
|
||||
|
||||
**If verdict is DON'T MERGE:**
|
||||
- If the blocking concerns are still relatively contained and you are confident you can resolve them quickly (e.g., a small bug fix, a missing validation, a straightforward architectural adjustment), recommend merging the PR and immediately addressing the issues in a follow-up commit — but only if the fixes are low-risk and well-understood
|
||||
- If the issues are too complex, risky, or require author input (e.g., design decisions, major refactors, unclear intent), recommend sending the PR back to the author with specific feedback on what needs to change
|
||||
- If the issues are contained and you are confident you can fix them: offer the same workflow as "MERGE (after fixes)" — check out the PR branch, apply fixes, push, then merge
|
||||
- If the issues are too complex, risky, or require author input (e.g., design decisions, major refactors, unclear intent): recommend sending the PR back to the author with specific feedback on what needs to change
|
||||
- Be honest about your confidence level — if you're unsure whether you can address the concerns correctly, say so and defer to the author
|
||||
@@ -671,6 +671,7 @@ API_PROVIDERS: dict[str, dict[str, Any]] = {
|
||||
"requires_auth": True,
|
||||
"auth_env_var": "ANTHROPIC_AUTH_TOKEN",
|
||||
"models": [
|
||||
{"id": "glm-5", "name": "GLM 5"},
|
||||
{"id": "glm-4.7", "name": "GLM 4.7"},
|
||||
{"id": "glm-4.5-air", "name": "GLM 4.5 Air"},
|
||||
],
|
||||
|
||||
14
ui/package-lock.json
generated
14
ui/package-lock.json
generated
@@ -96,7 +96,6 @@
|
||||
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.27.1",
|
||||
"@babel/generator": "^7.28.5",
|
||||
@@ -2826,7 +2825,6 @@
|
||||
"integrity": "sha512-MciR4AKGHWl7xwxkBa6xUGxQJ4VBOmPTF7sL+iGzuahOFaO0jHCsuEfS80pan1ef4gWId1oWOweIhrDEYLuaOw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
}
|
||||
@@ -2836,7 +2834,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.9.tgz",
|
||||
"integrity": "sha512-Lpo8kgb/igvMIPeNV2rsYKTgaORYdO1XGVZ4Qz3akwOj0ySGYMPlQWa8BaLn0G63D1aSaAQ5ldR06wCpChQCjA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"csstype": "^3.2.2"
|
||||
}
|
||||
@@ -2847,7 +2844,6 @@
|
||||
"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
|
||||
"devOptional": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19.2.0"
|
||||
}
|
||||
@@ -2903,7 +2899,6 @@
|
||||
"integrity": "sha512-3xP4XzzDNQOIqBMWogftkwxhg5oMKApqY0BAflmLZiFYHqyhSOxv/cd/zPQLTcCXr4AkaKb25joocY0BD1WC6A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.51.0",
|
||||
"@typescript-eslint/types": "8.51.0",
|
||||
@@ -3214,7 +3209,6 @@
|
||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -3346,7 +3340,6 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"baseline-browser-mapping": "^2.9.0",
|
||||
"caniuse-lite": "^1.0.30001759",
|
||||
@@ -3618,7 +3611,6 @@
|
||||
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
|
||||
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
||||
"license": "ISC",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
@@ -3844,7 +3836,6 @@
|
||||
"integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.8.0",
|
||||
"@eslint-community/regexpp": "^4.12.1",
|
||||
@@ -5845,7 +5836,6 @@
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -5961,7 +5951,6 @@
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz",
|
||||
"integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@@ -5971,7 +5960,6 @@
|
||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz",
|
||||
"integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"scheduler": "^0.27.0"
|
||||
},
|
||||
@@ -6436,7 +6424,6 @@
|
||||
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@@ -6690,7 +6677,6 @@
|
||||
"integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.27.0",
|
||||
"fdir": "^6.5.0",
|
||||
|
||||
Reference in New Issue
Block a user