Repository navigation
Add an issue_opened trigger and triage template for new GitHub issues - #1627
Conversation
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]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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}`, |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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 👍 / 👎.
| 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); |
There was a problem hiding this comment.
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 👍 / 👎.
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_openedtrigger (electron/automation-triggers.js)/repos/:owner/:repo/issues(the 30 most recent by creation date) and fires once per new issue./issuesalso returns PRs. PRs still advance the baseline because they share the number sequence, but they never fire the trigger.fetchSourcenow looks up its endpoint in a path map instead of using nested ternaries.New
issue_labelplanboard tool (electron/orchServer.js,electron/issues.js,electron/gitlab.js)duplicate,needs-info) to an issue on the thread's own origin.plan:*labels are refused, and the error points toissue_set_planso plan columns stay exclusive.gh issue editmakes it create the missing labels and retry once. On GitLab it goes through a newaddLabels(PUT add_labels), since GitLab creates missing labels when they're assigned.Triage template (
src/automations.ts,AutomationsView.tsx)issue_openedautomation with a prompt that does four things:needs-infowhen it's underspecified.plan:todo.plan:*label, and never to write code or close issues.Plumbing and docs
issue_openedtoAutomationTriggerEvent, the trigger labels, theautomation_createschema and the agent instructions and notes.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_labelcreates the missing labels and retries, and refusesplan:*without callinggh.automationsView.test.tsx: the triage button fills in anissue_openedautomation and it submits.🤖 Generated with Claude Code