René's URL Explorer Experiment


Title: fix(sdk): re-apply tool toModelOutput across chat.agent turns by ericallam · Pull Request #3790 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(sdk): re-apply tool toModelOutput across chat.agent turns by ericallam · Pull Request #3790 · triggerdotdev/trigger.dev

X Title: fix(sdk): re-apply tool toModelOutput across chat.agent turns by ericallam · Pull Request #3790 · triggerdotdev/trigger.dev

Description: Summary chat.agent now takes a tools option. Until now tools only went to streamText inside run(), so the SDK had no tools when it re-converted the persisted UIMessage history at the start of each turn. Any tool with a toModelOutput (raw image bytes into an image content part, or a sub-agent transcript compressed to a summary) had its transform applied on turn 1 and skipped from turn 2 onward, so the raw output got JSON-stringified back into the prompt and the model lost the transformed view. Declaring tools on the config threads them into that conversion, so toModelOutput runs on every turn. The resolved set is handed back, typed, on the run() payload as tools: const tools = { searchDocs, renderChart }; export const myChat = chat.agent({ tools, run: async ({ messages, tools, signal }) => streamText({ ...chat.toStreamTextOptions({ tools }), messages, abortSignal: signal }), }); tools also accepts a per-turn function for tools that depend on the user or a feature flag. Only inputSchema and toModelOutput are read during conversion, never execute. Also exports InferChatUIMessageFromTools to derive the chat UIMessage type from a tool set. No behavior change for agents that don't declare tools.

Open Graph Description: Summary chat.agent now takes a tools option. Until now tools only went to streamText inside run(), so the SDK had no tools when it re-converted the persisted UIMessage history at the start of each ...

X Description: Summary chat.agent now takes a tools option. Until now tools only went to streamText inside run(), so the SDK had no tools when it re-converted the persisted UIMessage history at the start of each ...

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

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:5e9037a9-0b84-7d28-558f-ca4119813ecf
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD2C8:228216:59476:7F200:6AFAF0AB
html-safe-nonce41c4019cec4a48ae563a56404d52cabaf916700fdda0c25b5fcc69d1f2166d8a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkM4OjIyODIxNjo1OTQ3Njo3RjIwMDo2QUZBRjBBQiIsInZpc2l0b3JfaWQiOiI2OTk5MzQ0NzI0NzQ1ODQyODU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace9067212c6e42287b60a4c2415d58f381bbb451f9c9374666cbe14d457db43ef
hovercard-subject-tagpull_request:3781799161
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/3790/files
twitter:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
og:image:altSummary chat.agent now takes a tools option. Until now tools only went to streamText inside run(), so the SDK had no tools when it re-converted the persisted UIMessage history at the start of each ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
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
release12fff95459b24b0f882a66698ee6a36a5934d247
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/3790/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3790%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%2F3790%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/3790/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3790/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3790/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
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
feature/tri-10149-chatagent-thread-tools-through-internalhttps://github.com/triggerdotdev/trigger.dev/tree/feature/tri-10149-chatagent-thread-tools-through-internal
Conversation 12 https://github.com/triggerdotdev/trigger.dev/pull/3790
Commits 2 https://github.com/triggerdotdev/trigger.dev/pull/3790/commits
Checks 48 https://github.com/triggerdotdev/trigger.dev/pull/3790/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/3790/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3790/files
fix(sdk): re-apply tool toModelOutput across chat.agent turns https://github.com/triggerdotdev/trigger.dev/pull/3790/files#top
Show all changes 2 commits https://github.com/triggerdotdev/trigger.dev/pull/3790/files
57b15d8 fix(sdk): re-apply tool toModelOutput across chat.agent turns ericallam Jun 1, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3790/commits/57b15d8b6b1b51fd1c156627f7e58dc3465a5885
30e9853 fix(sdk): fail closed on tools() errors and re-apply toModelOutput on… ericallam Jun 1, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3790/commits/30e98538270894250653cab4feaed2e25682e966
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/3790/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3790/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3790/files
chat-agent-tools.md https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-4d44c4152cef5fa2ff8331886d7ca0aa7de7eb0a0fb1d8a088b314173a31d37f
ai-shared.ts https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-9393fc0c89967bc50f8e62dc61de644be02def679352ba2ee87ebd00b041edf2
ai.ts https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
mockChatAgent.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-57bae465d6d60ad1ba7ad0a3d65dbd8febd0b8ad573c71def72beff99a0f6687
chat-sidebar.tsx https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1519992818e32684e55ae41a5aa366e6eaca92bd80b4317f685fd4a15ece0a01
chat-tools-schemas.ts https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1fc739ddb2c9223e18a997a70a8e03ce7ca34499132e6cee6d7b680f9f3c4244
chat.ts https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-d9f452b518ccf8158728d69c59db83139af4f72d429753e47fcd0b3293881302
.changeset/chat-agent-tools.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-4d44c4152cef5fa2ff8331886d7ca0aa7de7eb0a0fb1d8a088b314173a31d37f
View file https://github.com/triggerdotdev/trigger.dev/blob/30e98538270894250653cab4feaed2e25682e966/.changeset/chat-agent-tools.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3790/{{ revealButtonHref }}
packages/trigger-sdk/src/v3/ai-shared.tshttps://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-9393fc0c89967bc50f8e62dc61de644be02def679352ba2ee87ebd00b041edf2
View file https://github.com/triggerdotdev/trigger.dev/blob/30e98538270894250653cab4feaed2e25682e966/packages/trigger-sdk/src/v3/ai-shared.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3790/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-9393fc0c89967bc50f8e62dc61de644be02def679352ba2ee87ebd00b041edf2
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-9393fc0c89967bc50f8e62dc61de644be02def679352ba2ee87ebd00b041edf2
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-9393fc0c89967bc50f8e62dc61de644be02def679352ba2ee87ebd00b041edf2
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-9393fc0c89967bc50f8e62dc61de644be02def679352ba2ee87ebd00b041edf2
packages/trigger-sdk/src/v3/ai.tshttps://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
View file https://github.com/triggerdotdev/trigger.dev/blob/30e98538270894250653cab4feaed2e25682e966/packages/trigger-sdk/src/v3/ai.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3790/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3790/files
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
https://github.com/triggerdotdev/trigger.dev/pull/3790/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3790/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.