René's URL Explorer Experiment


Title: bug: getRunIdForOptions function is duplicated, contains inconsistent fallback behavior · Issue #2852 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: bug: getRunIdForOptions function is duplicated, contains inconsistent fallback behavior · Issue #2852 · triggerdotdev/trigger.dev

X Title: bug: getRunIdForOptions function is duplicated, contains inconsistent fallback behavior · Issue #2852 · triggerdotdev/trigger.dev

Description: Provide environment information System: OS: macOS 15.7.3 CPU: (16) arm64 Apple M4 Max Memory: 1.99 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.16.0 - Yarn: 1.22.22 npm: 10.9.2 pnpm: 10.26.2 Watchman: 2026.01.05.00 Describe the...

Open Graph Description: Provide environment information System: OS: macOS 15.7.3 CPU: (16) arm64 Apple M4 Max Memory: 1.99 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.16.0 - Yarn: 1.22.22 npm: 10.9.2 pnpm: 10.2...

X Description: Provide environment information System: OS: macOS 15.7.3 CPU: (16) arm64 Apple M4 Max Memory: 1.99 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.16.0 - Yarn: 1.22.22 npm: 10.9.2 pnpm: 10.2...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/2852

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: getRunIdForOptions function is duplicated, contains inconsistent fallback behavior","articleBody":"### Provide environment information\n\nSystem:\n    OS: macOS 15.7.3\n    CPU: (16) arm64 Apple M4 Max\n    Memory: 1.99 GB / 64.00 GB\n    Shell: 5.9 - /bin/zsh\n\n  Binaries:\n    Node: 22.16.0 - \n    Yarn: 1.22.22 \n    npm: 10.9.2 \n    pnpm: 10.26.2 \n    Watchman: 2026.01.05.00 \n\n### Describe the bug\n\nThe `getRunIdForOptions` function is duplicated in two locations with inconsistent fallback behavior. The SDK version (`packages/trigger-sdk/src/v3/streams.ts`) lacks fallback logic that exists in the core implementation (`packages/core/src/v3/realtimeStreams/manager.ts`).\n\nWhen calling `streams.pipe(\"key\", stream, { target: \"root\" })` from a root task (a task not triggered by another task), the SDK throws an error instead of falling back to the current run ID. The semantic meaning of target: \"root\" is \"send to the root of this task tree\" - if the current task IS the root, it should behave the same as target: \"self\".\n\n\n### Reproduction repo\n\nThis can be reproduced in any Trigger.dev project using the SDK's streams.pipe() API with target: \"root\" from a directly-triggered task.\n\n### To reproduce\n\n```typescript\nimport { streams, task } from \"@trigger.dev/sdk\";\n\n  // This task is triggered directly (not a child of another task)\n  export const rootTask = task({\n    id: \"root-task\",\n    run: async (payload) =\u003e {\n      const myStream = createSomeAsyncGenerator();\n\n      // This will throw an error even though it should work\n      const { waitUntilComplete } = streams.pipe(\"output\", myStream, {\n        target: \"root\"  // Fails because rootTaskRunId is undefined for root tasks\n      });\n\n      await waitUntilComplete();\n    },\n  });\n```\n\n  **Steps:**\n  1. Create a task that is triggered directly (not as a child of another task)\n  2. Call streams.pipe() with { target: \"root\" }\n  3. Observe the error is thrown\n\n\n### Additional information\n\n**Root Cause:** Two `getRunIdForOptions` functions exist with different behavior:\n\n  | File | Fallback for `\"root\"`/`\"parent\"`? |\n  |------|----------------------------------|\n  | `packages/trigger-sdk/src/v3/streams.ts:665-683` | ❌ No |\n  | `packages/core/src/v3/realtimeStreams/manager.ts:141-159` | ✅ Yes |\n\n  **Why the core fallback is unreachable:** The SDK resolves targets to string IDs FIRST, then passes them to the core. By the time `StandardRealtimeStreamsManager.pipe()` is called, it receives a string ID (or an error was already thrown), so its fallback logic is dead code for SDK callers.\n\n  **Evidence the fallback is intended:**\n  - Documentation (`docs/tasks/streams.mdx:374,399`) shows `target: \"root\"` as valid usage\n  - Internal API (`packages/core/src/v3/runMetadata/manager.ts:330-333`) passes semantic targets directly and relies on the fallback\n\n  **Origin:** Both functions introduced in same commit (`536d9fa21` - \"feat(realtime): Realtime streams v2 #2632\"). Inconsistency was present from creation.\n\n  **Affected functions:** `streams.pipe()`, `streams.append()`, `streams.writer()` - all use the same `getRunIdForOptions` in `streams.ts`","author":{"url":"https://github.com/robraux","@type":"Person","name":"robraux"},"datePublished":"2026-01-08T15:11:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2852/trigger.dev/issues/2852"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:29e1f2ad-a3d7-5718-d1d1-e20ed0cffc93
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9E68:281ABF:1AA24C2:243CCB7:6964BBCC
html-safe-nonceb4ec8ac206c12be0bb7cfb147ca45adc4ac74d4e5e3205092ea6f38220c8a908
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTY4OjI4MUFCRjoxQUEyNEMyOjI0M0NDQjc6Njk2NEJCQ0MiLCJ2aXNpdG9yX2lkIjoiOTE0NDQ5MDYzOTE5OTg3ODA5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac73a0a6e418bf6dbb640506ce3263191a119847af0eb050bc5a6196cc07778864
hovercard-subject-tagissue:3793287237
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/2852/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2900a67752c2462230d9ff3d70c1f8e5c117d3a3d956df704e4bfe03d529ad6e/triggerdotdev/trigger.dev/issues/2852
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2900a67752c2462230d9ff3d70c1f8e5c117d3a3d956df704e4bfe03d529ad6e/triggerdotdev/trigger.dev/issues/2852
og:image:altProvide environment information System: OS: macOS 15.7.3 CPU: (16) arm64 Apple M4 Max Memory: 1.99 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.16.0 - Yarn: 1.22.22 npm: 10.9.2 pnpm: 10.2...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerobraux
hostnamegithub.com
expected-hostnamegithub.com
None9917306ebdf5f9f30d13ede7b74f08a45b5f12b401ce3e4bfabd895ea0ca0ada
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release020ceddb26807bba62dcfb410905847d63243ff5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/issues/2852#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2F2852
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2F2852
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/2852
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/2852
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/2852
triggerdotdev https://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/issues/2852
Notifications https://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev
Fork 954 https://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev
Star 13.3k https://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev
Code https://github.com/triggerdotdev/trigger.dev
Issues 137 https://github.com/triggerdotdev/trigger.dev/issues
Pull requests 35 https://github.com/triggerdotdev/trigger.dev/pulls
Discussions https://github.com/triggerdotdev/trigger.dev/discussions
Actions https://github.com/triggerdotdev/trigger.dev/actions
Projects 0 https://github.com/triggerdotdev/trigger.dev/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/triggerdotdev/trigger.dev/security
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/issues/2852
Insights https://github.com/triggerdotdev/trigger.dev/pulse
Code https://github.com/triggerdotdev/trigger.dev
Issues https://github.com/triggerdotdev/trigger.dev/issues
Pull requests https://github.com/triggerdotdev/trigger.dev/pulls
Discussions https://github.com/triggerdotdev/trigger.dev/discussions
Actions https://github.com/triggerdotdev/trigger.dev/actions
Projects https://github.com/triggerdotdev/trigger.dev/projects
Security https://github.com/triggerdotdev/trigger.dev/security
Insights https://github.com/triggerdotdev/trigger.dev/pulse
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/2852
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/2852
bug: getRunIdForOptions function is duplicated, contains inconsistent fallback behaviorhttps://github.com/triggerdotdev/trigger.dev/issues/2852#top
https://github.com/robraux
https://github.com/robraux
robrauxhttps://github.com/robraux
on Jan 8, 2026https://github.com/triggerdotdev/trigger.dev/issues/2852#issue-3793287237
#2632https://github.com/triggerdotdev/trigger.dev/pull/2632
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.