Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

GitHub inbox: add an automation rule from any item so similar items are handled on Autopilot

Closed
#13,192 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #13231 by @atomantic — merged

Assessment

This issue has not been assessed yet.

Description

area:devtools effort:high enhancement model:heavy plan

Problem

Agent rules cover only three notification kinds (GITHUB_AGENT_RULE_KINDS: review-request, security-alert, issue-activity) and one action, start an agent or don't. They are created only from the Automations tab. While going through the inbox, the operator wants to tap Add automation rule on any item and have every similar item handled the same way on Autopilot. Examples: "every default-branch CI failure in this repo → mark done", "every subscribed issue in this repo → resolve with agent".

Learned rules (github_notification_rules, keyed on repo × reason × actor) already do part of this, but only by inference from Done/Mute taps. They need two matching corrections before they quiet anything, and they cannot start an agent.

Decision

Extend agent rules into automation rules and let them be created from a row.

  • Kinds (GITHUB_AGENT_RULE_KINDS, RULE_KINDS / threadAgentKind in lib/githubNotificationTriage.js, AGENT_RULE_KINDS in githubTriageLabels.js): add ci-failure, own-pr, mention, release and other to the existing three. threadAgentKind stays the single classifier and is derived from reason and subject type only.
  • Action replaces the agent: boolean field: action: 'agent' | 'done' | 'mute' | 'leave'. Stored agent: true/false rules are read as agent/leave. Coerce on read; validate on write. Agent rules keep their provider/model/effort pin.
  • Apply: Autopilot runs agent rules through the lane selection from the generic resolve-with-agent issue. Assist and Autopilot apply done and mute rules as automation actions (undoable, logged). The rules never override the suspect, security-alert or invitation pins (PINNED_RULES), and an agent rule on an outside thread still routes only to screened lanes.
  • From a row: the row's overflow gets Add automation rule…, which opens the rule form prefilled with this thread's kind and repo. "All repos" is one click away. The form shows how many open threads the rule would match right now, and offers "Apply to these N now" on save.
  • Parity guard: CANDIDATE_SQL in githubNotificationAutopilot.js is a hand-written SQL mirror of agentHandoff + agentRuleScope. Add a table-driven test that runs one fixture per kind × action through both the JS planner and the SQL candidate query (DB test), and fails on any disagreement. Without it, a kind added in JS silently never runs on Autopilot.

Affected files

  • server/lib/validation.js: the rule schema (action, the new kinds; legacy agent still accepted).
  • server/lib/githubNotificationTriage.js: threadAgentKind, matchAgentRule, agentRuleScope, autopilotHandoff, a new ruleAction.
  • server/services/githubNotificationAutopilot.js: CANDIDATE_SQL, rule-driven done/mute.
  • server/services/githubNotificationAssist.js: applying done/mute rules.
  • client/src/components/github/GitHubAgentRules.jsx, GitHubInboxTab.jsx, githubTriageLabels.js.
  • server/services/githubNotifications.db.test.js: the parity test.

Acceptance criteria

  • From an inbox row, the operator can save "CI failures in repo X → done". The next Autopilot or Assist run marks every matching open thread done, as undoable automation events.
  • A stored legacy { agent: true } rule still hands off exactly as before.
  • A done rule never acts on a suspect thread or a security alert.
  • The JS/SQL parity test goes red when a kind is added to threadAgentKind without CANDIDATE_SQL (verified by breaking it once).

model:heavy / effort:high: a schema change with a legacy-read contract, plus a JS↔SQL invariant that has to stay mirrored.

The agent action on kinds with no lane today depends on #13191; the done / mute actions can ship first.

Dominant language
JavaScript
Stars
38
Forks
32
Avg merge
41m
Merged PRs (30d)
991

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from atomantic/PortOS

All issues in atomantic/PortOS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.