feat: export getDefaultDispatcher#594
Merged
Merged
Conversation
Lets consumers wrapping fetch (e.g. via the `customFetch` option) reuse the SDK's `EnvHttpProxyAgent` instead of building their own, so `HTTP_PROXY` / `HTTPS_PROXY` / `NO_PROXY` are honoured on the wrapped path too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doistbot
reviewed
May 1, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
This PR exposes getDefaultDispatcher from the SDK to help consumers using customFetch retain proxy support. It is a valuable update that will simplify workarounds for tools like the CLI while ensuring consistent connection handling. However, there are a couple of considerations regarding the risk of exposing a shared internal singleton that external consumers might unintentionally close, as well as the need for a top-level smoke test to verify the public export.
doist-release-bot Bot
added a commit
that referenced
this pull request
May 1, 2026
## [10.1.0](v10.0.0...v10.1.0) (2026-05-01) ### Features * export getDefaultDispatcher ([#594](#594)) ([1dad069](1dad069))
Contributor
|
🎉 This PR is included in version 10.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getDefaultDispatcherfromsrc/transport/http-dispatcherso it is part of the public SDK surface.Why
Consumers that opt into the
customFetchoption (e.g. to attach extra request headers) currently bypass the SDK's native-fetch branch intransport/fetch-with-retry.ts, which is the only placeEnvHttpProxyAgentis wired up. As a result, those consumers silently loseHTTP_PROXY/HTTPS_PROXY/NO_PROXYsupport.This was just hit in the wild by
todoist-cli— see Doist/todoist-cli#304. The CLI worked around it by re-implementinggetDefaultDispatcherlocally and addingundicias a direct dependency. Exporting the helper from the SDK lets the CLI (and any othercustomFetchconsumer) drop that copy and reuse a single shared dispatcher instance.Test plan
npm test— 571 passing, no new tests needed (existing coverage insrc/transport/http-dispatcher.test.tsalready exercises the function).npm run check— lint + format clean.npm run build—getDefaultDispatcherappears indist/esm/index.js,dist/cjs/index.js, anddist/types/index.d.ts.main(the 4 pre-existing errors inapp-installations,apps, andui-extensionstest fixtures are not related to this PR).🤖 Generated with Claude Code