Skip to content

chore: Move graphKey to LDAIConfigTracker constructor#1279

Merged
jsonbailey merged 3 commits into
feat/ai-sdk-next-releasefrom
jb/aic-2238/graphkey-on-tracker-init
Apr 16, 2026
Merged

chore: Move graphKey to LDAIConfigTracker constructor#1279
jsonbailey merged 3 commits into
feat/ai-sdk-next-releasefrom
jb/aic-2238/graphkey-on-tracker-init

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes graphKey as an optional parameter from all LDAIConfigTracker tracking methods and the getTrackData() method
  • Adds _graphKey as an optional constructor parameter to LDAIConfigTrackerImpl — set once at construction, included automatically in getTrackData() output
  • Adds private _agentConfig() helper (matching _completionConfig/_judgeConfig pattern) that accepts graphKey for internal use — ready for agentGraph() when it arrives
  • resumptionToken getter conditionally includes graphKey; fromResumptionToken restores it at construction
  • agentConfig() and agentConfigs() now route through _agentConfig() internally

Test plan

  • LDAIConfigTrackerImpl.test.ts: graphKey tests updated to pass at construction; 4 new resumption token round-trip tests
  • LDAIClientImpl.test.ts: agent config tests updated
  • Run full test suite in dev container

🤖 Generated with Claude Code


Note

Medium Risk
This is a breaking API change for any callers passing graphKey into tracker methods and could cause compilation/runtime issues until downstream code is updated. Tracking payload shape and resumption-token contents change, which may affect analytics expectations or consumers.

Overview
graphKey handling is refactored from per-call to per-tracker. The LDAIConfigTracker API removes the optional graphKey parameter from getTrackData() and all track* methods; LDAIConfigTrackerImpl now accepts an optional graphKey in its constructor and automatically includes it in emitted tracking payloads.

Tracker resumption is updated to round-trip graphKey: resumptionToken conditionally encodes it and fromResumptionToken() restores it. LDAIClientImpl threads an optional graphKey into tracker creation by extending _evaluate() and adding an internal _agentConfig(..., graphKey?) helper, with tests updated/added accordingly.

Reviewed by Cursor Bugbot for commit 6427327. Bugbot is set up for automated code reviews on this repo. Configure here.

graphKey is now set once at tracker construction time rather than
passed as an optional parameter to every tracking method. Adds a
private _agentConfig() helper (matching _completionConfig/_judgeConfig)
that accepts graphKey for internal use when building graph nodes.
Resumption token includes graphKey when set and fromResumptionToken
restores it. Public API is unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25623 bytes
Compressed size limit: 29000
Uncompressed size: 125843 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179375 bytes
Compressed size limit: 200000
Uncompressed size: 829982 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31655 bytes
Compressed size limit: 34000
Uncompressed size: 112792 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 37169 bytes
Compressed size limit: 38000
Uncompressed size: 204305 bytes

@jsonbailey jsonbailey marked this pull request as ready for review April 15, 2026 20:33
@jsonbailey jsonbailey requested a review from a team as a code owner April 15, 2026 20:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 246f0a9. Configure here.

Comment thread packages/sdk/server-ai/__tests__/LDAIClientImpl.test.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jsonbailey jsonbailey merged commit 367d369 into feat/ai-sdk-next-release Apr 16, 2026
44 checks passed
@jsonbailey jsonbailey deleted the jb/aic-2238/graphkey-on-tracker-init branch April 16, 2026 15:11
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