René's URL Explorer Experiment


Title: fix(core): truncate large error stacks and messages to prevent OOM by ericallam · Pull Request #3405 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(core): truncate large error stacks and messages to prevent OOM by ericallam · Pull Request #3405 · triggerdotdev/trigger.dev

X Title: fix(core): truncate large error stacks and messages to prevent OOM by ericallam · Pull Request #3405 · triggerdotdev/trigger.dev

Description: Summary Large error stacks and messages can OOM the worker process when serialized into OTel spans or TaskRunError objects. This was reported when throwing an error with a massive .stack property from a chat agent hook. This adds frame-based stack truncation (similar to Sentry's approach) plus message length limits, applied consistently across all error serialization paths. What changed packages/core/src/v3/errors.ts truncateStack() — parses error.stack into message lines + frame lines, caps at 50 frames (keep top 5 closest to throw + bottom 45 entry points, with "... N frames omitted ..." in between). Individual lines capped at 1024 chars. truncateMessage() — caps error messages at 1000 chars Applied in parseError() and sanitizeError() packages/core/src/v3/otel/utils.ts sanitizeSpanError() now uses truncateStack and truncateMessage from errors.ts instead of duplicating truncation logic Non-Error values (strings, JSON) capped at 5000 chars packages/core/src/v3/tracer.ts startActiveSpan catch block now delegates to recordSpanException() instead of calling span.recordException() directly Limits What Limit Rationale Stack frames 50 Matches Sentry's STACKTRACE_FRAME_LIMIT Top frames kept 5 Closest to throw site Bottom frames kept 45 Entry points / framework frames Per-line length 1024 Matches Sentry, prevents regex DoS Message length 1000 Bounded but generous Generic string (non-Error) 5000 Fallback for JSON/string errors in spans Test plan 17 unit tests in packages/core/test/errors.test.ts E2E: threw a 300-frame / 5000-char-message error in the ai-chat reference app, verified truncated stack and message in span via get_span_details Verified the run survived the error (no OOM, continued waiting for next message)

Open Graph Description: Summary Large error stacks and messages can OOM the worker process when serialized into OTel spans or TaskRunError objects. This was reported when throwing an error with a massive .stack property f...

X Description: Summary Large error stacks and messages can OOM the worker process when serialized into OTel spans or TaskRunError objects. This was reported when throwing an error with a massive .stack property f...

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

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:76cceaa6-f06e-702a-b80e-35f641ee3278
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9B94:3C1EA1:36D8E8C:4A9F245:6AFAF1FD
html-safe-nonce91b3510140d39dcf13a0f9aee467a7dd13833c05b4bbd53380772c61a594c374
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Qjk0OjNDMUVBMTozNkQ4RThDOjRBOUYyNDU6NkFGQUYxRkQiLCJ2aXNpdG9yX2lkIjoiNTM1NDA3ODkxNjk5NjQyODI4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf7181374ce11fce12207f8391418ac69996a0b010885d5ae7d484872c7839d53
hovercard-subject-tagpull_request:3544565270
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/3405/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 Large error stacks and messages can OOM the worker process when serialized into OTel spans or TaskRunError objects. This was reported when throwing an error with a massive .stack property f...
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
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/3405/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3405%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%2F3405%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/3405/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3405/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
fix/truncate-large-error-stackshttps://github.com/triggerdotdev/trigger.dev/tree/fix/truncate-large-error-stacks
Conversation 28 https://github.com/triggerdotdev/trigger.dev/pull/3405
Commits 3 https://github.com/triggerdotdev/trigger.dev/pull/3405/commits
Checks 45 https://github.com/triggerdotdev/trigger.dev/pull/3405/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/3405/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
fix(core): truncate large error stacks and messages to prevent OOM https://github.com/triggerdotdev/trigger.dev/pull/3405/files#top
Show all changes 3 commits https://github.com/triggerdotdev/trigger.dev/pull/3405/files
589b03f fix(core): truncate large error stacks and messages to prevent OOM ericallam Apr 17, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3405/commits/589b03fc9bfe6ad74d725e1fe99348a1c1987cc5
d05f017 fix(core): address PR review feedback on error truncation ericallam Apr 17, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3405/commits/d05f017e73236597cb074fe7d57cf8abbb4fa9b7
e4b2707 fix(core): preserve undefined for optional INTERNAL_ERROR fields ericallam Apr 17, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3405/commits/e4b2707497c15ba5b5c215053a5b5eaf913263c0
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/3405/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
truncate-error-stacks.md https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-84a1deef76bf8e7b3b9f935083eaf448aea834e3871763050b15e781a31ffaf2
errors.ts https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-f85300d28424755d0824ae90458aed5cd9385be4b9276a4b6c3808b3d536fbfc
utils.ts https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-4e616830a4fb8606bf5bb24e1fe9bb4b77ef3324891d935497544d5dd2c6a9b0
tracer.ts https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-2d4c3789c1164bb47ec9d846793c92cb8f20af08ba5ea422ec9778def7d0c8e3
errors.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-ecf8c55da7e20f102b5fe44c70c7f81174d8a230e0f742e142c09a828d1c00bf
recordSpanException.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-a9c3b200343b3edd233e45ea7284657b434cf3f23a05fcd3f76229ee051b0cfb
.changeset/truncate-error-stacks.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-84a1deef76bf8e7b3b9f935083eaf448aea834e3871763050b15e781a31ffaf2
View file https://github.com/triggerdotdev/trigger.dev/blob/e4b2707497c15ba5b5c215053a5b5eaf913263c0/.changeset/truncate-error-stacks.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3405/{{ revealButtonHref }}
packages/core/src/v3/errors.tshttps://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-f85300d28424755d0824ae90458aed5cd9385be4b9276a4b6c3808b3d536fbfc
View file https://github.com/triggerdotdev/trigger.dev/blob/e4b2707497c15ba5b5c215053a5b5eaf913263c0/packages/core/src/v3/errors.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3405/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-f85300d28424755d0824ae90458aed5cd9385be4b9276a4b6c3808b3d536fbfc
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-f85300d28424755d0824ae90458aed5cd9385be4b9276a4b6c3808b3d536fbfc
https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-f85300d28424755d0824ae90458aed5cd9385be4b9276a4b6c3808b3d536fbfc
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-f85300d28424755d0824ae90458aed5cd9385be4b9276a4b6c3808b3d536fbfc
packages/core/src/v3/otel/utils.tshttps://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-4e616830a4fb8606bf5bb24e1fe9bb4b77ef3324891d935497544d5dd2c6a9b0
View file https://github.com/triggerdotdev/trigger.dev/blob/e4b2707497c15ba5b5c215053a5b5eaf913263c0/packages/core/src/v3/otel/utils.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3405/{{ revealButtonHref }}
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-4e616830a4fb8606bf5bb24e1fe9bb4b77ef3324891d935497544d5dd2c6a9b0
packages/core/src/v3/tracer.tshttps://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-2d4c3789c1164bb47ec9d846793c92cb8f20af08ba5ea422ec9778def7d0c8e3
View file https://github.com/triggerdotdev/trigger.dev/blob/e4b2707497c15ba5b5c215053a5b5eaf913263c0/packages/core/src/v3/tracer.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3405/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-2d4c3789c1164bb47ec9d846793c92cb8f20af08ba5ea422ec9778def7d0c8e3
https://github.com/triggerdotdev/trigger.dev/pull/3405/files#diff-2d4c3789c1164bb47ec9d846793c92cb8f20af08ba5ea422ec9778def7d0c8e3
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3405/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.