Skip to content

feat(tasks)!: reject a taskDefaultTtlMs above taskMaxTtlMs - #310

Open
mcollina wants to merge 1 commit into
fix/302-validate-task-optionsfrom
feat/enforce-task-ttl-ceiling
Open

mcollina wants to merge 1 commit into
fix/302-validate-task-optionsfrom
feat/enforce-task-ttl-ceiling

Conversation

@mcollina

@mcollina mcollina commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #307, stacked on it. The base will become main once #307 merges.

A taskDefaultTtlMs above taskMaxTtlMs is silently capped today, so tasks never get the retention the operator configured. This change makes registration throw a TypeError instead:

  • An explicit taskDefaultTtlMs is compared against taskMaxTtlMs, or against its 1 hour default when taskMaxTtlMs is unset.
  • An unset taskDefaultTtlMs (60s default) is still capped by a smaller taskMaxTtlMs, as before.
  • MAX_TASK_TTL is exported from src/handlers.ts so registration can resolve the default ceiling.
  • README and test/task-options-validation.test.ts updated.

Breaking change

Configurations with a taskDefaultTtlMs above taskMaxTtlMs used to load, with the value capped. They now fail at startup. For example, taskDefaultTtlMs: 7_200_000 with no taskMaxTtlMs was capped to 1 hour before.

Refs #302

🤖 Generated with Claude Code

https://claude.ai/code/session_01UF4S3w7iA83V9DVsasLJzM

A default retention above the ceiling is silently capped, so the value
the operator configured is never the one tasks get. Throw a TypeError at
registration instead, comparing an explicit taskDefaultTtlMs against
taskMaxTtlMs or its 1 hour default. An unset taskDefaultTtlMs is still
capped by a smaller taskMaxTtlMs, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UF4S3w7iA83V9DVsasLJzM
@mcollina mcollina added the semver-major Breaking change; requires a major release label Oct 15, 2026
@mcollina mcollina changed the title feat(tasks): reject a taskDefaultTtlMs above taskMaxTtlMs feat(tasks)!: reject a taskDefaultTtlMs above taskMaxTtlMs Oct 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-major Breaking change; requires a major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant