fix(wrangler): do not query the GitHub skills API when telemetry is disabled - #15382
Merged
NuroDev merged 1 commit intoSep 1, 2026
Merged
Conversation
…isabled Both sendAdhocEvent and sendCommandEvent started the skills install status lookup at the head of the dispatch promise chain, while the telemetry permission was only checked later inside dispatch(). Users who opted out via WRANGLER_SEND_METRICS, DO_NOT_TRACK, or send_metrics still generated GitHub API requests whose result was then discarded. The dispatcher now checks getMetricsConfig(options).enabled first and only starts the lookup when telemetry is enabled. Fixes cloudflare#15344
🦋 Changeset detectedLatest commit: a2d238e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
workers-devprod
requested review from
a team and
NuroDev
and removed request for
a team
August 27, 2026 03:49
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
NuroDev
approved these changes
Sep 1, 2026
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
workers-devprod
approved these changes
Sep 1, 2026
workers-devprod
left a comment
Contributor
There was a problem hiding this comment.
Codeowners reviews satisfied
Merged
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.
Fixes #15344
Telemetry events carry a
currentAgentSkillsInstalledproperty, resolved bytelemetryCurrentAgentSkillsInstalled(), which can query the GitHub Contents API forcloudflare/skills. IngetMetricsDispatcher, bothsendAdhocEventandsendCommandEventstarted that lookup at the head of the dispatch promise chain, while the telemetry permission was only checked afterwards insidedispatch(). So a user who opted out viaWRANGLER_SEND_METRICS=false,DO_NOT_TRACK, orsend_metricsin the Wrangler config still generated GitHub requests on behalf of telemetry; the payload was built and then discarded. That is the firewall prompt reported in the issue.The dispatcher now resolves the property through a small helper that consults
getMetricsConfig(options).enabledfirst and short circuits to a resolvednullwhen telemetry is disabled, so the lookup only starts when the event will actually be sent. These are the only two call sites oftelemetryCurrentAgentSkillsInstalled()outside its own module and tests. Behaviour with telemetry enabled is unchanged, and so is the "Dispatching disabled" debug log, whose inline snapshot inmetrics.test.tsis untouched.Tests (
packages/wrangler/src/__tests__/metrics.test.ts): two tests added beside the existing disabled dispatcher test. They restore the realtelemetryCurrentAgentSkillsInstalledimplementation (vitest.setup.tsnormally stubs it out) and register msw handlers for the two GitHub endpoints so requests are observable:On unmodified
mainboth tests fail: the disabled case invokes the lookup twice (expected "telemetryCurrentAgentSkillsInstalled" to not be called at all, but actually been called 2 times), and the enabled case then sees zero fetches because the opted out run already memoised the result. With the fix,metrics.test.tspasses 58 tests, andagents-skills-install.test.ts,metrics/sanitization.test.tsandregister-yargs-command-skills.test.tsstay green (160 tests across the four files, vitest 4.1.0).tsc,oxlint --deny-warnings --type-awareandoxfmt --checkare clean on the changed files.A patch changeset for
wrangleris included.