Skip to content

TypeScript SDK: take the task state store retention in seconds - #75445

Merged
jason810496 merged 6 commits into
apache:mainfrom
jason810496:ts-sdk-beta-final-nits
Oct 23, 2026
Merged

jason810496 merged 6 commits into
apache:mainfrom
jason810496:ts-sdk-beta-final-nits

Conversation

@jason810496

@jason810496 jason810496 commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Final nit before the TypeScript SDK beta release.

Every duration is now seconds

retentionMs was the one duration in the SDK that was not seconds, next to
executionTimeout, retryDelay and dagrunTimeout, which all are. A reader who
learned milliseconds from it would write executionTimeout: 30_000 and get 8.3
hours. It is now retention, a bare name like those options and the Python argument.

// before
await store.set("job_id", jobId, { retentionMs: 60_000 });

// after
await store.set("job_id", jobId, { retention: 60 });

NEVER_EXPIRE is unchanged.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (Opus 5.5) following the guidelines

retentionMs was the one duration in the SDK that was not seconds, next to
executionTimeout, retryDelay and dagrunTimeout, which all are. Rename it to
retentionSeconds so every duration carries the same unit.

The HITL example modules now export their Dags, so another bundle can serve
them.

Co-Authored-By: Claude <noreply@anthropic.com>
@jason810496 jason810496 self-assigned this Oct 23, 2026
@jason810496
jason810496 marked this pull request as ready for review October 23, 2026 06:26
@jason810496 jason810496 added the backport-to-v3-4-test Backport to v3-4-test label Oct 23, 2026
@jason810496 jason810496 added this to the Airflow 3.4.0 milestone Oct 23, 2026
Comment thread ts-sdk/example/src/hitl.ts Resolved
Importing them would run the module-level serve() call, so the importing
bundle's own serve() would then fail.

Co-Authored-By: Claude <noreply@anthropic.com>

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the review.

Comment thread ts-sdk/example/src/hitl.ts Resolved
@jason810496
jason810496 requested a review from uranusjr October 23, 2026 09:46
Comment thread ts-sdk/src/coordinator/client.ts Resolved
Comment thread ts-sdk/src/sdk/client-types.ts Resolved
jason810496 and others added 4 commits October 23, 2026 10:26
Every other public duration is a bare name in seconds, and the Python
argument is retention too.

Co-Authored-By: Claude <noreply@anthropic.com>
The caller passes seconds, so the error now uses the same unit.

Co-Authored-By: Claude <noreply@anthropic.com>
The task state store section links to it instead of carrying the rule.

Co-Authored-By: Claude <noreply@anthropic.com>
Every duration in the SDK is now a bare name in seconds, as defer's
timeout is in Python.

Co-Authored-By: Claude <noreply@anthropic.com>

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the review, I remove the time unit suffix for those arguments on TS side that are inconsistent with the Python side.

Comment thread ts-sdk/src/sdk/client-types.ts Resolved
Comment thread ts-sdk/src/coordinator/client.ts Resolved
@jason810496
jason810496 requested a review from uranusjr October 23, 2026 11:02

@guan404ming guan404ming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Look nice! Thnaks.

@jason810496
jason810496 merged commit ccbd215 into apache:main Oct 23, 2026
79 checks passed
@jason810496
jason810496 deleted the ts-sdk-beta-final-nits branch October 23, 2026 12:02
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

jason810496 added a commit that referenced this pull request Oct 23, 2026
…conds (#75445) (#75460)

* TypeScript SDK: take the task state store retention in seconds

retentionMs was the one duration in the SDK that was not seconds, next to
executionTimeout, retryDelay and dagrunTimeout, which all are. Rename it to
retentionSeconds so every duration carries the same unit.

The HITL example modules now export their Dags, so another bundle can serve
them.

* TypeScript SDK: keep the HITL example Dags unexported

Importing them would run the module-level serve() call, so the importing
bundle's own serve() would then fail.

* TypeScript SDK: name the task state store option retention

Every other public duration is a bare name in seconds, and the Python
argument is retention too.

* TypeScript SDK: report an overflowing retention in seconds

The caller passes seconds, so the error now uses the same unit.

* TypeScript SDK docs: state the seconds rule once in a Durations section

The task state store section links to it instead of carrying the rule.

* TypeScript SDK: name the operator timeout option timeout

Every duration in the SDK is now a bare name in seconds, as defer's
timeout is in Python.

---------
(cherry picked from commit ccbd215)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants