Skip to content

feat: add auto issue triage workflow#1888

Merged
derekmisler merged 5 commits intodocker:mainfrom
derekmisler:feat/auto-issue-triage
Mar 3, 2026
Merged

feat: add auto issue triage workflow#1888
derekmisler merged 5 commits intodocker:mainfrom
derekmisler:feat/auto-issue-triage

Conversation

@derekmisler
Copy link
Contributor

@derekmisler derekmisler commented Mar 2, 2026

Summary

  • Add GitHub Actions workflow that triggers when an issue is labeled kind/bug
  • Add cagent agent config (issue-triager.yaml) with a root triager agent and fixer sub-agent
  • Triager evaluates if the bug report has enough info; if not, comments asking for details and adds status/needs-info label
  • If actionable, the fixer sub-agent investigates and implements a fix, then the workflow creates a branch, commits, pushes, and opens a PR
  • Update nightly scanner to always run the documentation sub-agent and use separate issue budgets (2 bug/security + 1 documentation per run)

Test plan

  • Add kind/bug label to a test issue — verify workflow triggers
  • Test RESULT:NEEDS_INFO path — verify comment posted and status/needs-info label added
  • Test RESULT:FIXED path — verify branch created, PR opened, issue commented with PR link
  • Test RESULT:NO_CHANGES path — verify no branch/PR created
  • Verify GitHub App permissions include Contents: Write (new requirement)
  • Verify auto-review triggers on the opened PR
  • Verify failure notification posts a comment if push or PR creation fails

Closes: https://github.com/docker/gordon/issues/177

Add a GitHub Actions workflow and cagent agent config that automatically
triages bug reports when labeled `kind/bug`. The agent evaluates if the
report has enough info, asks for details if not, or implements a fix and
opens a draft PR.
@derekmisler
Copy link
Contributor Author

/review

Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR adds a useful auto-triage workflow for bug reports. The overall approach is sound, but there are a few error handling gaps that could lead to silent failures or poor user experience when things go wrong. The main issues are around handling failed agent steps and push failures without notifying the issue author.

Verdict: COMMENT — See inline comments for details.

Triage workflow:
- Add continue-on-error to agent, push, and PR steps
- Add fallback notification step so issue authors always get feedback
- Parse result marker from last line only (prevents false positives)

Nightly scanner:
- Always run documentation sub-agent regardless of bug/security findings
- Separate issue budgets: 2 bug/security + 1 documentation per run
@derekmisler
Copy link
Contributor Author

/review

@derekmisler derekmisler marked this pull request as ready for review March 2, 2026 21:08
@derekmisler derekmisler requested a review from a team as a code owner March 2, 2026 21:08
docker-agent[bot]
docker-agent bot previously approved these changes Mar 2, 2026
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I've reviewed this PR that adds an auto-triage workflow for GitHub issues. The workflow is well-designed with proper error handling and safeguards:

Error Handling: The workflow uses continue-on-error: true appropriately to allow graceful degradation. Failed steps are caught by checking step outcomes explicitly (steps.push.outcome == 'failure'), and the notification step correctly notifies on failures.

Logic Flow: The workflow properly validates that actual code changes exist before attempting git operations. The conditional checks prevent empty commits when the agent reports RESULT:FIXED without making changes.

Security: The workflow only triggers on maintainer-applied labels (kind/bug), which mitigates potential prompt injection risks. The elevated permissions are documented and appropriate for the fix+PR path.

Result Parsing: The result marker parsing is robust enough for the defined agent contract. While it strips whitespace, it provides a warning and defaults to safe behavior if parsing fails.

The design shows thoughtful consideration of failure modes and edge cases. No blocking issues found.

@derekmisler
Copy link
Contributor Author

/review

@docker-agent
Copy link

docker-agent bot commented Mar 2, 2026

PR Review Failed — The review agent encountered an error and could not complete the review. View logs.

@derekmisler
Copy link
Contributor Author

derekmisler commented Mar 2, 2026

PR Review Failed — The review agent encountered an error and could not complete the review. View logs.

yes i know i canceled it

Auto-review checks org membership, which bots fail. The /review command
path (manual-review job) bypasses the org check, so we need to post the
comment explicitly. Requires docker/cagent-action#65 to allow the bot.
docker-agent[bot]
docker-agent bot previously requested changes Mar 2, 2026
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Found 1 issue requiring changes. The workflow creates a non-draft PR despite code comments and PR body indicating the intent for a review-first draft PR workflow.

Issue Type: Logic error
Severity: High
Status: Requires changes

@derekmisler
Copy link
Contributor Author

derekmisler commented Mar 3, 2026

@dgageot @trungutt i don't want to merge this PR just yet, because i had to temporarily disable the agent's content:write permission (which is required for it to open PRs). we have a couple of new repos without branch protections, and that permission allows a person to merge a PR with just the approval of the agent.

ok!

@derekmisler derekmisler merged commit c586766 into docker:main Mar 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants