Skip to content

improvement(async-jobs): warn when Trigger.dev run acceptance is slow - #9224

Merged
waleedlatif1 merged 2 commits into
stagingfrom
improvement/trigger-slow-acceptance-log
Oct 19, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
improvement/trigger-slow-acceptance-log

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Added measureTriggerAcceptance, which logs Slow Trigger.dev run acceptance (with taskId, durationMs, and outcome) when Trigger.dev takes 10s or longer to accept a run
  • Wrapped the two central enqueue paths: triggerScheduledPass (cron-dispatched passes) and TriggerDevJobQueue.enqueue
  • Doesn't change behavior: there's no deadline, and the wait, the result, and any thrown error are unchanged. When Trigger.dev's intake stalls, every enqueue in the process waits on it, and right now the only signal we get is a downstream cron caller timing out. This gives us a direct log line to filter and alert on

Type of Change

  • Improvement

Testing

  • lib/core/async-jobs/backends/trigger-dev.test.ts (45 passing)
  • biome check on the changed files
  • Ran a throwaway script against the helper: a 50ms submission logs nothing, a 10.2s accepted submission warns with outcome: accepted, and a 10.2s failed submission warns with outcome: failed and rethrows the original error
  • Leaving type-check, audits, and the full suite to CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 19, 2026 8:18pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/core/async-jobs/trigger-acceptance.ts
Comment thread apps/sim/lib/core/async-jobs/trigger-acceptance.ts Outdated
@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no blocking issue was found.

Summary

Adds shared timing logs around Trigger.dev submissions from TriggerDevJobQueue.enqueue and triggerScheduledPass.

  • Slow Trigger.dev submissions now produce warnings.

Reviews (2) · Last reviewed commit: "improvement(async-jobs): warn while Trig..." · Reviewed by Greptile

Comment thread apps/sim/lib/core/async-jobs/trigger-acceptance.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 5c93e8f into staging Oct 19, 2026
53 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/trigger-slow-acceptance-log branch October 19, 2026 20:58

This branch was previously deployed

1 inactive deployment
Preview — aed46de0 Deployed Oct 19, 2026 by vercel[bot]
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