Repository navigation
ci: add Qwen Code issue follow-up bot workflow #3854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d15b201
ci: add issue follow-up bot workflow
yiliang114 87d9ec0
ci: gate issue follow-up bot rollout
yiliang114 e886bf9
ci: reduce issue follow-up batch size
yiliang114 5328638
ci: address issue follow-up bot review
yiliang114 4a20e04
ci: add temporary issue bot canary
yiliang114 f865b6f
ci: fix canary verification
yiliang114 6bac880
ci: dedupe bot token issue comments
yiliang114 759fd75
ci: remove temporary issue bot canary
yiliang114 8ab829e
ci: avoid repeated issue bot followups
yiliang114 9184e89
ci: simplify issue follow-up bot prompt
yiliang114 e8b59b8
ci: refine issue follow-up bot flow
yiliang114 6631fca
ci: harden issue follow-up bot workflow
yiliang114 36f0144
ci: harden issue follow-up bot rollout
yiliang114 3ecb800
ci: enforce follow-up bot dry-run writes
yiliang114 e9a55eb
ci: redact blocked bot command args
yiliang114 43ee366
ci: lock follow-up bot gh wrapper to current repo
yiliang114 52ad7d1
ci: tighten follow-up bot wrapper and trim noise
yiliang114 ee8a3c2
ci: fix shim reject logs to include full subcommand context
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,179 @@ | ||
| name: 'Qwen Issue Follow-up Bot' | ||
|
|
||
| on: | ||
| issues: | ||
| types: | ||
| - 'opened' | ||
| schedule: | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| - cron: '0 */6 * * *' | ||
| workflow_dispatch: | ||
| inputs: | ||
| issue_number: | ||
| description: 'Optional issue number. Leave empty to let Qwen select scheduled candidates.' | ||
| required: false | ||
| type: 'string' | ||
| dry_run: | ||
| description: 'Print planned actions without modifying issues.' | ||
| required: false | ||
| default: true | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| type: 'boolean' | ||
| scheduled_limit: | ||
| description: 'Maximum number of candidate issues to consider during scheduled follow-up.' | ||
| required: false | ||
| default: '10' | ||
| type: 'string' | ||
|
|
||
| concurrency: | ||
| group: '${{ github.workflow }}-${{ github.event.issue.number || github.event.inputs.issue_number || github.event_name }}' | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| cancel-in-progress: false | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: 'bash' | ||
|
|
||
| permissions: | ||
| contents: 'read' | ||
| id-token: 'write' | ||
| issues: 'write' | ||
|
|
||
| env: | ||
| BOT_GITHUB_TOKEN: '${{ secrets.QWEN_CODE_BOT_TOKEN || secrets.CI_BOT_PAT }}' | ||
|
|
||
| jobs: | ||
| follow-up-issues: | ||
| timeout-minutes: 15 | ||
| if: |- | ||
| ${{ | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| github.repository == 'QwenLM/qwen-code' && | ||
| (github.event_name == 'workflow_dispatch' || vars.QWEN_ISSUE_FOLLOWUP_BOT_ENABLED == 'true') && | ||
| (github.event_name != 'issues' || github.event.issue.pull_request == null) | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| }} | ||
| runs-on: 'ubuntu-latest' | ||
| steps: | ||
| - name: 'Run Qwen issue follow-up' | ||
| uses: 'QwenLM/qwen-code-action@5fd6818d04d64e87d255ee4d5f77995e32fbf4c2' | ||
| env: | ||
| GITHUB_TOKEN: '${{ env.BOT_GITHUB_TOKEN }}' | ||
| REPOSITORY: '${{ github.repository }}' | ||
| EVENT_NAME: '${{ github.event_name }}' | ||
| ISSUE_NUMBER: '${{ github.event.issue.number || github.event.inputs.issue_number }}' | ||
| DRY_RUN: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true' && 'true' || 'false' }}" | ||
| SCHEDULED_LIMIT: "${{ github.event.inputs.scheduled_limit || '10' }}" | ||
| with: | ||
| OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}' | ||
| OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}' | ||
| OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}' | ||
| settings_json: |- | ||
| { | ||
| "maxSessionTurns": 20, | ||
| "coreTools": [ | ||
| "run_shell_command", | ||
| "write_file" | ||
| ], | ||
| "sandbox": false | ||
| } | ||
| prompt: |- | ||
| ## Role | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
|
|
||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| You are the Qwen Code issue follow-up bot. Use `gh` commands to | ||
| inspect GitHub issues and provide early, conservative community | ||
| follow-up. | ||
|
|
||
| ## Runtime Context | ||
|
|
||
| - Repository: `${{ github.repository }}` | ||
| - Event name: `${{ github.event_name }}` | ||
| - Issue number, when the event targets one issue: `${{ github.event.issue.number || github.event.inputs.issue_number }}` | ||
| - Scheduled candidate limit: `${{ github.event.inputs.scheduled_limit || '10' }}` | ||
| - Dry run: `${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true' && 'true' || 'false' }}` | ||
|
|
||
| ## Scope | ||
|
|
||
| If `ISSUE_NUMBER` is set, inspect and process only that issue. This | ||
| is the normal path for a newly opened issue. Do not scan or process | ||
| unrelated recent issues in this mode. | ||
|
|
||
| If `ISSUE_NUMBER` is empty, this is a scheduled/manual batch run. | ||
| Find and process at most `SCHEDULED_LIMIT` open issues that are | ||
| likely to need early follow-up. Prefer unassigned issues without | ||
| maintainer/contributor follow-up, without bot marker comments, and | ||
| without clear evidence that maintainers have already handled them. | ||
| Do not process a larger backlog just because more issues exist. | ||
| Start from GitHub searches that prefilter already-handled issues, | ||
| such as `is:open is:issue no:assignee`, excluding obvious waiting, | ||
| in-progress, review, stale, and blocked statuses when labels exist. | ||
| Then inspect comments and marker comments before acting. | ||
|
|
||
| ## Safety Rules | ||
|
|
||
| - Before acting on an issue, inspect its current state with | ||
| `gh issue view "$ISSUE_NUMBER" --repo "${{ github.repository }}" --json number,title,body,state,labels,assignees,comments,url` | ||
| when `$ISSUE_NUMBER` is provided. In scheduled batch mode, replace | ||
| `$ISSUE_NUMBER` with the selected issue number. | ||
| - Skip closed issues, pull requests, issues assigned to anyone, and | ||
| issues that already appear to be handled by maintainers. | ||
| - Treat comments from repository collaborators, members, owners, or | ||
| the Qwen bot itself as existing follow-up. Skip those issues unless | ||
| you only need to update one of your own existing marker comments. | ||
| - Skip issues that already have one of these marker comments unless | ||
| there is a clear reason to update the existing marker comment: | ||
| - `<!-- qwen-issue-bot:invalid -->` | ||
| - `<!-- qwen-issue-bot:needs-info -->` | ||
| - `<!-- qwen-issue-bot:related -->` | ||
| - Do not assign issues to people in this phase. | ||
| - Use only labels that already exist in the repository. | ||
| - If `DRY_RUN` is `true`, do not modify GitHub. Print the planned | ||
| actions as JSON instead. | ||
| - Never create duplicate marker comments. Update an existing marker | ||
| comment only when its content is meaningfully stale or incomplete. | ||
|
|
||
| ## Decisions You Can Make | ||
|
|
||
| For each selected issue, focus on these actions: | ||
|
|
||
| - Search for related existing issues, including closed issues. Use | ||
| the issue title, error codes, command names, important stack/error | ||
| text, affected feature, and labels as search terms. | ||
| - If there are strong related issues, especially ones with maintainer | ||
| replies or known resolution/workaround, reply with a concise | ||
| `related` marker comment that links those issues. Do not claim the | ||
| issue is a duplicate unless the evidence is clear. | ||
| - Add only a small number of high-confidence labels. Prefer labels | ||
| that help maintainers route the issue, such as one `type/*`, one | ||
| `category/*`, one or two `scope/*`, or a relevant `status/*`. | ||
| - Ask for missing information when a plausible report lacks facts | ||
| needed for triage, such as reproduction steps, environment, | ||
| expected/actual behavior, logs, screenshots, or configuration. | ||
| - Close only clearly invalid test, placeholder, spam, or otherwise | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| non-actionable issues. Use `not_planned`. | ||
|
|
||
| Example: if a new issue reports a `401` authentication failure and | ||
| previous `401` issues already contain maintainer guidance or a known | ||
| workaround, link those issues in a `related` marker comment and add | ||
| the most relevant authentication/status labels. | ||
|
|
||
| ## Comment Markers | ||
|
|
||
| Put one of these hidden markers at the beginning of bot comments: | ||
|
|
||
| - Invalid issue: `<!-- qwen-issue-bot:invalid -->` | ||
| - Needs information: `<!-- qwen-issue-bot:needs-info -->` | ||
| - Related issues: `<!-- qwen-issue-bot:related -->` | ||
|
|
||
| ## Execution Guidance | ||
|
|
||
| - Run `gh label list --repo "${{ github.repository }}" --limit 200` before | ||
| selecting labels. | ||
| - Use `gh issue edit` to add or remove labels. | ||
| - Use `gh issue comment` to create comments. | ||
| - Use `gh api --method PATCH /repos/${{ github.repository }}/issues/comments/COMMENT_ID` | ||
| to update an existing marker comment. | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| - After you successfully add labels, add or update a marker comment, | ||
| or close an issue, remove `status/needs-triage` if present. | ||
| - Keep comments concise and neutral. Ask for facts; do not imply a | ||
| root cause unless the issue clearly proves it. | ||
|
|
||
| ## Output | ||
|
|
||
| End with one JSON object containing `processed`, `skipped`, | ||
| `dryRun`, and `actions`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.