feat: Rename TrackUsage to TrackTokens#364
Merged
Merged
Conversation
keelerm84
approved these changes
Apr 17, 2026
Aligns with AITRACK spec requirement 1.1.7 which mandates the method be named trackTokens. The old TrackUsage method is kept as a deprecated shim that delegates to TrackTokens for backwards compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cc12d6b to
964a5a6
Compare
jsonbailey
pushed a commit
that referenced
this pull request
May 12, 2026
🤖 I have created a release *beep* *boop* --- ## [0.9.0](ldai/v0.8.1...ldai/v0.9.0) (2026-05-11) ### ⚠ BREAKING CHANGES * Tracker no longer returned alongside AI Configs, use Config.CreateTracker() instead * Add per-execution runId, at-most-once tracking, and cross-process tracker resumption ([#363](#363)) ### Features * Add per-execution runId, at-most-once tracking, and cross-process tracker resumption ([#363](#363)) ([c11294f](c11294f)) * Rename TrackUsage to TrackTokens ([#364](#364)) ([9b0863a](9b0863a)) * Tracker no longer returned alongside AI Configs, use Config.CreateTracker() instead ([c11294f](c11294f)) ### Bug Fixes * Prevent context attributes from influencing judge template parsing (SEC-8020) ([#361](#361)) ([a14fc86](a14fc86)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low code risk since this PR only bumps version metadata and changelog entries, but it publishes a new `ldai` release that includes documented breaking changes for consumers. > > **Overview** > Bumps the `ldai` package release from `0.8.1` to `0.9.0` by updating the release manifest and `ldai` version constant. > > Updates `ldai/CHANGELOG.md` with the `0.9.0` release notes, including **breaking changes** around tracker creation/return behavior plus new tracking semantics and a `TrackUsage`→`TrackTokens` rename, and a judge template parsing fix. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7582350. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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
Tracker.TrackUsage→Tracker.TrackTokensto align with AITRACK spec requirement 1.1.7TrackUsageshim that delegates toTrackTokensfor backwards compatibilityTrackTokensTest plan
go build ./...passesgo test ./...passes (ldai + judge packages)🤖 Generated with Claude Code
Note
Medium Risk
Introduces a public API rename (
TrackUsage→TrackTokens) that can break externalTrackerimplementations (notably thejudge.Trackerinterface), though the coreldai.Trackerkeeps a deprecatedTrackUsagewrapper for backward compatibility.Overview
Renames token-usage tracking across the SDK from
TrackUsagetoTrackTokens, updating internal call sites (including judge evaluation) and associated tests.Adds a deprecated
Tracker.TrackUsageshim that delegates toTrackTokens, while updating log messages/comments and ensuringTrackRequestand judge flows record token metrics via the new method name.Reviewed by Cursor Bugbot for commit 964a5a6. Bugbot is set up for automated code reviews on this repo. Configure here.