René's URL Explorer Experiment


Title: fix(core): cap idempotencyKey length at the API boundary by d-cs · Pull Request #3560 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(core): cap idempotencyKey length at the API boundary by d-cs · Pull Request #3560 · triggerdotdev/trigger.dev

X Title: fix(core): cap idempotencyKey length at the API boundary by d-cs · Pull Request #3560 · triggerdotdev/trigger.dev

Description: tasks.trigger, tasks.batchTrigger, batch.create, wait.createToken, wait.forDuration, and the input/session stream waitpoint endpoints all accept a caller-supplied idempotencyKey and store it verbatim against a composite-unique index on TaskRun, BatchTaskRun, or Waitpoint. The schemas had no length cap, so a sufficiently long high-entropy key produced an index row larger than the underlying storage layer can hold. The insert failed at the database, and the caller saw a generic 500 from RunEngineTriggerTaskService.call() / CreateBatchService / waitpoint creation, depending on the endpoint. Keys produced by idempotencyKeys.create() are 64-character SHA-256 hashes and never trip this — it only manifests for direct REST callers (or SDK callers passing a raw string they generated themselves). Low-entropy keys also sail through, because the storage layer compresses repeated bytes before they reach the index, which is why the failure mode is intermittent and tied to caller-side key shape. Fix Add .max(2048, " must be 2048 characters or less") to the seven schemas that feed an indexed idempotencyKey column: TriggerTaskRequestBody.options.idempotencyKey BatchTriggerTaskItem.options.idempotencyKey CreateBatchRequestBody.idempotencyKey CreateWaitpointTokenRequestBody.idempotencyKey CreateInputStreamWaitpointRequestBody.idempotencyKey CreateSessionStreamWaitpointRequestBody.idempotencyKey WaitForDurationRequestBody.idempotencyKey Plus the idempotency-key HTTP header on the trigger route (and the three batch routes that re-export HeadersSchema). The header schema is lifted out of api.v1.tasks.$taskId.trigger.ts into apps/webapp/app/v3/triggerHeaders.server.ts so it can be exercised in tests without dragging the route's import-time side effects. The 2048 character ceiling is chosen to sit safely under the per-row index limit while staying generous against existing callers — keys that fit before still fit. Oversized keys now return a structured Zod 400 instead of a generic 500. Limit is documented under Idempotency key in docs/limits.mdx and as a on docs/idempotency.mdx. Test plan 15 schema unit tests added (packages/core/src/v3/schemas/idempotencyKey.test.ts, apps/webapp/test/routes/triggerHeaders.test.ts) — rejection-with-message + boundary acceptance for each capped schema. The webapp test exercises the extracted TriggerHeadersSchema directly with no mocks. pnpm run build --filter @trigger.dev/core pnpm run typecheck --filter webapp End-to-end verified locally: baseline (small key) → 200; 3000-char high-entropy header → 400 with the expected Zod error; same key at the 2048 boundary → 200; same key with the cap reverted → the database rejected the insert and the route returned 500 to the caller. Cap restored.

Open Graph Description: tasks.trigger, tasks.batchTrigger, batch.create, wait.createToken, wait.forDuration, and the input/session stream waitpoint endpoints all accept a caller-supplied idempotencyKey and store it verbat...

X Description: tasks.trigger, tasks.batchTrigger, batch.create, wait.createToken, wait.forDuration, and the input/session stream waitpoint endpoints all accept a caller-supplied idempotencyKey and store it verbat...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/3560

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:427f3faf-0a36-d255-fdfb-4d0f0ad871fd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAFEC:3C1EA1:3418E88:46B7A8F:6AFAE4A3
html-safe-nonce10b5200df4d35f1b0f7c819741bf084793b13b8007ff93d83e33c126513490a7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkVDOjNDMUVBMTozNDE4RTg4OjQ2QjdBOEY6NkFGQUU0QTMiLCJ2aXNpdG9yX2lkIjoiNzIzMDc4NTc1MDUyNDY4MzQyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace6eb5e34966b705b9ca8900c9143cd8c39c78bcda8014b9455bd98d6f12451fb
hovercard-subject-tagpull_request:3668717238
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/3560/files
twitter:imagehttps://avatars.githubusercontent.com/u/45313566?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/45313566?s=400&v=4
og:image:alttasks.trigger, tasks.batchTrigger, batch.create, wait.createToken, wait.forDuration, and the input/session stream waitpoint endpoints all accept a caller-supplied idempotencyKey and store it verbat...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9d9bd51a568909a83d1abb9d6f74d68f0c87ca85fe3a56d3f5d70d8b89add9f2
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a7ae932999cc6d511008dbf980ff9efad2a31f7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/3560/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3560%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3560%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests66 (66)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
d-cshttps://github.com/d-cs
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
idempotency-key-lengthhttps://github.com/triggerdotdev/trigger.dev/tree/idempotency-key-length
Conversation 12 https://github.com/triggerdotdev/trigger.dev/pull/3560
Commits 3 https://github.com/triggerdotdev/trigger.dev/pull/3560/commits
Checks 51 https://github.com/triggerdotdev/trigger.dev/pull/3560/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/3560/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
fix(core): cap idempotencyKey length at the API boundary https://github.com/triggerdotdev/trigger.dev/pull/3560/files#top
Show all changes 3 commits https://github.com/triggerdotdev/trigger.dev/pull/3560/files
cc77711 fix(core): cap idempotencyKey length at the API boundary d-cs May 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3560/commits/cc777118c9e738899fb46684d6c92e4a3639a5bd
bc0d7f5 Merge branch 'main' into idempotency-key-length d-cs May 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3560/commits/bc0d7f5877aa30f2d38731e6eadced81007ea8bf
bfb9434 Merge branch 'main' into idempotency-key-length d-cs May 14, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3560/commits/bfb9434e365be6f5efdd76d24c3aff6a2ff897cf
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/3560/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
cap-idempotency-key-length.md https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-76cfc2f38f9fbf485dbc3fd920cccd38caaabd3d5247ccaa97a121629919b399
api.v1.tasks.$taskId.trigger.ts https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-0a8ebb7d234c1e129cf60d39731ab4ea98b23849806ffb0b570ba9ab8af147b3
idempotency.mdx https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-d8addd8c123e90b08632c559629d42cb39c125ad296a8c9fac47160bacadc05e
api.ts https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
idempotencyKey.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-495445292e803206a4aaa2f146af29c54fc257887fa87343928c8da62097c065
.changeset/cap-idempotency-key-length.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-76cfc2f38f9fbf485dbc3fd920cccd38caaabd3d5247ccaa97a121629919b399
View file https://github.com/triggerdotdev/trigger.dev/blob/bfb9434e365be6f5efdd76d24c3aff6a2ff897cf/.changeset/cap-idempotency-key-length.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3560/{{ revealButtonHref }}
apps/webapp/app/routes/api.v1.tasks.$taskId.trigger.tshttps://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-0a8ebb7d234c1e129cf60d39731ab4ea98b23849806ffb0b570ba9ab8af147b3
View file https://github.com/triggerdotdev/trigger.dev/blob/bfb9434e365be6f5efdd76d24c3aff6a2ff897cf/apps/webapp/app/routes/api.v1.tasks.%24taskId.trigger.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3560/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-0a8ebb7d234c1e129cf60d39731ab4ea98b23849806ffb0b570ba9ab8af147b3
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-0a8ebb7d234c1e129cf60d39731ab4ea98b23849806ffb0b570ba9ab8af147b3
docs/idempotency.mdxhttps://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-d8addd8c123e90b08632c559629d42cb39c125ad296a8c9fac47160bacadc05e
View file https://github.com/triggerdotdev/trigger.dev/blob/bfb9434e365be6f5efdd76d24c3aff6a2ff897cf/docs/idempotency.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3560/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-d8addd8c123e90b08632c559629d42cb39c125ad296a8c9fac47160bacadc05e
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-d8addd8c123e90b08632c559629d42cb39c125ad296a8c9fac47160bacadc05e
packages/core/src/v3/schemas/api.tshttps://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
View file https://github.com/triggerdotdev/trigger.dev/blob/bfb9434e365be6f5efdd76d24c3aff6a2ff897cf/packages/core/src/v3/schemas/api.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3560/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
packages/core/src/v3/schemas/idempotencyKey.test.tshttps://github.com/triggerdotdev/trigger.dev/pull/3560/files#diff-495445292e803206a4aaa2f146af29c54fc257887fa87343928c8da62097c065
View file https://github.com/triggerdotdev/trigger.dev/blob/bfb9434e365be6f5efdd76d24c3aff6a2ff897cf/packages/core/src/v3/schemas/idempotencyKey.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3560/{{ revealButtonHref }}
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3560/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.