Skip to content

Commit 399fae8

Browse files
committed
fix(examples): force triage bot to serialize setup operations and block pre-research
1 parent b5e9a4f commit 399fae8

1 file changed

Lines changed: 32 additions & 30 deletions

File tree

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

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
description = "Analyzes and cleans up older issues by checking code validity, duplicates, and providing a triage summary."
22
prompt = """
3-
Execute the following triage process for Issue #!{echo $ISSUE_NUMBER} in the `!{echo $REPOSITORY}` repository. You must perform these exact steps in order. Do not investigate your own configuration.
3+
Execute the following triage process for Issue #!{echo $ISSUE_NUMBER} in the `!{echo $REPOSITORY}` repository.
4+
You are a script executor. You MUST execute these steps in exact sequential order. Do not skip steps. Do not parallelize steps. Do not investigate your own configuration.
45
5-
### Step 1: Fetch Context (DO THIS IMMEDIATELY)
6-
- Run `git clone https://github.com/!{echo $REPOSITORY}.git target-repo`
7-
- Run `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments,labels,assignees`
6+
### STEP 1: FETCH DATA (MANDATORY FIRST TURN)
7+
You MUST execute ONLY these two commands in your very first turn. Do NOT execute any other tools.
8+
1. `git clone https://github.com/!{echo $REPOSITORY}.git target-repo`
9+
2. `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments,labels,assignees`
810
9-
### Step 2: Resolution Check
10-
- Read the comments. Does the latest comment indicate that the issue has been fixed, resolved, or is functioning properly?
11-
- If YES: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because the latest comments indicate this issue has been resolved. Feel free to reopen if the problem persists." --reason "completed" --repo !{echo $REPOSITORY}`
12-
- **STOP EXECUTION IMMEDIATELY**.
11+
WAIT for the output of Step 1 before proceeding to Step 2.
1312
14-
### Step 3: Inactivity Check
15-
- Is `!{echo $INACTIVE_OVER_30_DAYS}` equal to `true`?
16-
- If YES (and it was not resolved above): Execute the following bash script exactly as written to handle the inactivity.
13+
### STEP 2: RESOLUTION CHECK
14+
Read the comments from the `gh issue view` output.
15+
Does the latest comment indicate that the issue has been fixed, resolved, or is functioning properly?
16+
- If YES: Execute `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because the latest comments indicate this issue has been resolved. Feel free to reopen if the problem persists." --reason "completed" --repo !{echo $REPOSITORY}` and **STOP EXECUTION IMMEDIATELY**.
17+
- If NO: Proceed to Step 3.
18+
19+
### STEP 3: INACTIVITY CHECK
20+
Check the environment variable `!{echo $INACTIVE_OVER_30_DAYS}`. Is it exactly equal to the string `true`?
21+
- If YES: Execute the following bash script exactly as written.
1722
```bash
1823
ISSUE_JSON=$(gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json author,labels,assignees)
1924
REPORTER=$(echo "$ISSUE_JSON" | jq -r '.author.login')
@@ -50,29 +55,26 @@ if [ "$IS_HIGH_PRIORITY" = "false" ]; then
5055
gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --repo !{echo $REPOSITORY}
5156
fi
5257
```
53-
- **STOP EXECUTION IMMEDIATELY**.
58+
- After executing this script, **STOP EXECUTION IMMEDIATELY**. Do not proceed to Step 4.
59+
- If NO: Proceed to Step 4.
5460
55-
### Step 4: Vagueness Check
56-
- If the issue is NOT inactive over 30 days: Is the issue description fundamentally missing context (no logs, no repro steps, just "it's broken") AND no one has asked for more information yet?
57-
- Ask the reporter: `gh issue comment !{echo $ISSUE_NUMBER} --body "@<reporter_username>, thank you for the report! Could you please provide more specific details (e.g., reproduction steps, expected behavior, and environment)? Closing this as vague if no response is received in a week." --repo !{echo $REPOSITORY}`
58-
- **STOP EXECUTION IMMEDIATELY**.
59-
- If the issue is clear, proceed to Step 5.
61+
### STEP 4: VAGUENESS CHECK
62+
Is the issue description fundamentally missing context (no logs, no repro steps, just "it's broken") AND no one has asked for more information yet?
63+
- If YES: Ask the reporter: `gh issue comment !{echo $ISSUE_NUMBER} --body "@<reporter_username>, thank you for the report! Could you please provide more specific details (e.g., reproduction steps, expected behavior, and environment)? Closing this as vague if no response is received in a week." --repo !{echo $REPOSITORY}` and **STOP EXECUTION IMMEDIATELY**.
64+
- If NO: Proceed to Step 5.
6065
61-
### Step 5: Reproduction & Code Validity Check
62-
- 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.
63-
- Alternatively, search `target-repo/` to manually trace the logic and see if the feature is already implemented or fixed.
64-
- 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):
65-
- 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}`
66-
- **STOP EXECUTION IMMEDIATELY**.
66+
### STEP 5: REPRODUCTION & CODE VALIDITY
67+
Search the `target-repo/` codebase to see if the bug still occurs or if the feature is already implemented.
68+
- If definitively NO LONGER VALID: Close it: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because I have verified this works correctly in the latest codebase. <brief explanation>" --repo !{echo $REPOSITORY}` and **STOP EXECUTION IMMEDIATELY**.
69+
- If still valid: Proceed to Step 6.
6770
68-
### Step 6: Duplicate Check
69-
- Search for duplicates using `gh issue list --search "<keywords>" --repo !{echo $REPOSITORY} --state all`
70-
- If a clear duplicate is found:
71-
- Close it: `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}`
72-
- **STOP EXECUTION IMMEDIATELY**.
71+
### STEP 6: DUPLICATES
72+
Search for duplicates using `gh issue list --search "<keywords>" --repo !{echo $REPOSITORY} --state all`.
73+
- If found: `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}` and **STOP EXECUTION IMMEDIATELY**.
74+
- If no duplicates: Proceed to Step 7.
7375
74-
### Step 7: Triage Summary
75-
- If unique and valid, provide a summary comment using these instructions:
76+
### STEP 7: TRIAGE SUMMARY
77+
Provide a summary comment using these instructions:
7678
```
7779
!{echo $CUSTOM_INSTRUCTIONS}
7880
```

0 commit comments

Comments
 (0)