René's URL Explorer Experiment


Title: feat(chat): runtime clientData validation for custom agents by gtremper · Pull Request #4646 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: feat(chat): runtime clientData validation for custom agents by gtremper · Pull Request #4646 · triggerdotdev/trigger.dev

X Title: feat(chat): runtime clientData validation for custom agents by gtremper · Pull Request #4646 · triggerdotdev/trigger.dev

Description: Summary chat.withClientData({ schema }).customAgent() now parses payload.metadata before passing it to run, chat.messages, or chat.createSession. Schema defaults and transforms are preserved. Custom agents without a schema keep the existing pass-through behavior. This does not change chat.agent(). Raw custom agents do not expose an action schema, so payload.action remains unknown. Validation failures Invalid client data is logged and never passed to user code. The client receives a fixed Invalid client data error; validator details stay in the task log and onClientDataValidationError. Submitted turns and async reads write the error followed by turn-complete, then wait for the next valid frame. This settles the invalid input before the raw read returns. Callers that need to coordinate validation with their own persistence or settlement should omit the schema and validate the full frame in their loop. Messageless preload and continuation boots call onClientDataValidationError and wait without writing a terminal frame. Active chat.messages.on() subscriptions skip invalid frames and call onClientDataValidationError without ending the response. off() stops new frames. A valid frame accepted before off() finishes validation and is delivered; an invalid pending frame is logged without invoking user callbacks. chat.messages.peek() throws synchronously. Invalid head-start handovers fail closed. A skip ends the run. A real handover writes the validation error after the warm output, writes turn-complete, and ends the run. Validation is automatic when a schema is declared. We can make it opt-in or return a typed failure if maintainers prefer that contract. Testing pnpm --filter @trigger.dev/sdk run test -- --run pnpm --filter @trigger.dev/sdk run typecheck pnpm run build --filter @trigger.dev/sdk pnpm run lint Formatting checks pass ✅ Checklist I followed the contributing guide The PR title follows the convention I ran and tested the change Changelog Custom chat agents now validate and parse client data declared with chat.withClientData({ schema }) before passing it to agent code. Screenshots Not applicable.

Open Graph Description: Summary chat.withClientData({ schema }).customAgent() now parses payload.metadata before passing it to run, chat.messages, or chat.createSession. Schema defaults and transforms are preserved. Custo...

X Description: Summary chat.withClientData({ schema }).customAgent() now parses payload.metadata before passing it to run, chat.messages, or chat.createSession. Schema defaults and transforms are preserved. Custo...

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

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:4e06ed29-45b9-e481-7c07-df0b3a2b9fd8
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE11C:171254:92FE76:D9CD60:6AFB00A9
html-safe-nonce81688a7525e3c18d664d32a02270180fd972b8a88afe7f62b78cd53b5bd1d5ba
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTFDOjE3MTI1NDo5MkZFNzY6RDlDRDYwOjZBRkIwMEE5IiwidmlzaXRvcl9pZCI6IjE2NjEyNjM1NjE5OTQ0Njk1NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac82605ac01699f1f5fd9f343a998831b9290de575f7a83fe7cab9a432db979973
hovercard-subject-tagpull_request:4293059189
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/4646/files
twitter:imagehttps://avatars.githubusercontent.com/u/1009134?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1009134?s=400&v=4
og:image:altSummary chat.withClientData({ schema }).customAgent() now parses payload.metadata before passing it to run, chat.messages, or chat.createSession. Schema defaults and transforms are preserved. Custo...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None54f7a6886649661c85eee945cca0773566bfb4065370e0429b7c8f7204184650
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
release3a69df62e401f1cbe8bd1ad791845bb4fc5b1c1d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4646/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4646%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%2F4646%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/4646/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4646/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4646/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 requests67 (67)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
ericallamhttps://github.com/ericallam
triggerdotdev:mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
gtremper:graham/custom-agent-validationhttps://github.com/gtremper/trigger.dev/tree/graham/custom-agent-validation
Conversation 44 https://github.com/triggerdotdev/trigger.dev/pull/4646
Commits 12 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits
Checks 66 https://github.com/triggerdotdev/trigger.dev/pull/4646/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4646/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4646/files
feat(chat): runtime clientData validation for custom agents https://github.com/triggerdotdev/trigger.dev/pull/4646/files#top
Show all changes 12 commits https://github.com/triggerdotdev/trigger.dev/pull/4646/files
50c86cd feat(chat): validate custom agent client data gtremper Aug 17, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/50c86cdc1ed713ac2dcdbb697ba21be3eb172a5f
80790a7 fix(chat): harden custom agent validation recovery gtremper Aug 17, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/80790a7258f53b030f097ce0569dfb7cd8532b82
cb35a3a fix(chat): tighten custom agent validation lifecycle gtremper Aug 17, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/cb35a3a2832d7636466b85d9c60e8e2aa3b2b4e9
881cd8e fix(chat): narrow custom agent validation contract gtremper Aug 17, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/881cd8e4899a7f77dd822febdc25c401f336f43e
bd0b7e7 Merge main into custom agent clientData validation, re-seated on the … ericallam Aug 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/bd0b7e703cdd64c9e5443cc3c7a64569d9d5852d
19585dc refactor(chat): scope the clientData validation options to withClient… ericallam Aug 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/19585dc450191399b1fe794e3be1b80e0b5ab5ac
d40b858 refactor(sdk): drop the unused drain hook from chat message subscript… ericallam Aug 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/d40b8583bc81cceb5452bfd11a8b8d0d6700c7b0
7b02510 docs(ai-chat): document the clientData validation error timing options ericallam Aug 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/7b0251017ffca7c5959c7fef5af97b34a0bdc09f
c5e0f9f fix(sdk): correct three clientData validation faults found in review ericallam Aug 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/c5e0f9f09543d67c77d3621b3c3a4baff1c9751d
b058d33 docs(ai-chat): use the declared signature for chat.withClientData ericallam Aug 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/b058d33465a006380258656e350231c81fec678e
b70a880 docs(ai-chat): scope reportErrorAt to steering frames ericallam Aug 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/b70a880e74a07314396d1e04c33dcd22f17ffe4f
cc49c01 fix(sdk): treat the read timeout as a total budget across skipped frames ericallam Aug 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4646/commits/cc49c01e183c4e88e6e993ca1fbd1acdbfae3dd2
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4646/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4646/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4646/files
quiet-chats-validate.md https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-5a5ecc798294a9a0e00f77db0484f9fa64ce10b3c2f73ba791b67ca9b48df68a
client-protocol.mdx https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-819a1ba7afd2b06146ffe45804f1a7995d727954e4103eb48e0074e14c6ca057
custom-agents.mdx https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-aa22c9fedc21c400cd9c3eba314803d27850039367de1469b442a2bba7c96650
reference.mdx https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-58e648685c48d39e8d19f714ccdb9a6eca84024f3490b656f62a0ff535a22f3d
types.mdx https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-1ad404231ec5629e0a5067581087294301a3b2c5d93d5348ab052c4a792bace7
ai.ts https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
chat.ts https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-fcabf40729dcab619f789d289291c0187dcc76366e51bf53dfe5bb6225587420
custom-agent-client-data-error-timing.test.ts https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-2ee0f873f67949758730ff7b3d641becb101d7c935c155125dd54cc32f508256
custom-agent-client-data-validation.test.ts https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-258bb1b78789125fc499ebca71c04826146ba0f2da96e295a066db34f5785b76
custom-agent-steering-seqnum.test.ts https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-ea63d3304709deb7aab26bfa1f9a175a7fa9e01663ac0f11b1019514aa8751d9
.changeset/quiet-chats-validate.mdhttps://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-5a5ecc798294a9a0e00f77db0484f9fa64ce10b3c2f73ba791b67ca9b48df68a
View file https://github.com/gtremper/trigger.dev/blob/cc49c01e183c4e88e6e993ca1fbd1acdbfae3dd2/.changeset/quiet-chats-validate.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4646/{{ revealButtonHref }}
docs/ai-chat/client-protocol.mdxhttps://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-819a1ba7afd2b06146ffe45804f1a7995d727954e4103eb48e0074e14c6ca057
View file https://github.com/gtremper/trigger.dev/blob/cc49c01e183c4e88e6e993ca1fbd1acdbfae3dd2/docs/ai-chat/client-protocol.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4646/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-819a1ba7afd2b06146ffe45804f1a7995d727954e4103eb48e0074e14c6ca057
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-819a1ba7afd2b06146ffe45804f1a7995d727954e4103eb48e0074e14c6ca057
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-819a1ba7afd2b06146ffe45804f1a7995d727954e4103eb48e0074e14c6ca057
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-819a1ba7afd2b06146ffe45804f1a7995d727954e4103eb48e0074e14c6ca057
docs/ai-chat/custom-agents.mdxhttps://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-aa22c9fedc21c400cd9c3eba314803d27850039367de1469b442a2bba7c96650
View file https://github.com/gtremper/trigger.dev/blob/cc49c01e183c4e88e6e993ca1fbd1acdbfae3dd2/docs/ai-chat/custom-agents.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4646/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-aa22c9fedc21c400cd9c3eba314803d27850039367de1469b442a2bba7c96650
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-aa22c9fedc21c400cd9c3eba314803d27850039367de1469b442a2bba7c96650
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-aa22c9fedc21c400cd9c3eba314803d27850039367de1469b442a2bba7c96650
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-aa22c9fedc21c400cd9c3eba314803d27850039367de1469b442a2bba7c96650
docs/ai-chat/reference.mdxhttps://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-58e648685c48d39e8d19f714ccdb9a6eca84024f3490b656f62a0ff535a22f3d
View file https://github.com/gtremper/trigger.dev/blob/cc49c01e183c4e88e6e993ca1fbd1acdbfae3dd2/docs/ai-chat/reference.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4646/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-58e648685c48d39e8d19f714ccdb9a6eca84024f3490b656f62a0ff535a22f3d
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-58e648685c48d39e8d19f714ccdb9a6eca84024f3490b656f62a0ff535a22f3d
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-58e648685c48d39e8d19f714ccdb9a6eca84024f3490b656f62a0ff535a22f3d
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-58e648685c48d39e8d19f714ccdb9a6eca84024f3490b656f62a0ff535a22f3d
docs/ai-chat/types.mdxhttps://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-1ad404231ec5629e0a5067581087294301a3b2c5d93d5348ab052c4a792bace7
View file https://github.com/gtremper/trigger.dev/blob/cc49c01e183c4e88e6e993ca1fbd1acdbfae3dd2/docs/ai-chat/types.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4646/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-1ad404231ec5629e0a5067581087294301a3b2c5d93d5348ab052c4a792bace7
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-1ad404231ec5629e0a5067581087294301a3b2c5d93d5348ab052c4a792bace7
https://github.com/triggerdotdev/trigger.dev/pull/4646/files#diff-1ad404231ec5629e0a5067581087294301a3b2c5d93d5348ab052c4a792bace7
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4646/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.