Skip to content

Automation Model Launch -> Primary - #1047

Merged
arul28 merged 3 commits into
mainfrom
ade/automation-model-launch
Aug 6, 2026
Merged

Automation Model Launch -> Primary#1047
arul28 merged 3 commits into
mainfrom
ade/automation-model-launch

Conversation

@arul28

@arul28 arul28 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

ADE   Open in ADE  ·  ade/automation-model-launch branch  ·  PR #1047

Summary by CodeRabbit

  • Bug Fixes
    • Scheduled automations now use the latest rule settings, including model, provider, reasoning, and session limits.
    • Updated schedules replace outdated callbacks, preventing stale or duplicate runs.
    • Deleted or disabled automations no longer launch scheduled executions.
    • Automation runs now retain the correct automation association.
    • Queued scheduled occurrences are suppressed when an automation is disabled during an active run.
    • Schedule changes are applied safely without triggering obsolete executions.

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Aug 6, 2026 5:02pm

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@arul28, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 67d72eec-bf8e-4eb4-8651-6673f6f88403

📥 Commits

Reviewing files that changed from the base of the PR and between 5338c04 and d762325.

📒 Files selected for processing (2)
  • apps/desktop/src/main/services/automations/automationService.test.ts
  • apps/desktop/src/main/services/automations/automationService.ts
📝 Walkthrough

Walkthrough

The automation service now tracks cron expressions, replaces changed schedules, validates current rule state before execution, suppresses stale runs, and handles nullable run results. Integration tests cover configuration reloads, updated execution settings, stale callbacks, and disabled queued occurrences.

Changes

Cron schedule reload handling

Layer / File(s) Summary
Schedule task synchronization
apps/desktop/src/main/services/automations/automationService.ts
Cron tasks retain their expressions. Configuration reloads replace tasks with changed expressions and stop stale tasks.
Validated schedule execution
apps/desktop/src/main/services/automations/automationService.ts
Scheduled callbacks re-read the current rule and trigger. They suppress deleted, disabled, unscheduled, or changed schedules. Valid runs carry schedule metadata and nullable results through the run queue.
Manual execution and integration validation
apps/desktop/src/main/services/automations/automationService.ts, apps/desktop/src/main/services/automations/automationService.test.ts
Manual execution reports configuration changes with an explicit error. Integration tests verify updated settings, replacement callbacks, stale callbacks, and disabled queued occurrences.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • arul28/ADE#765: Both PRs modify automationService scheduling behavior and integration tests.

Suggested labels: desktop

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes an automation model launch change, but the changes update scheduled automation revalidation, callback replacement, and stale execution handling. Rename the pull request to describe scheduled automation revalidation after configuration changes and suppression of stale executions.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/automation-model-launch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop/src/main/services/automations/automationService.ts (1)

3497-3546: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Revalidate the rule inside the serialized queue.

Line 3537 passes the captured currentRule to runRule. If another run already occupies the per-rule queue, a reload can disable the rule or change its schedule or permissions before this run starts. The queued run then executes the obsolete configuration.

Re-read and validate the rule after the queue becomes available and before runRuleNow starts. Skip the claimed occurrence when the rule is disabled or its trigger no longer matches. Add a named regression test: skips a queued scheduled occurrence after config reload. Start a blocking run, fire the schedule callback, reload a disabled or changed rule, release the first run, and assert that no second session starts.

As per coding guidelines, “For computer-use changes, enforce policy and artifact ownership in code paths rather than relying only on prompts.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/desktop/src/main/services/automations/automationService.ts` around lines
3497 - 3546, The scheduled callback currently passes the captured currentRule
into runRule, allowing queued executions to use stale configuration. Update the
per-rule queued execution path around runRule and runRuleNow to re-read and
validate the rule after the queue is available, skipping the claimed occurrence
when the rule is missing, disabled, or its schedule trigger no longer matches;
add the regression test named “skips a queued scheduled occurrence after config
reload” covering a blocked run, config reload, release, and assertion that no
second session starts.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@apps/desktop/src/main/services/automations/automationService.ts`:
- Around line 3497-3546: The scheduled callback currently passes the captured
currentRule into runRule, allowing queued executions to use stale configuration.
Update the per-rule queued execution path around runRule and runRuleNow to
re-read and validate the rule after the queue is available, skipping the claimed
occurrence when the rule is missing, disabled, or its schedule trigger no longer
matches; add the regression test named “skips a queued scheduled occurrence
after config reload” covering a blocked run, config reload, release, and
assertion that no second session starts.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 612c7e73-7a05-4349-9a6f-187c6388c20a

📥 Commits

Reviewing files that changed from the base of the PR and between 3314740 and 0b0839e.

📒 Files selected for processing (2)
  • apps/desktop/src/main/services/automations/automationService.test.ts
  • apps/desktop/src/main/services/automations/automationService.ts

@arul28

arul28 commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/desktop/src/main/services/automations/automationService.ts`:
- Around line 3251-3272: Update the promise callback before runRuleNow in
runRule so manual triggers execute using the rule selected by triggerManually
before applying the stale-rule guard, while disabled or missing automations
retain their distinct manual-run outcome. Keep stale suppression for
queued/non-manual executions, and move the suppression log so every suppressed
trigger is logged rather than only schedule triggers.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d2842920-bd80-4916-a6f4-1e50768ffd1d

📥 Commits

Reviewing files that changed from the base of the PR and between 0b0839e and 5338c04.

📒 Files selected for processing (2)
  • apps/desktop/src/main/services/automations/automationService.test.ts
  • apps/desktop/src/main/services/automations/automationService.ts

Comment thread apps/desktop/src/main/services/automations/automationService.ts Outdated
@arul28

arul28 commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@arul28
arul28 merged commit 5f92c7c into main Aug 6, 2026
4 of 28 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