René's URL Explorer Experiment


Title: fix(sdk,core): head-start handover correctness and continuation boot latency by ericallam · Pull Request #3907 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(sdk,core): head-start handover correctness and continuation boot latency by ericallam · Pull Request #3907 · triggerdotdev/trigger.dev

X Title: fix(sdk,core): head-start handover correctness and continuation boot latency by ericallam · Pull Request #3907 · triggerdotdev/trigger.dev

Description: Summary Three related fixes for chat.headStart and continuation boots, found while investigating customer reports. 1. chat.headStart now works with hydrateMessages. The turn-0 handover splice only ran on the default accumulation path, so agents registering hydrateMessages silently lost the warm route's step-1 response: pure-text turns fired onTurnComplete with no assistant message (and an empty durable write), tool-call turns re-ran step 1 from scratch under a fresh messageId, and the head-start user message never reached the hydrate hook at all. The first-turn history now reaches hydrateMessages as incomingMessages, and the splice runs after both accumulation branches, deduplicated by the handover messageId. 2. Reasoning parts survive the handover. The synthesized partial only mapped text and tool-call parts, so an extended-thinking model's step-1 reasoning streamed to the browser but never reached durable history. Reasoning parts now map through with provider metadata, so Anthropic thinking signatures survive a UIMessage round trip on hydrate replays. 3. Continuation boots no longer stall for ~10 seconds. The .in resume cursor was found by draining an SSE subscription that only closes after its 5 second inactivity window, and the scan ran twice per boot. It is now a non-blocking records read of the latest turn-complete header, runs at most once per boot, the boot reads run concurrently, and chat snapshots carry the cursor so subsequent boots skip the scan entirely. Measured locally on a cancel-then-continue repro: pre-turn continuation latency dropped from ~11s to ~0.5s. Every fix was verified red-green: new unit tests reproduced each failure before the fix, and end-to-end smoke tests against a live local stack covered both handover legs, reasoning persistence with extended thinking (including a follow-up turn that round-trips the persisted signed reasoning back to the provider), and the boot timing comparison. Rollout SDK-only; no server change required. A new SDK against a server that does not serialize record headers degrades to the existing no-cursor fallback. Old SDKs ignore the new snapshot field, and new SDKs fall back to the records scan on snapshots written before it existed.

Open Graph Description: Summary Three related fixes for chat.headStart and continuation boots, found while investigating customer reports. 1. chat.headStart now works with hydrateMessages. The turn-0 handover splice only ...

X Description: Summary Three related fixes for chat.headStart and continuation boots, found while investigating customer reports. 1. chat.headStart now works with hydrateMessages. The turn-0 handover splice only ...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5c64382e-a088-f36a-310d-08572dbf6c70
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA788:109611:1069:15BD:6AFBD546
html-safe-nonce38ddd7ced1a49d77bc9b2460a7c86d442a98494a1c878dc088c95d04844c8a19
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzg4OjEwOTYxMToxMDY5OjE1QkQ6NkFGQkQ1NDYiLCJ2aXNpdG9yX2lkIjoiMjkxNTk0NjE2NDgzMjE2MzE0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac473a7e1f393267ee15f8de97c909171b08003c98e23a900d0c36e7991e8f7fa5
hovercard-subject-tagpull_request:3848592208
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/3907/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 Three related fixes for chat.headStart and continuation boots, found while investigating customer reports. 1. chat.headStart now works with hydrateMessages. The turn-0 handover splice only ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None18742cb872ec73544356e60359266b67aafece70c4ce008042e06227924cdd07
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
release820be804f18e1ef3940bd74a00d41d73d02e2b91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3907%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%2F3907%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/3907/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3907/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3907/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/chat-headstart-hydratehttps://github.com/triggerdotdev/trigger.dev/tree/fix/chat-headstart-hydrate
Conversation 10 https://github.com/triggerdotdev/trigger.dev/pull/3907
Commits 4 https://github.com/triggerdotdev/trigger.dev/pull/3907/commits
Checks 62 https://github.com/triggerdotdev/trigger.dev/pull/3907/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/3907/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3907/files
fix(sdk,core): head-start handover correctness and continuation boot latency https://github.com/triggerdotdev/trigger.dev/pull/3907/files#top
Show all changes 4 commits https://github.com/triggerdotdev/trigger.dev/pull/3907/files
f4e7fb2 fix(sdk): deliver the head-start handover partial when hydrateMessage… ericallam Jun 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3907/commits/f4e7fb27477590a753d72e827e389068819d6aeb
ba8bab3 fix(sdk): preserve reasoning parts across the head-start handover ericallam Jun 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3907/commits/ba8bab39d0c126298d20f1c885d02a841413011b
4a88e92 fix(sdk,core): stop continuation chat boots idle-waiting on the sessi… ericallam Jun 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3907/commits/4a88e921e0d50720b8ae357a6f54e2e82d57a537
9042df6 fix(sdk): retry the resume-cursor scan when the boot lookup fails tra… ericallam Jun 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3907/commits/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/3907/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3907/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3907/files
chat-boot-cursor.md https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-58e0e6fd0d6fa2ee012050de47d49033625b39206e650c036b129ae737e9e9e3
chat-headstart-hydrate.md https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-622a1dae03a02716b5fbd764b559f7ed5d0b8ac964e3d5bc3fd7a0a017ed1a0f
chat-headstart-reasoning.md https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-162e9141dac08460b21c9173d530ef1b085b11a5cad4eb6601d756cce63341ad
api.ts https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
chatSnapshot.ts https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-8208d71e468f9fab9c888724cc4cf34613b29cf0293b6a76fa0f4ba39b10bb63
ai.ts https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
mock-chat-agent.ts https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-d5b3e51c31466b619dfd277ca1526277dad3ff6d73a80fc63761c5d126afb73c
chatHandover.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-ff1841c9aee3b33e838af89993f46858e1a1d10f9e45ac473196a7d69e232d11
mockChatAgent.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-57bae465d6d60ad1ba7ad0a3d65dbd8febd0b8ad573c71def72beff99a0f6687
replay-session-in.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-d6327c125cb243c0a3461ac73303829e17217157ddb191e3f855e17340330f4b
.changeset/chat-boot-cursor.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-58e0e6fd0d6fa2ee012050de47d49033625b39206e650c036b129ae737e9e9e3
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/.changeset/chat-boot-cursor.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3907/{{ revealButtonHref }}
.changeset/chat-headstart-hydrate.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-622a1dae03a02716b5fbd764b559f7ed5d0b8ac964e3d5bc3fd7a0a017ed1a0f
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/.changeset/chat-headstart-hydrate.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3907/{{ revealButtonHref }}
.changeset/chat-headstart-reasoning.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-162e9141dac08460b21c9173d530ef1b085b11a5cad4eb6601d756cce63341ad
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/.changeset/chat-headstart-reasoning.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3907/{{ revealButtonHref }}
packages/core/src/v3/schemas/api.tshttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/packages/core/src/v3/schemas/api.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3907/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-c929980f61a97fbebd23b497e2303aa302e5365161fbea596997800df6a4c6c4
packages/core/src/v3/sessionStreams/chatSnapshot.tshttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-8208d71e468f9fab9c888724cc4cf34613b29cf0293b6a76fa0f4ba39b10bb63
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/packages/core/src/v3/sessionStreams/chatSnapshot.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3907/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-8208d71e468f9fab9c888724cc4cf34613b29cf0293b6a76fa0f4ba39b10bb63
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-8208d71e468f9fab9c888724cc4cf34613b29cf0293b6a76fa0f4ba39b10bb63
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-8208d71e468f9fab9c888724cc4cf34613b29cf0293b6a76fa0f4ba39b10bb63
packages/trigger-sdk/src/v3/ai.tshttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-1a41664a01679e09d7182b5d113a193cea9eaad0f2092f68b4beca081617a53a
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/packages/trigger-sdk/src/v3/ai.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3907/files
packages/trigger-sdk/src/v3/test/mock-chat-agent.tshttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-d5b3e51c31466b619dfd277ca1526277dad3ff6d73a80fc63761c5d126afb73c
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/packages/trigger-sdk/src/v3/test/mock-chat-agent.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3907/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-d5b3e51c31466b619dfd277ca1526277dad3ff6d73a80fc63761c5d126afb73c
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-d5b3e51c31466b619dfd277ca1526277dad3ff6d73a80fc63761c5d126afb73c
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-d5b3e51c31466b619dfd277ca1526277dad3ff6d73a80fc63761c5d126afb73c
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-d5b3e51c31466b619dfd277ca1526277dad3ff6d73a80fc63761c5d126afb73c
packages/trigger-sdk/test/chatHandover.test.tshttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-ff1841c9aee3b33e838af89993f46858e1a1d10f9e45ac473196a7d69e232d11
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/packages/trigger-sdk/test/chatHandover.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3907/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-ff1841c9aee3b33e838af89993f46858e1a1d10f9e45ac473196a7d69e232d11
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-ff1841c9aee3b33e838af89993f46858e1a1d10f9e45ac473196a7d69e232d11
packages/trigger-sdk/test/mockChatAgent.test.tshttps://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-57bae465d6d60ad1ba7ad0a3d65dbd8febd0b8ad573c71def72beff99a0f6687
View file https://github.com/triggerdotdev/trigger.dev/blob/9042df6f2a8c80275f8d8f77b75c2b440b8f95c4/packages/trigger-sdk/test/mockChatAgent.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3907/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-57bae465d6d60ad1ba7ad0a3d65dbd8febd0b8ad573c71def72beff99a0f6687
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3907/files
https://github.com/triggerdotdev/trigger.dev/pull/3907/files#diff-57bae465d6d60ad1ba7ad0a3d65dbd8febd0b8ad573c71def72beff99a0f6687
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3907/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3907/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.