Skip to content

Add an issue_opened trigger and triage template for new GitHub issues - #1627

Merged
currentbits merged 3 commits into
mainfrom
coder/triage-agent-for-inbound-issues-classify-ff67c3
Oct 13, 2026
Merged

currentbits merged 3 commits into
mainfrom
coder/triage-agent-for-inbound-issues-classify-ff67c3

Conversation

@currentbits

Copy link
Copy Markdown
Owner

What changed

Inbound GitHub issues can now go through a triage automation before anything is dispatched. Only well-formed issues get to plan:todo, which is the only column auto-dispatch picks up (#258).

New issue_opened trigger (electron/automation-triggers.js)

  • Polls /repos/:owner/:repo/issues (the 30 most recent by creation date) and fires once per new issue.
  • /issues also returns PRs. PRs still advance the baseline because they share the number sequence, but they never fire the trigger.
  • The issue's title, author, labels and a body excerpt go into the prompt. Agents need the body for triage and no planboard tool returns it. The excerpt is capped at 1500 characters so 20 issues still make a reasonable prompt. Issue bodies are attacker-controlled, so the excerpt is wrapped in the existing untrusted-body banner.
  • fetchSource now looks up its endpoint in a path map instead of using nested ternaries.

New issue_label planboard tool (electron/orchServer.js, electron/issues.js, electron/gitlab.js)

  • Adds non-plan labels (type, priority, duplicate, needs-info) to an issue on the thread's own origin.
  • plan:* labels are refused, and the error points to issue_set_plan so plan columns stay exclusive.
  • On GitHub, a "not found" error from gh issue edit makes it create the missing labels and retry once. On GitLab it goes through a new addLabels (PUT add_labels), since GitLab creates missing labels when they're assigned.
  • Rejects empty label lists, label names containing commas and invalid issue numbers. It never throws.

Triage template (src/automations.ts, AutomationsView.tsx)

  • The create form has a new "Use triage template" button. It fills in an issue_opened automation with a prompt that does four things:
    1. Classifies the issue with a type and a priority.
    2. Dedupes it against existing issues, labelling and commenting on duplicates.
    3. Asks 1–3 specific questions and labels the issue needs-info when it's underspecified.
    4. Otherwise sets it to plan:todo.
  • The prompt tells the agent to treat issue bodies as data, to skip issues that already have a plan:* label, and never to write code or close issues.

Plumbing and docs

  • Added issue_opened to AutomationTriggerEvent, the trigger labels, the automation_create schema and the agent instructions and notes.
  • Updated the README and site/docs.html.

Tests

  • automation-triggers.test.js: PRs move the baseline but don't match, and the body is quoted and truncated.
  • orch-planboard.test.js: issue_label creates the missing labels and retries, and refuses plan:* without calling gh.
  • automationsView.test.tsx: the triage button fills in an issue_opened automation and it submits.

🤖 Generated with Claude Code

Solenta and others added 2 commits October 13, 2026 16:12
Solenta-Message-Id: c348b083-b91f-4578-baed-cbf80ee6fddf
- issue_opened automation trigger: polls /issues, skips PRs, and quotes a
  capped, injection-scanned body excerpt into the trigger note.
- issue_label planboard tool: adds non-plan labels on the host, creating
  missing GitHub labels; plan:* stays with issue_set_plan.
- "Use triage template" in Automations: classify, dedupe, ask clarifying
  questions (needs-info), and set plan:todo only for well-formed issues,
  which keeps unclear work out of auto-dispatch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T14:35:42.549038Z 9e08b09 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e08b09e9e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

: "\n > (empty body)";
matched.push({
key,
text: `Issue #${key} opened by ${r.user?.login || "?"}: ${r.title || ""}${labels.length ? ` [${labels.join(", ")}]` : ""} (${r.html_url || `${web}/issues/${key}`})${quoted}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Treat the entire issue record as untrusted

On a public repository, the reporter controls the title and labels as well as the body, but the title and labels are interpolated directly into an unattended agent prompt outside the quoted body. Moreover, bannerUntrustedBody returns the body unchanged when its regexes find no match or guardrails are disabled. A malicious title or scanner-evading body can therefore instruct the agent to misuse its coding and issue-write tools. Apply an unconditional untrusted-data boundary to the complete issue record, not just conditionally detected body text.

Useful? React with 👍 / 👎.

});
break;
}
case "issue_opened": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve issues omitted by the 20-event prompt cap

When at least 21 issues arrive before the next successful poll—especially while a previous triage run keeps polling suspended—all of them enter fresh, but formatTriggerNote sends only the newest 20 while pollTriggers advances the cursor through the entire batch. The older issues reported as “omitted” are therefore never presented to any later triage run and never reach plan:todo; advance the cursor only through delivered items or process the remainder in subsequent batches.

Useful? React with 👍 / 👎.

Comment thread electron/issues.js
let errText = edited.stderr || edited.combined || edited.stdout || "";
if (!edited.ok && !edited.enoent && /not found/i.test(errText) && !isIssueNotFound(errText)) {
// Already-existing labels fail `label create`; that is fine.
for (const name of names) await ghApiTryAsync(cwd, ["label", "create", name], ghOpts);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Create missing labels through the API path

In an API-token configuration where gh is absent or not authenticated, the initial API-backed edit correctly detects a missing label, but this recovery invokes the CLI-only gh label create <name> command (the usage shown by gh label create --help). github.ghIssue does not translate that command, so ghApiTryAsync falls back to the unavailable CLI; the ignored creation failure leaves the retry failing with the same missing-label error. Add an API translation or REST label-creation call so stored-token users can use the advertised missing-label behavior.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit da86da6 into main Oct 13, 2026
6 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.

1 participant