Unverified 提交 81e96b49 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Triage bot v2 & update issue templates (#2196)

<!-- CURSOR_SUMMARY --> > [!NOTE] > Consolidates issue triage and streamlines bug reporting across GitHub and the app. > > - **CI**: Add `Issue Triage` workflow (`.github/workflows/claude-triage.yml`) using `anthropics/claude-code-action` with a new prompt (`.github/prompts/triage.md`) to auto-label issues, check duplicates with confidence ratings, and post brief helper comments (restricted `gh` commands). > - **Cleanup**: Remove legacy workflows `duplicate-issues.yml` and `triage-issues.yml` in favor of the unified triage job. > - **Templates**: Update `bug_report.md` to recommend filing from the app, link help docs, and request English-only reports. > - **App**: Simplify `HelpDialog` prefilled GitHub issue bodies (combine description + repro, mark screenshot as recommended, keep English note) while retaining auto-included system info/logs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 736a12b69d2d474a59acf33a3867af092c41aa42. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add a single, smarter triage bot that auto-labels new issues, checks for duplicates, and leaves short, friendly guidance. Also simplify our bug report template and in‑app “Report a bug” text to get better reports. - **New Features** - Triage agent prompt that: - Labels issues (bug/feature/ux) and adds language/incomplete/pro tags with friendly comments. - Searches for duplicates with confidence ratings and links helpful prior comments when highly confident. - New GitHub Action runs on issue creation using claude-code with restricted gh commands. - **Refactors** - Replace the two legacy workflows (duplicate-issues, triage-issues) with the new unified triage workflow. - Update bug_report.md to recommend reporting from the app, link help docs, and ask for English. - Simplify HelpDialog issue template: combine description + repro, mark screenshot as recommended, keep the “fill in English” note. <sup>Written for commit 736a12b69d2d474a59acf33a3867af092c41aa42. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: 's avatargreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
上级 8e0a16cb
...@@ -7,8 +7,10 @@ assignees: "" ...@@ -7,8 +7,10 @@ assignees: ""
--- ---
<!-- <!--
⚠️ IMPORTANT: All sections marked as required must be completed in English. We recommend filing bugs from the app because it automatically includes logs and system info!
Issues that do not meet these requirements will be closed and may need to be resubmitted. https://www.dyad.sh/docs/help#report-a-bug
Please fill in all fields in English.
--> -->
**Describe the bug** **Describe the bug**
......
# GitHub Issue Triage Agent
## Context
```
REPO: ${{ github.repository }}
ISSUE NUMBER: ${{ github.event.issue.number }}
TITLE: ${{ github.event.issue.title }}
BODY: ${{ github.event.issue.body }}
AUTHOR: ${{ github.event.issue.user.login }}
```
## Guidelines
- Be concise. People don't like to read long comments.
- Leave at most one comment per task. Do not combine the comments from the different tasks. Leave a comment first for task 1, and then a comment for task 2, etc.
- Be warm and easy-to-understand. Most users are _NOT_ developers. Do not assume they know technical jargon.
## Task 1: Label the Issue
Analyze the issue and apply appropriate labels using:
```bash
gh issue edit [number] --add-label "label1,label2"
```
### Issue Type Labels (choose one)
| Condition | Label |
| ---------------------------------- | ----------------- |
| Bug, regression, or serious defect | `bug` |
| Request for new functionality | `feature request` |
| Usability problem (not a bug) | `ux/usability` |
### Additional Labels
| Condition | Label | Action |
| ------------------------------------- | ------------------ | ------------------- |
| Includes a Pro user ID | `pro` | — |
| Not written in English | `issue/lang` | Comment (see below) |
| Missing description or blank sections | `issue/incomplete` | Comment (see below) |
### Required Comments
**For non-English issues:**
> Hi! We're only able to respond to issues in English. Please translate your issue with ChatGPT so we can help you. Thanks!
**For incomplete issues:**
> Hi! Please fill in all the fields in the issue so we can help you. A screenshot is very helpful!
## Task 2: Check for Duplicates
Search all existing issues in this repository (excluding #${{ github.event.issue.number }}) for potential duplicates.
### Search Criteria
- Similar titles or descriptions
- Same error messages or symptoms
- Related functionality or components
- Similar feature requests
### Confidence Ratings
| Rating | Meaning |
| ---------- | ------------------------------------------------------------------ |
| **High** | Identical error message, same component, or clearly the same issue |
| **Medium** | Similar request or problem, but different use case or context |
| **Low** | Related symptoms, but unclear connection |
### If Duplicates Found
Comment on the issue using the following format. Do NOT include low confidence matches if you've found medium or high confidence matches:
> This issue might be a duplicate of existing issues. Please check:
>
> - #[number]: [brief description of similarity] (confidence: [high/medium/low])
>
> Feel free to ignore if none of these address your specific case.
**Example:**
> - #123: Contains identical error message and affects same component (confidence: high)
> - #124: Similar feature request but slightly different use case (confidence: medium)
### Surfacing Helpful Comments
If a **high-confidence** duplicate is found and there is a helpful comment from **wwwillchen@** on the original issue, include a recommendation in your comment:
> You might want to try [summary of the suggestion] based on this earlier [comment]([direct link to the comment]).
**Notes:**
- Only do this for high-confidence duplicates where you're very confident the issues are the same.
- Only surface comments from wwwillchen@ — do not surface comments from other users.
- Link directly to the specific comment, not just the issue.
### If No Duplicates Found
Do not comment.
name: Issue Triage
on:
issues:
types: [opened]
jobs:
triage:
environment: ai-bots
runs-on: ubuntu-latest
permissions:
issues: write
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
# anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt_file: .github/prompts/triage.md
claude_args: |
--model claude-opus-4-5-20251101 --allowedTools "Bash(gh issue:*),Bash(gh search:*)"
# This was copied from https://github.com/sst/opencode/blob/d7a9f343c53d481802c134ce25691a8c150d59d2/.github/workflows/duplicate-issues.yml
# MIT License
# Copyright (c) 2025 opencode
name: Duplicate Issue Detection
on:
issues:
types: [opened]
jobs:
check-duplicates:
environment: ai-bots
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install opencode
run: curl -fsSL https://opencode.ai/install | bash
- name: Check for duplicate issues
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_PERMISSION: |
{
"bash": {
"gh issue*": "allow",
"*": "deny"
},
"webfetch": "deny"
}
run: |
opencode run -m anthropic/claude-sonnet-4-20250514 "A new issue has been created:'
Issue number:
${{ github.event.issue.number }}
Thoroughly lookup this issue and search through all existing issues (excluding #${{ github.event.issue.number }}) in this repository to find any potential duplicates of this new issue. Carefully consider all related issues and search using relevant keywords to ensure a comprehensive search.
Consider:
1. Similar titles or descriptions
2. Same error messages or symptoms
3. Related functionality or components
4. Similar feature requests
For each potential duplicate you find, assign a confidence rating (high, medium, or low) indicating how likely it is to be a match.
If you find any potential duplicates, please comment on the new issue with:
- A brief explanation of why it might be a duplicate
- Links to the potentially duplicate issues
- A confidence assessment (high/medium/low) for each
- A suggestion to check those issues first
Use this format for the comment:
'This issue might be a duplicate of existing issues. Please check:
- #[issue_number]: [brief description of similarity] (confidence: [high/medium/low])
Feel free to ignore if none of these address your specific case.'
Examples:
- #123: Contains identical error message and affects same component (confidence: high)
- #124: Similar feature request but slightly different use case (confidence: medium)
- #125: Mentions a related symptom, but context is unclear (confidence: low)
If no clear duplicates are found, do not comment."
# This was copied from https://github.com/sst/opencode/blob/d7a9f343c53d481802c134ce25691a8c150d59d2/.github/workflows/duplicate-issues.yml
# MIT License
# Copyright (c) 2025 opencode
name: Triage Issue
on:
issues:
types: [opened]
jobs:
triage-issues:
environment: ai-bots
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install opencode
run: curl -fsSL https://opencode.ai/install | bash
- name: Triage issue
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_PERMISSION: |
{
"bash": {
"gh issue*": "allow",
"*": "deny"
},
"webfetch": "deny"
}
run: |
opencode run -m anthropic/claude-sonnet-4-20250514 "A new issue has been created:'
Issue number:
${{ github.event.issue.number }}
If most of the issue description is written in a language other than English, label the issue with 'issue/lang' and leave a friendly comment: 'Hi! We're only able to respond to issues in English. Please translate your issue with ChatGPT so we can help you. Thanks!'
If the issue has several blank sections, then label the issue with 'issue/incomplete' and leave a friendly comment: 'Hi! Please fill in all the fields in the issue so we can help you. A screenshot is very helpful!'
Here's an example of an empty issue:
<!--
⚠️ IMPORTANT: All sections marked as required must be completed in English.
Issues that do not meet these requirements will be closed and may need to be resubmitted.
-->
## Bug Description (required)
<!-- Please describe the issue you're experiencing -->
## Steps to Reproduce (required)
<!-- Please list the steps to reproduce the issue -->
## Expected Behavior (required)
<!-- What did you expect to happen? -->
## Actual Behavior (required)
<!-- What actually happened? -->
"
...@@ -77,24 +77,12 @@ export function HelpDialog({ isOpen, onClose }: HelpDialogProps) { ...@@ -77,24 +77,12 @@ export function HelpDialog({ isOpen, onClose }: HelpDialogProps) {
// Create a formatted issue body with the debug info // Create a formatted issue body with the debug info
const issueBody = ` const issueBody = `
<!-- <!-- Please fill in all fields in English -->
⚠️ IMPORTANT: All sections marked as required must be completed in English.
Issues that do not meet these requirements will be closed and may need to be resubmitted.
-->
## Bug Description (required) ## Bug Description (required)
<!-- Please describe the issue you're experiencing --> <!-- Please describe the issue you're experiencing and how to reproduce it -->
## Steps to Reproduce (required)
<!-- Please list the steps to reproduce the issue -->
## Expected Behavior (required)
<!-- What did you expect to happen? -->
## Actual Behavior (required)
<!-- What actually happened? -->
## Screenshot (Optional) ## Screenshot (recommended)
<!-- Screenshot of the bug --> <!-- Screenshot of the bug -->
## System Information ## System Information
...@@ -222,10 +210,7 @@ ${debugInfo.logs.slice(-3_500) || "No logs available"} ...@@ -222,10 +210,7 @@ ${debugInfo.logs.slice(-3_500) || "No logs available"}
const handleOpenGitHubIssue = () => { const handleOpenGitHubIssue = () => {
// Create a GitHub issue with the session ID // Create a GitHub issue with the session ID
const issueBody = ` const issueBody = `
<!-- <!-- Please fill in all fields in English -->
⚠️ IMPORTANT: All sections marked as required must be completed in English.
Issues that do not meet these requirements will be closed and may need to be resubmitted.
-->
Session ID: ${sessionId} Session ID: ${sessionId}
Pro User ID: ${userBudget?.redactedUserId || "n/a"} Pro User ID: ${userBudget?.redactedUserId || "n/a"}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论