Skip to content

fix: Include currentAgentSkillsInstalled in command telemetry events#14155

Merged
dario-piotrowicz merged 4 commits into
mainfrom
dario/fix-incorrect-currentAgentSkillsInstalled
Jun 2, 2026
Merged

fix: Include currentAgentSkillsInstalled in command telemetry events#14155
dario-piotrowicz merged 4 commits into
mainfrom
dario/fix-incorrect-currentAgentSkillsInstalled

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

Fixes #[insert GH or internal issue link(s)].

Describe your change...


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: already documented in telemetry.md

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

🦋 Changeset detected

Latest commit: 645faf3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
@cloudflare/wrangler-bundler Patch

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

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Jun 2, 2026

The doc claim holds — telemetry.md line 30 covers this.

Now let me assess the core logic once more for a real bug. The critical question: does wrapping command dispatch in the async telemetryCurrentAgentSkillsInstalled() chain risk the "started" event being sent AFTER "completed"?

Both events capture amplitude_event_id synchronously (0 for started, 1 for completed). The actual network dispatch ordering doesn't matter for analytics since ordering is reconstructed from amplitude_event_id. The memoized promise resolves once; both .then callbacks fire in registration order (started registered first). So even network ordering is preserved. No bug.

Let me double-check the agent detection failure path and that the inner .catch doesn't swallow something it shouldn't. The structure is sound: telemetryCurrentAgentSkillsInstalled().catch(() => null) ensures the value defaults to null, then dispatch, then a final .catch logs dispatch errors. This mirrors the adhoc event exactly.

The PR is a faithful, minimal fix that mirrors the existing adhoc-event pattern, is properly tested (the reused object includes the new property, covering started/completed/errored), preserves event-ordering semantics, handles errors correctly, and the documentation claim is accurate.

I've verified:

  • No logic bug in the async wrapping (event IDs captured synchronously; ordering preserved)
  • Error handling is equivalent/correct
  • Test coverage includes the new property across started/completed/errored events
  • Doc claim in telemetry.md is accurate
  • Type safety is unaffected (uses existing loose Properties record pattern, consistent with adhoc events)

LGTM

github run

@github-actions

This comment was marked as low quality.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 2, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14155

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14155

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14155

miniflare

npm i https://pkg.pr.new/miniflare@14155

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14155

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14155

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14155

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14155

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14155

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14155

wrangler

npm i https://pkg.pr.new/wrangler@14155

@cloudflare/wrangler-bundler

npm i https://pkg.pr.new/@cloudflare/wrangler-bundler@14155

commit: 645faf3

@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review June 2, 2026 13:46
@workers-devprod workers-devprod requested review from a team and penalosa and removed request for a team June 2, 2026 13:47
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Jun 2, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jun 2, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@dario-piotrowicz dario-piotrowicz enabled auto-merge (squash) June 2, 2026 13:56
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@dario-piotrowicz dario-piotrowicz disabled auto-merge June 2, 2026 14:06
@dario-piotrowicz dario-piotrowicz enabled auto-merge (squash) June 2, 2026 14:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

⚠️ Issues found

.changeset/include-agent-skills-in-command-events.md

  • Version Type: This changeset is categorized as patch, but it describes a telemetry/analytics change (including agent skill installation status in all telemetry events). Per the review criteria and changeset guidelines: "If the change collects more analytics, it should be a minor even though there is no user-visible change." This should be bumped to minor.

Comment thread .changeset/include-agent-skills-in-command-events.md Outdated
@dario-piotrowicz dario-piotrowicz merged commit 42288d4 into main Jun 2, 2026
53 of 54 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/fix-incorrect-currentAgentSkillsInstalled branch June 2, 2026 14:22
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants