Skip to content

feat: review agent opens a fix ticket with an AI-agent prompt - #178

Closed
k5s-bot[bot] wants to merge 1 commit into
mainfrom
feat/review-agent-opens-fix-ticket
Closed

feat: review agent opens a fix ticket with an AI-agent prompt#178
k5s-bot[bot] wants to merge 1 commit into
mainfrom
feat/review-agent-opens-fix-ticket

Conversation

@k5s-bot

@k5s-bot k5s-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

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 same owner/repo — that:

  1. Summarizes every finding, citing file:line and linking back to the reviewed PR, and
  2. Ends with a ready-to-run fix prompt for an AI coding agent (goal, affected files, concrete acceptance criteria), fenced in a text code block.

The ticket and the review both tell maintainers that applying the new fixLabelName (default ai-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-triage fix loop that already exists in this repo.

How it fits the existing design

  • Purely a promptTemplate change on the existing PR-review IntegrationRoute — no new CRD, controller, or gateway code.
  • gh issue create is already permitted by the github tool allowlist (tools/github/src/allowlist.ts).
  • No self-trigger risk: opening an issue is not a trigger — the gateway acts only when the trigger label is applied, and it drops bot-authored events. A clean approval opens no ticket.
  • New fixLabelName value (default ai-triage) is documented with a note that it must equal integration-gateway's config.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 review 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.

Testing notes

No unit/helm-template snapshot tests cover these route templates, and helm is not available in this environment, so the change was validated by manual inspection of the rendered Go-template/YAML structure. Worth a helm template lint in CI before merge.

🤖 Generated with Claude Code

…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
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.

2 participants