chore: Move graphKey to LDAIConfigTracker constructor#1279
Conversation
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>
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-client-sdk-common size report |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Summary
graphKeyas an optional parameter from allLDAIConfigTrackertracking methods and thegetTrackData()method_graphKeyas an optional constructor parameter toLDAIConfigTrackerImpl— set once at construction, included automatically ingetTrackData()output_agentConfig()helper (matching_completionConfig/_judgeConfigpattern) that acceptsgraphKeyfor internal use — ready foragentGraph()when it arrivesresumptionTokengetter conditionally includesgraphKey;fromResumptionTokenrestores it at constructionagentConfig()andagentConfigs()now route through_agentConfig()internallyTest plan
LDAIConfigTrackerImpl.test.ts: graphKey tests updated to pass at construction; 4 new resumption token round-trip testsLDAIClientImpl.test.ts: agent config tests updated🤖 Generated with Claude Code
Note
Medium Risk
This is a breaking API change for any callers passing
graphKeyinto 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
graphKeyhandling is refactored from per-call to per-tracker. TheLDAIConfigTrackerAPI removes the optionalgraphKeyparameter fromgetTrackData()and alltrack*methods;LDAIConfigTrackerImplnow accepts an optionalgraphKeyin its constructor and automatically includes it in emitted tracking payloads.Tracker resumption is updated to round-trip
graphKey:resumptionTokenconditionally encodes it andfromResumptionToken()restores it.LDAIClientImplthreads an optionalgraphKeyinto 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.