Skip to content

feat(agents): triage fires on comments + claude-triaging lifecycle label#3146

Merged
bokelley merged 1 commit intomainfrom
bokelley/triage-comment-trigger
Apr 25, 2026
Merged

feat(agents): triage fires on comments + claude-triaging lifecycle label#3146
bokelley merged 1 commit intomainfrom
bokelley/triage-comment-trigger

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Three coordinated changes to the triage routine + workflow + playbook to close the gaps surfaced by #3112 (webhook miss with no audit trail) and #937 / #935 (PR-drafting linkage).

What changes

1. Workflow fires on issue_comment.created

The routine prompt has long had an issue_comment.created branch — but the workflow never fired on plain comments, only on issues.opened/reopened and repository_dispatch (the slash-command-dispatch path). So the prompt's comment-handling logic was dead code. This PR adds the trigger with self-loop / bot / /triage / PR-conversation filtering:

issue_comment:
  types: [created]

The if: filter for the new path:

  • Skip bot authors (comment.user.type / [bot] suffix / sender.type)
  • Skip self-loops (comment body contains Triaged by Claude Code footer)
  • Skip /triage slash-commands (handled by the existing repository_dispatch path)
  • Skip PR conversation comments (issue.pull_request != null — those are auto-fix's job)

The workflow now has three event kinds: auto.opened/reopened, comment.created, manual.triage.

2. claude-triaging lifecycle label

The routine takes 1-3 minutes between fire and posting an outcome. During that window, humans had no signal that triage was active and might start a parallel PR. New rule: routine applies claude-triaging immediately after concurrency + already-engaged checks pass, swaps to claude-triaged at end of run. Skip cases (concurrency-skip, already-engaged-defer, non-substantive comments) leave the label off entirely. If the routine errors mid-run, claude-triaging is left orphaned — a future scheduled sweep should clear stuck labels >30 min old.

Label created in adcontextprotocol/adcp (color #FBCA04) ahead of this merge. Sibling repos (adcp-client, adcp-client-python, adcp-go) need the label created before the same change flows there.

3. Manual triage docs in .agents/playbook.md

New "Triage Routine — Manual Nudge" section documenting:

  • What triggers triage (/triage slash-command, automatic on issue open, plain comments via the new event path)
  • What does not trigger triage (prose pings without /triage, PR conversation comments, bot authors, self-loops)
  • How to read the claude-triaging vs claude-triaged lifecycle states
  • How to recover from webhook misses (comment /triage to retrigger)

Motivated by #3112 — a "Pinging triage" prose comment didn't fire the routine because slash-command-dispatch only matches the literal /triage token. The doc makes this discoverable so humans don't waste cycles waiting on a routine that was never going to wake up.

Follow-ups (not in this PR)

  • Create claude-triaging label in adcp-client, adcp-client-python, adcp-go.
  • Replicate the workflow + routine prompt + playbook changes to those three repos.
  • File issue for orphaned-label sweep (clear claude-triaging stuck >30 min) — useful but not blocking.
  • File issue for silent-webhook-miss recovery — periodic sweep that catches issues opened in last 24h with no triage workflow run and fires manually.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Three coordinated changes to the triage routine + workflow + playbook:

1. **Workflow fires on issue_comment.created** with self-loop / bot /
   /triage / PR-conversation filtering. Plain prose comments now
   reach the routine through the new `comment.created` event kind
   (previously the routine prompt's issue_comment.created branch was
   dead logic — workflow only fired on issues.opened/reopened and
   repository_dispatch).

2. **`claude-triaging` lifecycle label.** Routine applies it
   immediately after concurrency + already-engaged checks pass, swaps
   to `claude-triaged` at end of run. Gives humans a visible "I'm on
   this, don't open a parallel PR" signal during the 1-3 min triage
   window. Skip cases (concurrency-skip, already-engaged-defer, non-
   substantive comments) leave the label off entirely.

3. **Manual triage docs in playbook.** New "Triage Routine — Manual
   Nudge" section explains the slash-command syntax, what does/does
   not trigger triage, how to read claude-triaging vs claude-triaged,
   and how to recover from webhook misses. Motivated by issue #3112
   where a "Pinging triage" prose comment didn't fire the routine
   because the slash-command-dispatch only matches the literal
   `/triage` token.

Workflow filter prevents loops by skipping comments that contain the
`Triaged by Claude Code` footer (the routine's own signature).
PR-conversation comments (issue.pull_request != null) skip too —
those are the auto-fix feature's territory, not triage.

`claude-triaging` label created in adcontextprotocol/adcp ahead of
this merge; sibling repos need the label created before this change
flows there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit a159335 into main Apr 25, 2026
12 checks passed
@bokelley bokelley deleted the bokelley/triage-comment-trigger branch April 25, 2026 14:25
bokelley added a commit to adcontextprotocol/adcp-client that referenced this pull request Apr 25, 2026
…bel (#992)

Mirrors the changes from adcontextprotocol/adcp#3146 + #3155:

- Workflow fires on issue_comment.created with self-loop / bot /
  /triage / PR-conversation filtering. Plain comments now reach the
  routine through the new comment.created event kind.
- claude-triaging lifecycle label: routine applies it after the
  concurrency + already-engaged checks pass, swaps to claude-triaged
  at end of run. Gives humans a visible "I'm on this" signal.
- Manual triage docs in .agents/routines/README.md.
- clear-stuck-claude-triaging.yml: cron every 30 min clears orphaned
  labels on issues stuck >30 min.
- triage-webhook-miss-sweep.yml: cron hourly catches issues opened in
  last 24h that the issues.opened webhook silently missed.
- .agents/scripts/triage-local.sh: local fire script.

claude-triaging label created in this repo ahead of merge.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bokelley added a commit to adcontextprotocol/adcp-client-python that referenced this pull request Apr 25, 2026
…bel (#277)

Mirrors the changes from adcontextprotocol/adcp#3146 + #3155:

- Workflow fires on issue_comment.created with self-loop / bot /
  /triage / PR-conversation filtering. Plain comments now reach the
  routine through the new comment.created event kind.
- claude-triaging lifecycle label: routine applies it after the
  concurrency + already-engaged checks pass, swaps to claude-triaged
  at end of run. Gives humans a visible "I'm on this" signal.
- Manual triage docs in .agents/routines/README.md.
- clear-stuck-claude-triaging.yml: cron every 30 min clears orphaned
  labels on issues stuck >30 min.
- triage-webhook-miss-sweep.yml: cron hourly catches issues opened in
  last 24h that the issues.opened webhook silently missed.
- .agents/scripts/triage-local.sh: local fire script.

claude-triaging label created in this repo ahead of merge.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bokelley added a commit to adcontextprotocol/adcp-go that referenced this pull request Apr 25, 2026
…bel (#93)

Mirrors the changes from adcontextprotocol/adcp#3146 + #3155:

- Workflow fires on issue_comment.created with self-loop / bot /
  /triage / PR-conversation filtering. Plain comments now reach the
  routine through the new comment.created event kind.
- claude-triaging lifecycle label: routine applies it after the
  concurrency + already-engaged checks pass, swaps to claude-triaged
  at end of run. Gives humans a visible "I'm on this" signal.
- Manual triage docs in .agents/routines/README.md.
- clear-stuck-claude-triaging.yml: cron every 30 min clears orphaned
  labels on issues stuck >30 min.
- triage-webhook-miss-sweep.yml: cron hourly catches issues opened in
  last 24h that the issues.opened webhook silently missed.
- .agents/scripts/triage-local.sh: local fire script.

claude-triaging label created in this repo ahead of merge.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant