René's URL Explorer Experiment


Title: fix(trigger-sdk): resubscribe to session.out across empty long-poll windows (#5056) by ghazy2001 · Pull Request #5063 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(trigger-sdk): resubscribe to session.out across empty long-poll windows (#5056) by ghazy2001 · Pull Request #5063 · triggerdotdev/trigger.dev

X Title: fix(trigger-sdk): resubscribe to session.out across empty long-poll windows (#5056) by ghazy2001 · Pull Request #5063 · triggerdotdev/trigger.dev

Description: Closes #5056 ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Description In chat.headStart, stitchHandoverStream reads the agent's session.out stream to relay chunks to the browser until turn-complete. When a long-running tool or agent step executes for longer than the S2 long-poll deadline (~60s) without emitting chunks, the SSE connection ends with an empty window before turn-complete. Previously, this caused the relay to close prematurely, writing only trigger:session-state and cutting off the first turn while the agent run was still in progress. As a result, the browser transport cleared isStreaming, giving the user a premature completion while the agent was still running. Solution This PR loops the session.out subscription in stitchHandoverStream until turn-complete or request abort: Resumes each subscription window from latestEventId ?? customerLastEventId. Applies exponential jittered backoff via waitBeforeEofResubscribe between empty windows. Resets consecutive empty windows count when records arrive (emptyWindows = windowHadRecords ? 0 : emptyWindows + 1). Binds consecutive empty reconnects to MAX_EOF_RESUBSCRIBES (5) to prevent infinite loops if a turn is permanently stalled. Testing Verified existing unit tests pass (chat-server.test.ts, chat-client.test.ts). Added unit test resubscribes to session.out when an empty long-poll window closes mid-turn (#5056) to verify that an initial empty window does not cut off the response, and subsequent chunks/turn-complete are relayed properly. Added unit test errors the stream once reconnect budget is exhausted on consecutive empty windows to verify that MAX_EOF_RESUBSCRIBES errors the stream cleanly when the turn fails to complete. Ran oxlint, oxfmt, and typechecking (tsc --noEmit). Changelog fix(trigger-sdk): Loop session.out read in chat.headStart across empty long-poll windows until turn-complete or abort.

Open Graph Description: Closes #5056 ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Description In chat.headStart, stitchHandove...

X Description: Closes #5056 ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Description In chat.headStart, stitchHandove...

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

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:3475ff7b-f95c-291f-0f8f-caf3232e2a16
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD614:3776CB:2F8E83C:40AD841:6AFADB09
html-safe-nonce437df500cac98bb4effbf0bfdb97fd708a483d096a0be8a9c8a78a67c586cfc4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjE0OjM3NzZDQjoyRjhFODNDOjQwQUQ4NDE6NkFGQURCMDkiLCJ2aXNpdG9yX2lkIjoiMjkxOTc3OTk4MTQ4OTUyNzU2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac844a991f5b77fe958df478d3786fff33d133e2e0149d051d7627ca5330a907e2
hovercard-subject-tagpull_request:5003953771
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/5063/files
twitter:imagehttps://avatars.githubusercontent.com/u/68187836?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/68187836?s=400&v=4
og:image:altCloses #5056 ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Description In chat.headStart, stitchHandove...
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-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/5063/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F5063%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%2F5063%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/5063/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/5063/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/5063/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 requests65 (65)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
ghazy2001https://github.com/ghazy2001
triggerdotdev:mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
ghazy2001:fix/chat-head-start-empty-long-poll-resubscribehttps://github.com/ghazy2001/trigger.dev/tree/fix/chat-head-start-empty-long-poll-resubscribe
Conversation 8 https://github.com/triggerdotdev/trigger.dev/pull/5063
Commits 1 https://github.com/triggerdotdev/trigger.dev/pull/5063/commits
Checks 2 https://github.com/triggerdotdev/trigger.dev/pull/5063/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/5063/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5063/files
fix(trigger-sdk): resubscribe to session.out across empty long-poll windows (#5056) https://github.com/triggerdotdev/trigger.dev/pull/5063/files#top
Show all changes 1 commit https://github.com/triggerdotdev/trigger.dev/pull/5063/files
bf3834a fix(trigger-sdk): resubscribe to session.out across empty long-poll w… ghazy2001 Oct 25, 2026 https://github.com/triggerdotdev/trigger.dev/pull/5063/commits/bf3834ac2f95482a9212c3bfc112931f5796eea1
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/5063/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5063/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5063/files
chat-head-start-empty-poll-resubscribe.md https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-c87bcf450447bf5325b04cdf274692ba9696e2c3e2a8ff2f30da0796c6479d58
chat-server.test.ts https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
chat-server.ts https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-2a5ecaa706016614dfb6966b983452dfc2db84a6e51afb639233cfd1207cf8fc
.changeset/chat-head-start-empty-poll-resubscribe.mdhttps://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-c87bcf450447bf5325b04cdf274692ba9696e2c3e2a8ff2f30da0796c6479d58
View file https://github.com/ghazy2001/trigger.dev/blob/bf3834ac2f95482a9212c3bfc112931f5796eea1/.changeset/chat-head-start-empty-poll-resubscribe.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5063/{{ revealButtonHref }}
devin-ai-integrationhttps://github.com/apps/devin-ai-integration
Oct 25, 2026https://github.com/triggerdotdev/trigger.dev/pull/5063/files#r4370530894
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/5063
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5063/files
ghazy2001https://github.com/ghazy2001
Oct 25, 2026https://github.com/triggerdotdev/trigger.dev/pull/5063/files#r4370535215
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
438f671https://github.com/triggerdotdev/trigger.dev/commit/438f67148f1e10fa7c78f7685b5f91ad8f646d4e
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5063/files
packages/trigger-sdk/src/v3/chat-server.test.tshttps://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
View file https://github.com/ghazy2001/trigger.dev/blob/bf3834ac2f95482a9212c3bfc112931f5796eea1/packages/trigger-sdk/src/v3/chat-server.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5063/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
devin-ai-integrationhttps://github.com/apps/devin-ai-integration
Oct 25, 2026https://github.com/triggerdotdev/trigger.dev/pull/5063/files#r4370530842
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/5063
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5063/files
ghazy2001https://github.com/ghazy2001
Oct 25, 2026https://github.com/triggerdotdev/trigger.dev/pull/5063/files#r4370535616
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5063/files
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-285bb70c688bf6dc3d3e34034620e85dfd77e2b36567fa8b1c2cc7db9ba583b9
packages/trigger-sdk/src/v3/chat-server.tshttps://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-2a5ecaa706016614dfb6966b983452dfc2db84a6e51afb639233cfd1207cf8fc
View file https://github.com/ghazy2001/trigger.dev/blob/bf3834ac2f95482a9212c3bfc112931f5796eea1/packages/trigger-sdk/src/v3/chat-server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5063/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-2a5ecaa706016614dfb6966b983452dfc2db84a6e51afb639233cfd1207cf8fc
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-2a5ecaa706016614dfb6966b983452dfc2db84a6e51afb639233cfd1207cf8fc
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-2a5ecaa706016614dfb6966b983452dfc2db84a6e51afb639233cfd1207cf8fc
https://github.com/triggerdotdev/trigger.dev/pull/5063/files#diff-2a5ecaa706016614dfb6966b983452dfc2db84a6e51afb639233cfd1207cf8fc
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.