Skip to content

docs(tasks): add trigger_lookup_failed to the Task schema - #284

Open
sweetmantech wants to merge 1 commit into
mainfrom
docs/task-enrichment-status
Open

docs(tasks): add trigger_lookup_failed to the Task schema#284
sweetmantech wants to merge 1 commit into
mainfrom
docs/task-enrichment-status

Conversation

@sweetmantech

@sweetmantech sweetmantech commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Contract for the GET /api/tasks enrichment row of chat#1918. Docs lead; the api PR follows.

The problem this contract fixes

enrichTasks has four paths that all return { recent_runs: [], upcoming: [], timezone: null }:

  1. the task has no trigger_schedule_id
  2. the Trigger.dev runs/timezone lookup threw
  3. the run-payload retrieval threw
  4. the schedule is live but genuinely has no runs yet

Consumers cannot tell #2 and #3 from #4. Observed live 2026-07-29: two tasks reported upcoming: [] while GET api.trigger.dev/api/v1/schedules/{id} showed both schedules active with a correct cron and nextRun. The false negative was read as "this schedule is dead" and led to a duplicate task being created — a double-email risk.

What changes

  • New trigger_lookup_failed boolean on the Task schema. True only when the Trigger lookup errored, so the enrichment fields are known to be unreliable. False when the lookup succeeded (including a legitimately empty result) or when there is no schedule id to look up.
  • upcoming's description now states the three reasons it can be empty and points at the flag.

Additive and non-breaking: existing consumers that ignore the field behave exactly as before.

Edit method

releases.json does not round-trip byte-identically through json.load/json.dumps (verified), so this is an anchored text edit at the property boundary. Re-validated: the file parses and trigger_lookup_failed is present on Task.properties.

Merge order

This PR first, then the api implementation.

🤖 Generated with Claude Code


Summary by cubic

Add trigger_lookup_failed to the Task schema and clarify when upcoming can be empty for GET /api/tasks. This lets clients distinguish Trigger.dev lookup errors from legitimate no-run states (chat#1918).

  • New Features

    • Added boolean trigger_lookup_failed: true when Trigger.dev lookup errored; false when it succeeded or there’s no trigger_schedule_id.
    • Updated upcoming description to list the empty cases and reference trigger_lookup_failed.
  • Migration

    • No breaking changes. Optionally treat an empty upcoming as “dead” only when trigger_lookup_failed is false.

Written for commit 40d00f2. Summary will update on new commits.

Review in cubic

@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9db344b0-7430-416d-98e7-197f2d72530b

📥 Commits

Reviewing files that changed from the base of the PR and between d673296 and 40d00f2.

📒 Files selected for processing (1)
  • api-reference/openapi/releases.json

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.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Re-trigger cubic

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