Merged
Conversation
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
keelerm84
approved these changes
Feb 19, 2026
This was referenced Feb 19, 2026
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.
Requirements
Related issues
Describe the solution you've provided
Updates the AI SDK's usage tracking to align with the updated spec from sdk-specs PR #132. Three categories of changes:
Renamed all usage tracking event keys to use a unified
$ld:ai:usage:*prefix, replacing the previous$ld:ai:config:function:*,$ld:ai:judge:function:*, and$ld:ai:agent:function:*keys. This makes it easier to filter all SDK usage events in reporting.Added SDK info tracking on initialization (
$ld:ai:sdk-info). WhenLDAIClientis constructed, it now fires a single tracking event with the SDK name, version, and language, using an anonymous context. This ensures the data is captured even if the config tracker is never used.Extracted SDK info into a dedicated
sdk_info.pymodule (similar tosdkInfo.tsin the JS SDK). Usesimportlib.metadatato read the package name and version from installed distribution metadata at import time, which is the idiomatic Python approach. This keeps SDK identity info contained in one place and avoids hardcoded version strings.Key mapping:
$ld:ai:config:function:single$ld:ai:usage:completion-config$ld:ai:config:function:createChat$ld:ai:usage:create-chat$ld:ai:judge:function:single$ld:ai:usage:judge-config$ld:ai:judge:function:createJudge$ld:ai:usage:create-judge$ld:ai:agent:function:single$ld:ai:usage:agent-config$ld:ai:agent:function:multiple$ld:ai:usage:agent-configsHuman review checklist
Context.builder('ld-internal-tracking').anonymous(True).build()) matches spec requirement 1.2.2.1importlib.metadatawith distribution name'launchdarkly-server-sdk-ai'resolves correctly in all supported environments_INIT_TRACK_CONTEXTandsdk_infoconstants are evaluated at module import time — confirm this is acceptableAdditional context
Note
Medium Risk
Primarily changes analytics/event emission paths; risk is moderate because incorrect event keys or metadata lookup failures could silently break usage reporting or introduce import-time runtime errors in some environments.
Overview
Aligns AI SDK telemetry with the updated spec by renaming all usage tracking event keys to the unified
$ld:ai:usage:*namespace (completion config, judge config, create chat/judge, and single/multi agent config retrieval).Adds one-time SDK identity reporting on
LDAIClientinitialization via a$ld:ai:sdk-infotrack event using an anonymous internal context, and introducessdk_info.pyto source SDK name/version from package metadata. Tests are updated/added to assert the new tracking behavior.Written by Cursor Bugbot for commit 158b110. This will update automatically on new commits. Configure here.