Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MattieTK
Copy link
Member

@MattieTK MattieTK commented Jan 7, 2026

Note: This PR was written by OpenCode Opus 4.5 and reviewed by @MattieTK.

Summary

Backport of #11820 to v3-maintenance branch.

This PR adds AI agent detection to Wrangler v3 analytics events using the am-i-vibing library. When Wrangler commands are executed by AI coding agents (such as Claude Code, Cursor, GitHub Copilot, etc.), the agent ID is now included as an agent property in all analytics events.

Why backport to v3?

Understanding how much AI agent usage is happening on Wrangler v3 (which will become increasingly outdated) is valuable data. This helps Cloudflare understand the scope of potential issues arising from agents installing/using older Wrangler versions.

Changes

  • Detects AI coding environments at dispatcher initialization
  • Adds agent property to CommonEventProperties type
  • Includes agent ID in both command events and adhoc events
  • Agent is null when not running in an agentic environment
  • Silent failure (agent = null) if detection throws an error

Supported Agents

The library detects agents including: Claude Code, Cursor, GitHub Copilot, Windsurf, Zed, Aider, Codex CLI, Jules, Replit, Warp, and others.


  • Tests
    • Tests included/updated
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: Telemetry documentation updated in telemetry.md

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

cute robot cat

@MattieTK MattieTK requested a review from a team as a code owner January 7, 2026 14:29
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

🦋 Changeset detected

Latest commit: 113be65

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

This PR includes changesets to release 1 package
Name Type
wrangler 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

@MattieTK MattieTK marked this pull request as draft January 7, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

1 participant