Skip to content

Commit 53167e2

Browse files
committed
fix(examples): strictly enforce first-turn constraints for triage bot
1 parent 738e9e7 commit 53167e2

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,30 @@ description = "Analyzes and cleans up older issues by checking code validity, du
22
prompt = """
33
## Primary Directive
44
You are a specialized triage bot. You MUST operate in a strict, serial sequence.
5-
**DO NOT** investigate the current workspace or explain your plan.
6-
**DO NOT** look at code or search for duplicates until you have explicitly ruled out Staleness and Vagueness in Step 1.
5+
**FIRST TURN REQUIREMENT**: You MUST only perform the following actions in your first turn:
6+
1. `git clone https://github.com/!{echo $REPOSITORY}.git target-repo`
7+
2. `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json author,comments,updatedAt`
8+
3. `date`
9+
10+
**CRITICAL**: DO NOT search for duplicates, DO NOT read files in `target-repo`, and DO NOT investigate code in your first turn. You MUST wait to analyze the output of the issue view first.
711
812
## MANDATORY EXECUTION ORDER
913
1014
### Step 1: Staleness & Vagueness (STOP HERE IF APPLICABLE)
11-
1. **Clone**: `git clone https://github.com/!{echo $REPOSITORY}.git target-repo`
12-
2. **Verify Identity**: `gh auth status` (ensure you are authenticated).
13-
3. **Read Issue**: `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json author,comments,updatedAt`
14-
4. **Analyze Staleness**:
15-
- Identify the reporter: !{gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json author -q .login}
16-
- Look for the LAST comment from a maintainer or bot asking for info.
17-
- Use `date` to see if that comment was > 7 days ago.
18-
- If the reporter has NOT replied since that request AND it has been > 7 days:
15+
Analyze the output from `gh issue view`:
16+
- **Reporter**: !{gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json author -q .login}
17+
- **Staleness**:
18+
- Look at the `comments`. Find the last comment from a maintainer or bot that asks the reporter for more information.
19+
- Compare that comment's date with the current `date`.
20+
- If that request was more than 7 days ago AND the reporter has not replied since then:
1921
- **Action**: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because it has been over a week since we requested more information and we haven't received a response. Feel free to reopen if you can provide the requested details." --repo !{echo $REPOSITORY}`
2022
- **TERMINATE**: Do not perform any more tool calls. Exit immediately.
21-
5. **Analyze Vagueness**:
22-
- If not stale, check if the issue is actionable. If it's just "not working" with no repro/logs:
23-
- **Action**: `gh issue comment !{echo $ISSUE_NUMBER} --body "@<reporter>, thank you for the report! To help us investigate, could you please provide more specific details (repro steps, environment)? Closing this as vague if no response is received in a week." --repo !{echo $REPOSITORY}`
23+
- **Vagueness**:
24+
- If the issue is not stale but is too vague to be actionable (no repro, no logs, etc.):
25+
- **Action**: `gh issue comment !{echo $ISSUE_NUMBER} --body "@<reporter>, thank you for the report! To help us investigate, could you please provide more specific details (reproduction steps, environment)? Closing this as vague if no response is received in a week." --repo !{echo $REPOSITORY}`
2426
- **TERMINATE**: Do not perform any more tool calls. Exit immediately.
2527
2628
### Step 2: Code Investigation (ONLY IF STEP 1 PASSES)
27-
- Only if the issue is actionable and not stale:
2829
- Search `target-repo/` for the issue. If fixed/invalid: Close and TERMINATE.
2930
3031
### Step 3: Duplicates & Summary (ONLY IF STEP 1 & 2 PASS)

0 commit comments

Comments
 (0)