feat: review agent opens a fix ticket with an AI-agent prompt - #178
Closed
k5s-bot[bot] wants to merge 1 commit into
Closed
feat: review agent opens a fix ticket with an AI-agent prompt#178k5s-bot[bot] wants to merge 1 commit into
k5s-bot[bot] wants to merge 1 commit into
Conversation
…I-agent prompt When the PR review route (`github-pr-labeled-review`) is triggered and its review leaves comments requesting a change, the agent now also opens one follow-up tracking ticket -- a GitHub issue in the same owner/repo -- that: - summarizes every finding, citing file:line and linking back to the PR, and - ends with a ready-to-run fix prompt for an AI coding agent (goal, affected files, acceptance criteria) fenced in a code block. The ticket and the review tell maintainers that applying the new `fixLabelName` (default `ai-triage`, kept equal to the triage/trigger label) dispatches an SWE agent to implement the fix -- closing the loop from "review found a problem" to "an agent can fix it" without a human re-transcribing the review into a prompt. Opening the ticket is not itself a trigger: the gateway acts only when the trigger label is applied and drops bot-authored events, so the review agent cannot self-trigger the fix. A clean approval opens no ticket. - charts/community-components/templates/integrationroute-github-pr-labeled-review.yaml: extend promptTemplate; reference `fixLabelName`. - charts/community-components/values.yaml, values-production.yaml: add `fixLabelName` (default ai-triage) with rationale. - docs/integrations-gateway.md: document the review -> fix-ticket handoff. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVPvk7tESW3ooaGT8Ar82q
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
When the PR review route (
github-pr-labeled-review) is triggered and its review leaves comments requesting a change, the review agent now also opens a follow-up tracking ticket — a GitHub issue in the sameowner/repo— that:file:lineand linking back to the reviewed PR, andtextcode block.The ticket and the review both tell maintainers that applying the new
fixLabelName(defaultai-triage, kept equal to the triage/trigger label the triage routes react to) to that ticket will dispatch an SWE agent to implement the fix. This closes the loop from "review found a problem" to "an agent can fix it" without a human re-transcribing the review into a prompt.Why
Today the review agent only posts review comments; acting on them means a human re-reads the review and hand-writes a fix prompt. This makes the review the source of an actionable, AI-dispatchable fix ticket, using the existing
ai-triagefix loop that already exists in this repo.How it fits the existing design
promptTemplatechange on the existing PR-reviewIntegrationRoute— no new CRD, controller, or gateway code.gh issue createis already permitted by the github tool allowlist (tools/github/src/allowlist.ts).fixLabelNamevalue (defaultai-triage) is documented with a note that it must equalintegration-gateway'sconfig.githubTriggerLabel, so the ticket never advertises a label nothing is listening for.Scope
Limited to PR review (
github-pr-labeled-review) — the canonical "leaves comments" case. The issue-review route comments on an existing issue (which is already the ticket), so opening a new ticket there would be redundant and is intentionally left unchanged.Files changed
charts/community-components/templates/integrationroute-github-pr-labeled-review.yaml— extend the reviewpromptTemplate; referencefixLabelName.charts/community-components/values.yaml,values-production.yaml— addfixLabelName(defaultai-triage) with rationale.docs/integrations-gateway.md— document the review → fix-ticket handoff.Testing notes
No unit/helm-template snapshot tests cover these route templates, and
helmis not available in this environment, so the change was validated by manual inspection of the rendered Go-template/YAML structure. Worth ahelm templatelint in CI before merge.🤖 Generated with Claude Code