Skip to content

fix(schedule-engine,webapp): log out-of-entitlements scheduled triggers as warnings#4067

Merged
ericallam merged 2 commits into
mainfrom
fix/scheduled-task-out-of-entitlements
Jun 29, 2026
Merged

fix(schedule-engine,webapp): log out-of-entitlements scheduled triggers as warnings#4067
ericallam merged 2 commits into
mainfrom
fix/scheduled-task-out-of-entitlements

Conversation

@ericallam

Copy link
Copy Markdown
Member

Summary

When a scheduled task fires for an organization that is out of entitlements, the trigger can't proceed. That's an expected outcome, but it was being logged at error level and surfaced as a failure.

Fix

The trigger callback now classifies an out-of-entitlements result as its own error type (OUT_OF_ENTITLEMENTS), and the schedule engine logs both that and the existing queue-limit result as warnings rather than errors. The run still doesn't fire and the schedule_execution_failure metric still records the outcome (now tagged out_of_entitlements), so nothing about observability or behavior changes beyond the log level.

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4dfda66

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ericallam ericallam marked this pull request as ready for review June 29, 2026 09:32
devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bcd286bb-507d-428d-be6a-f64bb16fc147

📥 Commits

Reviewing files that changed from the base of the PR and between 0ff2533 and 4dfda66.

📒 Files selected for processing (1)
  • .server-changes/scheduled-task-out-of-entitlements-warning.md
✅ Files skipped from review due to trivial changes (1)
  • .server-changes/scheduled-task-out-of-entitlements-warning.md
📜 Recent review details
⏰ Context from checks skipped due to timeout. (28)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: code-quality / code-quality
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: typecheck / typecheck
  • GitHub Check: audit
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build and publish previews

Walkthrough

The change adds "OUT_OF_ENTITLEMENTS" to the TriggerScheduledTaskErrorType union. In the webapp's onTriggerScheduledTask catch block, an OutOfEntitlementError is now caught and classified with that type. The schedule engine's failure-result branch is updated to treat both QUEUE_LIMIT and OUT_OF_ENTITLEMENTS as expected outcomes logged as warnings rather than errors, and the scheduleExecutionFailureCounter metric now maps OUT_OF_ENTITLEMENTS to its own out_of_entitlements label instead of falling through to task_failure.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and fix, but it misses required template sections like Closes #issue, checklist, testing, changelog, and screenshots. Add the missing template sections: Closes #, checklist items, testing steps, a changelog entry, and screenshots if applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: out-of-entitlements scheduled triggers are now logged as warnings.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/scheduled-task-out-of-entitlements

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.

…rs as warnings

When a scheduled task cannot trigger because the organization is out of
entitlements, that is an expected outcome rather than a failure. It was
being logged at error level. Give it its own error type and log it as a
warning, the same way environment queue-limit results are already
handled. The run still does not fire and the failure metric still
records it.
@ericallam ericallam force-pushed the fix/scheduled-task-out-of-entitlements branch from 0ff2533 to 4dfda66 Compare June 29, 2026 09:47
@pkg-pr-new

pkg-pr-new Bot commented Jun 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@4dfda66

trigger.dev

npm i https://pkg.pr.new/trigger.dev@4dfda66

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@4dfda66

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@4dfda66

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@4dfda66

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@4dfda66

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@4dfda66

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@4dfda66

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@4dfda66

commit: 4dfda66

@ericallam ericallam merged commit aae1c6a into main Jun 29, 2026
44 checks passed
@ericallam ericallam deleted the fix/scheduled-task-out-of-entitlements branch June 29, 2026 18:10
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.

2 participants