Skip to content

maxComputeSeconds#3167

Draft
matt-aitken wants to merge 5 commits intomainfrom
maxComputeSeconds
Draft

maxComputeSeconds#3167
matt-aitken wants to merge 5 commits intomainfrom
maxComputeSeconds

Conversation

@matt-aitken
Copy link
Member

Deprecate maxDuration in favour of maxComputeSeconds while preserving backwards compatibility

Details

  • Add maxComputeSeconds setting and related handling
  • Update templates to reflect new option
  • Documentation updates for maxComputeSeconds

Todo

  • Create preview package release
  • Test init creates trigger.config with the correct template
  • Test that maxDuration still works on trigger.config
  • Test that maxDuration override still works on a task
  • Test that maxComputeSeconds works in trigger.config
  • Test that maxComputeSeconds override works on a task

Deprecate maxDuration in favour of maxComputeSeconds but keep backwards compatibility
@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2026

🦋 Changeset detected

Latest commit: 4cf8b69

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

Walkthrough

The PR renames the public configuration option maxDuration to maxComputeSeconds across the codebase and docs, adds maxComputeSeconds as an optional field in core types, and marks maxDuration as deprecated in JSDoc. Runtime code now accepts either field and derives an effective duration via config.maxComputeSeconds ?? config.maxDuration. Templates, examples, documentation pages, and UI labels were updated to the new terminology; changelog/deprecation notes were added. No behavioral change to duration semantics beyond the new name and precedence rule.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete. It lacks required sections: no 'Closes #' reference, missing Testing section with actual test steps, missing Changelog section, and no Screenshots section (if applicable). Complete the description by adding the issue reference, detailed testing steps, a changelog summary, and removing the unchecked TODO items or moving them to project tracking.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'maxComputeSeconds' is vague and does not clearly convey the main change—that maxDuration is being deprecated in favor of maxComputeSeconds. Revise the title to be more descriptive, e.g., 'Deprecate maxDuration in favor of maxComputeSeconds' or 'Introduce maxComputeSeconds and deprecate maxDuration'.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch maxComputeSeconds

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.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
docs/runs/max-duration.mdx (1)

9-11: ⚠️ Potential issue | 🟡 Minor

Deprecation note is reversed.

Line 10 currently says maxDuration replaces deprecated maxComputeSeconds, but this page and PR migrate in the opposite direction. It should state maxComputeSeconds replaces deprecated maxDuration.

Proposed fix
 <Note>
-  `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.
 </Note>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/runs/max-duration.mdx` around lines 9 - 11, The Note's deprecation
wording is reversed: change the sentence to say that `maxComputeSeconds`
replaces the deprecated `maxDuration` (instead of the current opposite claim).
Update the Note block text to read something like "`maxComputeSeconds` replaces
the deprecated `maxDuration`; both work the same way, but we recommend using
`maxComputeSeconds` for clarity," and check adjacent references to
`maxDuration`/`maxComputeSeconds` in the same file to ensure consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/runs/max-duration.mdx`:
- Line 15: Replace the short `ts` code-fence tags with the required `typescript`
tag in the docs examples: update the fences referencing
`/config/trigger.config.ts`, `/trigger/max-duration.ts`, and
`/trigger/max-duration-task.ts` (and the repeated instances noted at lines 44,
66, 82, 98, 112, 129) so each opening fence reads ```typescript <path> instead
of ```ts <path>; ensure all matching closing fences remain unchanged.
- Line 99: The import path for the example snippet is incorrect: update the
import of maxComputeSecondsTask from "./trigger/max-duration-task" to the
sibling module "./max-duration-task" so the snippet is runnable; locate the
import statement that references maxComputeSecondsTask and replace the nested
"./trigger/max-duration-task" module path with "./max-duration-task" (also
update the duplicate occurrence noted further down).

---

Duplicate comments:
In `@docs/runs/max-duration.mdx`:
- Around line 9-11: The Note's deprecation wording is reversed: change the
sentence to say that `maxComputeSeconds` replaces the deprecated `maxDuration`
(instead of the current opposite claim). Update the Note block text to read
something like "`maxComputeSeconds` replaces the deprecated `maxDuration`; both
work the same way, but we recommend using `maxComputeSeconds` for clarity," and
check adjacent references to `maxDuration`/`maxComputeSeconds` in the same file
to ensure consistency.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2bba94 and 4cf8b69.

📒 Files selected for processing (1)
  • docs/runs/max-duration.mdx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (26)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: sdk-compat / Bun Runtime
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (CLAUDE.md)

Docs in docs/ directory should use Mintlify MDX format following conventions in docs/CLAUDE.md

Files:

  • docs/runs/max-duration.mdx
docs/**/*.mdx

📄 CodeRabbit inference engine (docs/CLAUDE.md)

docs/**/*.mdx: MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format
Use Mintlify components for structured content: , , , , , , /, /
Always import from @trigger.dev/sdk in code examples (never from @trigger.dev/sdk/v3)
Code examples must be complete and runnable where possible
Use language tags in code fences: typescript, bash, json

Files:

  • docs/runs/max-duration.mdx
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Set default maximum duration in trigger.config.ts using `maxDuration` property
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Limit task duration using the `maxDuration` property (in seconds)
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Set default maximum duration in trigger.config.ts using `maxDuration` property

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Limit task duration using the `maxDuration` property (in seconds)

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Configure task retry behavior using the `retry` property with options like maxAttempts, factor, and timeout values

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `idempotencyKeyTTL` option to define a time window during which duplicate triggers return the original run

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `task()` function from `trigger.dev/sdk/v3` to define tasks with id and run properties

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `yourTask.trigger()` to trigger a task from inside another task with specified payload

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `tasks.batchTrigger()` to trigger multiple runs of a single task with different payloads

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `batch.triggerByTaskAndWait()` to batch trigger tasks by passing task instances and wait for results

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `schedules.task()` for scheduled/cron tasks instead of regular `task()`

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `yourTask.batchTrigger()` to trigger multiple runs of a task from inside another task

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `batch.triggerByTask()` to batch trigger tasks by passing task instances for static task sets

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure global retry settings in trigger.config.ts using `retries` object with defaults for all tasks

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure Trigger.dev project in `trigger.config.ts` using `defineConfig()` with project ref and task directories

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Attach metadata to task runs using the metadata option when triggering, and access/update it inside runs using metadata functions

Applied to files:

  • docs/runs/max-duration.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Define global lifecycle functions (onStart, onSuccess, onFailure) in trigger.config.ts to apply to all tasks

Applied to files:

  • docs/runs/max-duration.mdx


You must set a default maxComputeSeconds in your `trigger.config.ts` file, which will apply to all tasks unless overridden:

```ts /config/trigger.config.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use typescript code-fence tags in docs examples.

These fences use ts; the docs guideline requires typescript.

Proposed fix
-```ts /config/trigger.config.ts
+```typescript /config/trigger.config.ts
@@
-```ts /trigger/max-duration.ts
+```typescript /trigger/max-duration.ts
@@
-```ts /trigger/max-duration-task.ts
+```typescript /trigger/max-duration-task.ts
@@
-```ts /trigger/max-duration-task.ts
+```typescript /trigger/max-duration-task.ts
@@
-```ts /trigger/max-duration.ts
+```typescript /trigger/max-duration.ts
@@
-```ts /trigger/max-duration.ts
+```typescript /trigger/max-duration.ts
@@
-```ts /trigger/max-duration-task.ts
+```typescript /trigger/max-duration-task.ts

As per coding guidelines, Use language tags in code fences: typescript, bash, json.

Also applies to: 44-44, 66-66, 82-82, 98-98, 112-112, 129-129

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/runs/max-duration.mdx` at line 15, Replace the short `ts` code-fence
tags with the required `typescript` tag in the docs examples: update the fences
referencing `/config/trigger.config.ts`, `/trigger/max-duration.ts`, and
`/trigger/max-duration-task.ts` (and the repeated instances noted at lines 44,
66, 82, 98, 112, 129) so each opening fence reads ```typescript <path> instead
of ```ts <path>; ensure all matching closing fences remain unchanged.


```ts /trigger/max-duration.ts
import { maxDurationTask } from "./trigger/max-duration-task";
import { maxComputeSecondsTask } from "./trigger/max-duration-task";
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Snippet import path is not runnable from the shown file location.

In /trigger/max-duration.ts, importing ./trigger/max-duration-task points to a nested directory. The sibling-file import should be ./max-duration-task.

Proposed fix
-import { maxComputeSecondsTask } from "./trigger/max-duration-task";
+import { maxComputeSecondsTask } from "./max-duration-task";
@@
-import { maxComputeSecondsTask } from "./trigger/max-duration-task";
+import { maxComputeSecondsTask } from "./max-duration-task";

As per coding guidelines, Code examples must be complete and runnable where possible.

Also applies to: 113-113

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/runs/max-duration.mdx` at line 99, The import path for the example
snippet is incorrect: update the import of maxComputeSecondsTask from
"./trigger/max-duration-task" to the sibling module "./max-duration-task" so the
snippet is runnable; locate the import statement that references
maxComputeSecondsTask and replace the nested "./trigger/max-duration-task"
module path with "./max-duration-task" (also update the duplicate occurrence
noted further down).

Copy link
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 3 additional findings in Devin Review.

Open in Devin Review

Copy link
Contributor

Choose a reason for hiding this comment

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

🔴 createSchemaTask ignores maxComputeSeconds, only reads deprecated maxDuration

When defining a task using createSchemaTask (used by schemaTask() and toolTask()), the new maxComputeSeconds property is silently ignored because the metadata registration still only reads params.maxDuration.

Root Cause and Impact

In createTask at packages/trigger-sdk/src/v3/shared.ts:238, the fix was correctly applied:

maxDuration: params.maxComputeSeconds ?? params.maxDuration,

But in createSchemaTask at packages/trigger-sdk/src/v3/shared.ts:369, the transformation was missed:

maxDuration: params.maxDuration,

This means any task defined via createSchemaTask (which powers schemaTask() and indirectly toolTask() via createToolTask at line 271) that uses the new maxComputeSeconds property will have no compute time limit applied. The maxComputeSeconds value is accepted by the type system but silently dropped.

Impact: Users who follow the new documentation and set maxComputeSeconds on schema-based tasks will have no duration limit enforced, potentially leading to runaway tasks and unexpected compute costs.

(Refers to line 369)

Open in Devin Review

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

Copy link
Contributor

Choose a reason for hiding this comment

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

🔴 triggerAndWait_internal ignores maxComputeSeconds, only reads deprecated maxDuration

When calling triggerAndWait() or task.triggerAndWait() with the new maxComputeSeconds option, the value is silently ignored because triggerAndWait_internal only reads options?.maxDuration.

Root Cause and Impact

At packages/trigger-sdk/src/v3/shared.ts:2399, the code reads:

maxDuration: options?.maxDuration,

Every other trigger path (e.g., trigger_internal at line 2142, all batch trigger functions, and all streaming transform functions) was correctly updated to:

maxDuration: options?.maxComputeSeconds ?? options?.maxDuration,

The TriggerAndWaitOptions type (defined at packages/core/src/v3/types/tasks.ts:987 as Omit<TriggerOptions, "version">) inherits the maxComputeSeconds field from TriggerOptions, so users can pass it — but it will be silently dropped.

Impact: Users calling triggerAndWait() with maxComputeSeconds will have no duration override applied to the child run, potentially causing it to run with the task's default or no limit at all.

(Refers to line 2399)

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
Contributor

Choose a reason for hiding this comment

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

🔴 Documentation note says the opposite of what's intended — claims maxDuration replaces maxComputeSeconds

The deprecation note in the documentation has the old and new names swapped, telling users the exact opposite of the PR's intent.

Details

At docs/runs/max-duration.mdx:10, the note reads:

`maxDuration` replaces the deprecated `maxComputeSeconds` parameter.

But the entire PR is about deprecating maxDuration in favor of maxComputeSeconds. The note should say:

`maxComputeSeconds` replaces the deprecated `maxDuration` parameter.

Impact: Users reading this documentation will be confused about which property to use — the note directly contradicts all other documentation and code changes in this PR.

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
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, the TriggerConfig type previously had maxDuration: number (required). Now it's been changed to maxComputeSeconds?: number (optional) and maxDuration?: number (optional). This is technically a widening change that shouldn't break existing code at compile time, but it means the config no longer enforces that users set a compute time limit. The changeset docs and templates all include maxComputeSeconds, so new projects will still have it, but existing projects upgrading could silently lose their enforcement if they relied on the type system requiring the field.

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
Contributor

Choose a reason for hiding this comment

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

🚩 Documentation references ctx.run.maxComputeSeconds but the runtime context schema likely still uses maxDuration

At docs/runs/max-duration.mdx:136, the docs show ctx.run.maxComputeSeconds as the way to access the value in the run context. However, the runtime context schemas at packages/core/src/v3/schemas/messages.ts:195 use maxDurationInSeconds, and no changes were made to the context/schemas in this PR. This means ctx.run.maxComputeSeconds likely doesn't exist at runtime — it's probably still ctx.run.maxDuration or ctx.run.maxDurationInSeconds. This documentation claim should be verified against the actual runtime context type.

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.

1 participant