Skip to content

feat: Rename TrackUsage to TrackTokens#364

Merged
jsonbailey merged 2 commits into
v7from
jb/go-track-tokens-rename
May 11, 2026
Merged

feat: Rename TrackUsage to TrackTokens#364
jsonbailey merged 2 commits into
v7from
jb/go-track-tokens-rename

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

@jsonbailey jsonbailey commented Apr 16, 2026

Summary

  • Renames Tracker.TrackUsageTracker.TrackTokens to align with AITRACK spec requirement 1.1.7
  • Keeps a deprecated TrackUsage shim that delegates to TrackTokens for backwards compatibility
  • All internal call sites updated to use TrackTokens

Test plan

  • go build ./... passes
  • go test ./... passes (ldai + judge packages)

🤖 Generated with Claude Code


Note

Medium Risk
Introduces a public API rename (TrackUsageTrackTokens) that can break external Tracker implementations (notably the judge.Tracker interface), though the core ldai.Tracker keeps a deprecated TrackUsage wrapper for backward compatibility.

Overview
Renames token-usage tracking across the SDK from TrackUsage to TrackTokens, updating internal call sites (including judge evaluation) and associated tests.

Adds a deprecated Tracker.TrackUsage shim that delegates to TrackTokens, while updating log messages/comments and ensuring TrackRequest and 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.

@jsonbailey jsonbailey changed the title feat(ldai): rename TrackUsage to TrackTokens (AITRACK 1.1.7) feat: Rename TrackUsage to TrackTokens Apr 16, 2026
@jsonbailey jsonbailey marked this pull request as ready for review April 16, 2026 22:30
@jsonbailey jsonbailey requested a review from a team as a code owner April 16, 2026 22:30
jsonbailey and others added 2 commits May 11, 2026 17:43
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>
@jsonbailey jsonbailey force-pushed the jb/go-track-tokens-rename branch from cc12d6b to 964a5a6 Compare May 11, 2026 22:43
@jsonbailey jsonbailey merged commit 9b0863a into v7 May 11, 2026
44 of 46 checks passed
@jsonbailey jsonbailey deleted the jb/go-track-tokens-rename branch May 11, 2026 22:59
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants