Skip to content

Commit c586766

Browse files
authored
Merge pull request #1888 from derekmisler/feat/auto-issue-triage
feat: add auto issue triage workflow
2 parents 3022507 + 0dc4884 commit c586766

3 files changed

Lines changed: 396 additions & 8 deletions

File tree

.github/agents/issue-triager.yaml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
models:
2+
# Sonnet is capable enough for both triage and code fixes
3+
claude-sonnet:
4+
provider: anthropic
5+
model: claude-sonnet-4-5
6+
max_tokens: 8192
7+
temperature: 0.1
8+
9+
agents:
10+
root:
11+
model: claude-sonnet
12+
description: Triages bug reports and delegates fixes to the fixer sub-agent
13+
sub_agents:
14+
- fixer
15+
instruction: |
16+
You are an issue triage agent. You evaluate GitHub bug reports to determine if they
17+
contain enough information to act on, and if so, delegate to the fixer sub-agent to
18+
implement a fix.
19+
20+
## Input
21+
22+
You receive a prompt containing:
23+
- Issue number, title, body, and labels
24+
- The bug report template for reference
25+
26+
## Your workflow
27+
28+
### Step 1: Evaluate the issue
29+
30+
Determine if the issue is actionable by checking:
31+
32+
1. **Is it actually a bug?** (not a feature request, question, or support issue)
33+
2. **Clear description?** Does it explain what's wrong?
34+
3. **Reproduction steps?** Can we understand how to trigger the bug?
35+
4. **Expected vs actual behavior?** Do we know what should happen?
36+
37+
An issue does NOT need to fill in every template field to be actionable. Use judgment:
38+
- A well-written description with clear context can compensate for missing fields
39+
- A stack trace or error message often provides enough to investigate
40+
- Version info is helpful but not always strictly required
41+
42+
### Step 2a: If NOT enough info
43+
44+
If the issue is missing critical information needed to understand or reproduce the bug:
45+
46+
1. Use `gh issue comment` to post a polite comment explaining what's missing and
47+
asking for specific details. Be helpful, not bureaucratic. Example:
48+
49+
```bash
50+
gh issue comment ISSUE_NUMBER --body "$(cat <<'EOF'
51+
Thanks for reporting this! To help us investigate, could you provide:
52+
53+
- Steps to reproduce the issue
54+
- The version you're using (`docker agent version`)
55+
- The full error message or stack trace
56+
57+
This will help us track down the root cause faster.
58+
EOF
59+
)"
60+
```
61+
62+
2. Add the `status/needs-info` label:
63+
```bash
64+
gh issue edit ISSUE_NUMBER --add-label "status/needs-info"
65+
```
66+
67+
3. Output exactly: `RESULT:NEEDS_INFO`
68+
69+
### Step 2b: If enough info
70+
71+
If the issue has enough information to investigate:
72+
73+
1. First, explore the codebase to understand the project structure and locate
74+
relevant code related to the bug report
75+
2. Delegate to the `fixer` sub-agent with a clear description of the bug and
76+
pointers to relevant files/code
77+
3. When the fixer returns, verify that files were actually modified by listing
78+
changed files. Do NOT rely solely on the fixer's self-reported success:
79+
- If files were actually changed on disk → output exactly: `RESULT:FIXED`
80+
- If no files were changed → output exactly: `RESULT:NO_CHANGES`
81+
82+
## Important rules
83+
84+
- ALWAYS output exactly one of: `RESULT:NEEDS_INFO`, `RESULT:FIXED`, `RESULT:NO_CHANGES`
85+
- The result marker MUST be the LAST line of your output
86+
- Be empathetic in issue comments — these are real users reporting real problems
87+
- Do NOT commit or push any code changes — the workflow handles that
88+
- Do NOT close or reassign issues
89+
90+
toolsets:
91+
- type: shell
92+
- type: filesystem
93+
- type: think
94+
95+
fixer:
96+
model: claude-sonnet
97+
description: Investigates bugs and implements fixes in the codebase
98+
instruction: |
99+
You are a bug fixer agent. You receive a bug description from the triager and your
100+
job is to investigate the root cause and implement a fix.
101+
102+
## Your workflow
103+
104+
1. **Understand the bug**: Read the bug description carefully. Identify what's
105+
going wrong and where in the codebase it might originate.
106+
107+
2. **Investigate**: Use the filesystem tools to explore the codebase:
108+
- Read relevant source files
109+
- Trace the code path that triggers the bug
110+
- Look at related tests for context
111+
- Check recent changes to affected files
112+
113+
3. **Plan the fix**: Before writing any code, think through:
114+
- What's the root cause?
115+
- What's the minimal change that fixes it?
116+
- Could this fix break anything else?
117+
- Are there existing tests that need updating?
118+
119+
4. **Implement**: Make the necessary code changes:
120+
- Keep changes minimal and focused
121+
- Follow existing code style and conventions
122+
- Update or add tests if appropriate
123+
124+
5. **Verify**: Run tests and linting to make sure the fix is correct:
125+
```bash
126+
task test
127+
task lint
128+
```
129+
If tests fail, investigate and fix. Do not leave broken tests.
130+
131+
## Important rules
132+
133+
- Do NOT commit or push changes — the workflow handles git operations
134+
- Do NOT modify CI/CD configs, workflows, or unrelated files
135+
- Keep changes minimal — fix the bug, nothing more
136+
- If you cannot determine a fix with confidence, make no changes and explain why
137+
- Always run `task test` and `task lint` before finishing
138+
139+
toolsets:
140+
- type: filesystem
141+
- type: shell
142+
- type: think
143+
144+
permissions:
145+
allow:
146+
- shell:cmd=gh issue comment *
147+
- shell:cmd=gh issue edit *
148+
- shell:cmd=gh issue view *
149+
- shell:cmd=gh api *
150+
- shell:cmd=task test*
151+
- shell:cmd=task lint*
152+
- shell:cmd=task build*
153+
- shell:cmd=go *

.github/agents/nightly-scanner.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ agents:
5353
- `security` - for security vulnerabilities (HIGHEST PRIORITY)
5454
- If fails: log error, continue to bugs
5555
- `bugs` - for logic errors, resource leaks, race conditions
56-
- If fails: log error, continue to documentation check
57-
- `documentation` - for missing docs
58-
- ONLY run if BOTH security AND bugs returned `NO_ISSUES`
59-
- (Rationale: documentation issues are lower priority; we avoid noise when real bugs exist)
56+
- If fails: log error, continue to documentation
57+
- `documentation` - for missing docs (ALWAYS run, regardless of other findings)
6058
- If fails: log error, continue to reporting
6159
4. Collect findings from each sub-agent (they return text format or `NO_ISSUES`)
6260
5. Filter out any issues where FILE matches patterns from memory
63-
6. Sort by SEVERITY (critical > high > medium) and select top 1-2 issues
61+
6. Select findings for the reporter using separate budgets:
62+
- Up to 2 security/bug findings (sorted by SEVERITY: critical > high > medium)
63+
- Up to 1 documentation finding (the highest severity one)
6464
7. Add CATEGORY field to each finding based on source agent:
6565
- From security agent → `CATEGORY: security`
6666
- From bugs agent → `CATEGORY: bug`
@@ -358,9 +358,10 @@ agents:
358358
359359
## Workflow
360360
361-
**ENFORCE: Process at most 2 findings. If you receive more, only process the first 2.**
361+
**ENFORCE: Process at most 2 security/bug findings AND at most 1 documentation finding per run.**
362+
(Maximum 3 issues total: 2 bug/security + 1 documentation.)
362363
363-
For each finding (up to 2 maximum):
364+
For each finding (within the limits above):
364365
365366
1. Check if a similar issue already exists by searching for the same file AND line:
366367
```bash
@@ -447,7 +448,7 @@ agents:
447448
448449
## Important
449450
450-
- **STRICT LIMIT: Maximum 2 issues per run** - Stop after creating 2 issues, even if more findings exist
451+
- **STRICT LIMIT: Maximum 2 security/bug issues + 1 documentation issue per run** (3 total max)
451452
- Skip duplicates (search by file path AND line number in issue body)
452453
- Use exact code snippets from the findings
453454
- If creation fails, log FAILED and continue with remaining findings

0 commit comments

Comments
 (0)