Skip to content

Pr 3167 fix#3340

Closed
deepshekhardas wants to merge 6 commits intotriggerdotdev:mainfrom
deepshekhardas:pr-3167-fix
Closed

Pr 3167 fix#3340
deepshekhardas wants to merge 6 commits intotriggerdotdev:mainfrom
deepshekhardas:pr-3167-fix

Conversation

@deepshekhardas
Copy link
Copy Markdown

Closes #

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

[Describe the steps you took to test this change]


Changelog

[Short description of what has changed]


Screenshots

[Screenshots]

💯

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 8, 2026

🦋 Changeset detected

Latest commit: 58fbc71

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 28 packages
Name Type
@trigger.dev/core Patch
@trigger.dev/sdk Patch
trigger.dev Patch
@trigger.dev/build Patch
@trigger.dev/python Patch
@trigger.dev/redis-worker Patch
@trigger.dev/schema-to-json Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/zod-worker Patch
@internal/sdk-compat-tests Patch
d3-chat Patch
references-d3-openai-agents Patch
references-nextjs-realtime Patch
references-realtime-hooks-test Patch
references-realtime-streams Patch
references-telemetry Patch
@trigger.dev/react-hooks Patch
@trigger.dev/rsc Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Hi @deepshekhardas, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions bot closed this Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b382bd39-e1a4-4a4f-815b-305a0bd47a3c

📥 Commits

Reviewing files that changed from the base of the PR and between def21b2 and 58fbc71.

📒 Files selected for processing (24)
  • .changeset/deprecate-max-duration.md
  • .changeset/max-compute-seconds.md
  • .claude/skills/trigger-dev-tasks/advanced-tasks.md
  • .claude/skills/trigger-dev-tasks/config.md
  • apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • docs/config/config-file.mdx
  • docs/runs/max-duration.mdx
  • docs/tasks/overview.mdx
  • docs/triggering.mdx
  • packages/cli-v3/src/entryPoints/dev-index-worker.ts
  • packages/cli-v3/src/entryPoints/managed-index-worker.ts
  • packages/cli-v3/templates/examples/schedule.mjs.template
  • packages/cli-v3/templates/examples/schedule.ts.template
  • packages/cli-v3/templates/examples/simple.mjs.template
  • packages/cli-v3/templates/examples/simple.ts.template
  • packages/cli-v3/templates/trigger.config.mjs.template
  • packages/cli-v3/templates/trigger.config.ts.template
  • packages/core/src/v3/config.ts
  • packages/core/src/v3/types/tasks.ts
  • packages/trigger-sdk/src/v3/shared.ts
  • rules/4.1.0/config.md
  • rules/4.3.0/advanced-tasks.md

Walkthrough

This pull request deprecates the maxDuration configuration option in favor of maxComputeSeconds across the Trigger.dev project. The changes introduce changesets to document the deprecation cycle, update type definitions to add the new field and mark the old as deprecated, replace references in documentation and example configurations, modify runtime logic to prefer the new field with fallback behavior, and update UI labels in the webapp. Backward compatibility is maintained by supporting both properties.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 5 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

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.

🔴 triggerAndWait_internal not updated to use maxComputeSeconds

The triggerAndWait_internal function at packages/trigger-sdk/src/v3/shared.ts:2399 still passes options?.maxDuration directly, without the maxComputeSeconds fallback. Every other call site in the file was updated to options?.maxComputeSeconds ?? options?.maxDuration (e.g., trigger_internal at line 2142, all batch functions, all stream transformers). This means when a user calls task.triggerAndWait(payload, { maxComputeSeconds: 300 }), the maxComputeSeconds value is silently ignored and the run has no compute time limit.

(Refers to line 2399)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

🔴 createSchemaTask not updated to use maxComputeSeconds

The createSchemaTask function at packages/trigger-sdk/src/v3/shared.ts:369 still registers maxDuration: params.maxDuration, ignoring the new maxComputeSeconds property. The equivalent createTask function was correctly updated at line 238 to params.maxComputeSeconds ?? params.maxDuration. This means any task defined with schemaTask({ maxComputeSeconds: 300, ... }) will silently have no compute time limit, since params.maxDuration would be undefined.

(Refers to line 369)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


You must set a default maxDuration in your `trigger.config.ts` file, which will apply to all tasks unless overridden:
<Note>
`maxDuration` replaces the deprecated `maxComputeSeconds` parameter. Both work the same way, but we recommend using `maxDuration` for clarity.
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.

🔴 Documentation note has maxDuration and maxComputeSeconds swapped

The note in the docs says "maxDuration replaces the deprecated maxComputeSeconds parameter" but this is backwards. The entire PR deprecates maxDuration in favor of maxComputeSeconds, so the note should say "maxComputeSeconds replaces the deprecated maxDuration parameter." This will confuse users about which property is the new recommended one.

Suggested change
`maxDuration` replaces the deprecated `maxComputeSeconds` parameter. Both work the same way, but we recommend using `maxDuration` for clarity.
`maxComputeSeconds` replaces the deprecated `maxDuration` parameter. Both work the same way, but we recommend using `maxComputeSeconds` for clarity.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +177 to +188
maxComputeSeconds?: number;

/**
* @deprecated Use `maxComputeSeconds` instead. This property will be removed in a future version.
*
* The maximum duration in compute-time seconds that a task run is allowed to run. If the task run exceeds this duration, it will be stopped.
*
* Minimum value is 5 seconds
*
* Setting this value will affect all tasks in the project.
*/
maxDuration?: number;
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.

🚩 Config maxDuration changed from required to optional — potential breaking change for existing configs

In packages/core/src/v3/config.ts:177, maxDuration was previously a required field (maxDuration: number). Now both maxComputeSeconds and maxDuration are optional (maxComputeSeconds?: number and maxDuration?: number). This means existing trigger.config.ts files that relied on maxDuration being required will still compile (since the old field still exists as optional), but new projects that don't set either field will have no default compute time limit. This is likely intentional since it was previously documented as a required field and the templates still set maxComputeSeconds: 3600, but it's worth confirming this behavioral change is desired.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

maxComputeSeconds: 300, // 300 seconds or 5 minutes
run: async (payload: any, { ctx }) => {
console.log(ctx.run.maxDuration); // 300
console.log(ctx.run.maxComputeSeconds); // 300
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.

🚩 ctx.run.maxComputeSeconds in docs references a property that doesn't exist in the runtime context schema

At docs/runs/max-duration.mdx:136, the docs show ctx.run.maxComputeSeconds but the actual run context schema in packages/core/src/v3/schemas/common.ts:227 and packages/core/src/v3/schemas/common.ts:390 still uses maxDuration. The runtime context object sent to the task's run function won't have a maxComputeSeconds property — it will have maxDuration. This doc example will not work as written, though it may be intended to be addressed in a follow-up PR that also renames the context field.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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