Skip to content

Automations overhaul#183

Merged
arul28 merged 10 commits intomainfrom
ade/automations-overhaul-7de750d0
Apr 23, 2026
Merged

Automations overhaul#183
arul28 merged 10 commits intomainfrom
ade/automations-overhaul-7de750d0

Conversation

@arul28
Copy link
Copy Markdown
Owner

@arul28 arul28 commented Apr 23, 2026

Summary by CodeRabbit

Release Notes

New Features

  • Added support for multiple automation action types: ADE actions, agent-session steps, and mission launches
  • Integrated GitHub event polling to automatically trigger automations based on issue and pull request lifecycle events
  • Enhanced CLI with comprehensive automations command group for managing rules, running automations, and viewing execution history
  • Introduced automation action registry with domain/action discovery and allowlisting
  • Added GitHub repository management capabilities (detect repos, manage labels, comments, and issue states)
  • New automation templates including AI-powered issue triage and PR commenting
  • Expanded automation trigger filtering with GitHub-specific options (authors, title/body regex, repo scoping)

Bug Fixes

  • Fixed CI workflow dependency tracking to properly account for installation outcomes

Chores

  • Refactored component imports and styling consolidation for settings modules

Greptile Summary

This PR is a large automations overhaul adding GitHub polling-based triggers (issues, PRs, comments, reviews), Linear relay dispatch, three new built-in action types (ade-action, agent-session, launch-mission), a shared ADE action registry, and a significantly redesigned rule editor UI. Several bugs flagged in the previous review round have been addressed (Linear dispatch now fires correctly, comment cursor uses created_at#id for deduplication, PR snapshot written after cursor init, hasPrContentChange guards github.pr_updated from false fires).

  • The review cursor in pollReviews stores only submitted_at with no review-ID tiebreaker, so two reviews submitted in the same ISO second cause one to be permanently dropped — the same fix applied to the comment cursor (id suffix) is needed here.
  • resolvePlaceholders returns null (not the original placeholder string) when a whole-match path resolves to null; the prompt builder's fallback then sends the literal template text to the agent instead of an empty string.

Confidence Score: 3/5

One P1 defect (review cursor deduplication) means github.pr_review_submitted automations can silently drop events; the P2 null-placeholder bug sends unexpanded templates to agents.

Previous P0/P1 comments from the prior round are largely resolved (linear dispatch, comment cursor, snapshot ordering, action.timeoutMs multiplication). The review cursor still lacks the ID tiebreaker correctly added to the comment cursor — a concrete data-loss defect for the new github.pr_review_submitted trigger path. The null-value propagation in resolvePlaceholders produces confusing agent prompts. Together these merit a 3/5.

apps/desktop/src/main/services/automations/githubPollingService.ts (review cursor), apps/desktop/src/main/services/automations/automationService.ts (resolvePlaceholders null case)

Important Files Changed

Filename Overview
apps/desktop/src/main/services/automations/githubPollingService.ts New polling service for GitHub issues and PRs; comment cursor deduplication fixed correctly but review cursor lacks ID tiebreaker (P1); issue_edited blocked by label-check condition (P2)
apps/desktop/src/main/services/automations/automationService.ts Major overhaul adding ade-action, agent-session, launch-mission action types, extracted triggerMatches to module level, added placeholder resolution; null propagation in resolvePlaceholders whole-match path (P2)
apps/desktop/src/main/services/adeActions/registry.ts New ADE action registry with hardcoded allowlist; clean allowlist/service-map design; no issues found
apps/desktop/src/main/main.ts Wires GitHub polling service and Linear automation dispatch; Linear dispatch fix now correctly applied inside the event.issueId branch
apps/desktop/src/main/services/github/githubService.ts Adds paginated listing helpers, ETag cache extended to store link headers for pagination, new issue/PR management methods; looks correct
apps/desktop/src/renderer/components/automations/components/RuleEditorPanel.tsx Significant UI overhaul splitting trigger families into GitHub/Linear/schedule/local-git/etc.; no logic issues found
apps/desktop/src/shared/types/automations.ts Adds structured trigger context types, new ingress sources, new action draft types; removes needs_review run status; clean changes
apps/desktop/src/shared/types/config.ts Adds canonical github.* trigger types, legacy alias map, RunAdeActionConfig type, ade-action action type; well-documented

Comments Outside Diff (1)

  1. apps/desktop/src/main/services/automations/automationService.ts, line 171-174 (link)

    P1 Branch filter silently fails for github.pr_commented and github.pr_review_submitted

    isPrCanonical guards whether branch matching uses trigger.branch (the PR's head branch) or laneBranch. It currently excludes github.pr_commented and github.pr_review_submitted, so for those types laneBranch is used. GitHub-polling events have no lane, so laneBranch is undefined, and any rule with branch set will never match a PR-comment or PR-review-submitted event.

    const isPrCanonical =
      canonicalType === "github.pr_opened"
      || canonicalType === "github.pr_updated"
      || canonicalType === "github.pr_closed"
      || canonicalType === "github.pr_commented"
      || canonicalType === "github.pr_review_submitted";
    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/desktop/src/main/services/automations/automationService.ts
    Line: 171-174
    
    Comment:
    **Branch filter silently fails for `github.pr_commented` and `github.pr_review_submitted`**
    
    `isPrCanonical` guards whether branch matching uses `trigger.branch` (the PR's head branch) or `laneBranch`. It currently excludes `github.pr_commented` and `github.pr_review_submitted`, so for those types `laneBranch` is used. GitHub-polling events have no lane, so `laneBranch` is `undefined`, and any rule with `branch` set will never match a PR-comment or PR-review-submitted event.
    
    ```ts
    const isPrCanonical =
      canonicalType === "github.pr_opened"
      || canonicalType === "github.pr_updated"
      || canonicalType === "github.pr_closed"
      || canonicalType === "github.pr_commented"
      || canonicalType === "github.pr_review_submitted";
    ```
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code

Fix All in Claude Code

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/desktop/src/main/services/automations/githubPollingService.ts
Line: 447-466

Comment:
**Review cursor has no ID tiebreaker — simultaneous reviews permanently skipped**

Unlike the comment cursor (which was correctly fixed to use `created_at#id` for stable ordering), the review cursor stores only a `submitted_at` string. If two reviews are submitted within the same ISO second, the first advances the cursor to that timestamp, and on the next poll `submittedAt <= cursor` is true for the second review — it is silently skipped forever.

The fix is the same pattern already used for comments: store `submitted_at#review.id` as the cursor value and compare both timestamp and id when skipping.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/desktop/src/main/services/automations/automationService.ts
Line: 357-365

Comment:
**`null`-valued placeholder returns `null` instead of original string**

`readTriggerPath` can return `null` when a trigger field exists but is explicitly `null` (e.g. `trigger.pr.body` is `null` for a PR with no description). The whole-match guard only skips the substitution for `undefined`:

```ts
return value === undefined ? node : value; // returns null when value === null
```

So a prompt that is exactly `"{{trigger.pr.body}}"` with a null body returns `null`, fails the `typeof === "string"` check in the prompt builder, and the agent receives the literal `{{trigger.pr.body}}` instead of an empty string.

```ts
// Fix:
return value === undefined || value === null ? node : value;
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/desktop/src/main/services/automations/githubPollingService.ts
Line: 335-344

Comment:
**`github.issue_edited` suppressed when a label change and content change occur together**

The `issue_edited` dispatch condition requires `!addedLabels.length`, so if a label is added in the same `updated_at` tick as a title/body edit, only `github.issue_labeled` fires. Rules targeting `github.issue_edited` to react to content changes miss this case. The two events are not mutually exclusive and both should be dispatched.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (8): Last reviewed commit: "ship: fix pr review trigger branch filte..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Loading
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