Skip to content

Commit d572273

Browse files
committed
feat(examples): enable AI to write and execute reproduction scripts to verify bug fixes
1 parent 3652158 commit d572273

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

examples/workflows/issue-cleanup/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Issue Cleanup workflow is designed to automate the triage of stale issues by
88

99
1. **Check for Staleness (Native)**: Identifies if an issue has been waiting for reporter feedback for over 7 days. If so, it closes the issue directly via a GitHub Action script to save AI resources.
1010
2. **Check for Vagueness (AI)**: If an issue is not stale but lacks sufficient information (e.g., reproduction steps), the agent asks the reporter for specific details and stops.
11-
3. **Check Code Validity (AI)**: Determines if an issue is still relevant against the current codebase. If the issue has already been resolved implicitly, it will close the issue with an explanation.
11+
3. **Check Code Validity (AI)**: Determines if an issue is still relevant against the current codebase. The agent may attempt to write and execute a minimal reproduction script to verify if a bug has been resolved, or manually inspect the code. If verified as fixed, it will close the issue with an explanation.
1212
4. **Find Duplicates (AI)**: Checks if the issue has a more recent duplicate. If a duplicate exists, it closes the issue and links to the duplicate.
1313
5. **Summarize for Triage (AI)**: If an issue is still valid and unique, it provides a summary comment based on customizable instructions (e.g., categorizing it as `Maintainer-only` or `Help-wanted`). If no custom instructions are provided, it falls back to a standard triage summary.
1414

examples/workflows/issue-cleanup/gemini-issue-cleanup.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ You are an automated triage bot for the `!{echo $REPOSITORY}` repository. Your j
1616
- **STOP EXECUTION IMMEDIATELY**.
1717
- If the issue is clear or the reporter has provided info, proceed to Step 2.
1818
19-
### Step 2: Code Validity Check
20-
- Search `target-repo/` to see if the bug still exists or the feature is already implemented.
21-
- If definitively NO LONGER VALID:
22-
- Close it: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because this appears to have been fixed in the latest codebase." --repo !{echo $REPOSITORY}`
19+
### Step 2: Reproduction & Code Validity Check
20+
- If the issue describes a reproducible bug (e.g., a runtime error, unexpected output, or terminal behavior), you should write and execute a minimal test script using `node` to verify if the bug still occurs in the `target-repo/` codebase.
21+
- Alternatively, search `target-repo/` to manually trace the logic and see if the feature is already implemented or fixed.
22+
- If you can prove the issue is definitively NO LONGER VALID (e.g., your reproduction script works correctly without the bug, or the code has clearly been fixed):
23+
- Close it: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because I have verified this works correctly in the latest codebase. <brief explanation of how you verified>" --repo !{echo $REPOSITORY}`
2324
- **STOP EXECUTION IMMEDIATELY**.
2425
2526
### Step 3: Duplicate Check

examples/workflows/issue-cleanup/gemini-issue-cleanup.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ jobs:
160160
"list_directory",
161161
"run_shell_command(gh)",
162162
"run_shell_command(git)",
163-
"run_shell_command(date)"
163+
"run_shell_command(date)",
164+
"run_shell_command(node)"
164165
]
165166
}
166167
}

0 commit comments

Comments
 (0)