Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7c4dbde
[AIC-2664] Impl trackers (first pass)
mattrmc1 Jun 22, 2026
a0c8784
fix: default tracker version to 1 and remove version clamp from token…
mattrmc1 Jun 23, 2026
9ae20ca
agent graph support (first pass)
mattrmc1 Jun 23, 2026
bed4ca2
guard against null AIMetrics
mattrmc1 Jun 23, 2026
2b47c86
fix: guard against blank metricKey and infinite/invalid score
mattrmc1 Jun 23, 2026
4ef3de2
fix: MAX_TOKEN_BYTES -> MAX_TOKEN_LENGTH
mattrmc1 Jun 23, 2026
1be0a1e
fix: guard against empty runId and configKey
mattrmc1 Jun 23, 2026
8e81ea0
fix: Add warning comment to createTracker public call
mattrmc1 Jun 23, 2026
e81e2f5
fix: use trim + isEmpty to support java 8
mattrmc1 Jun 23, 2026
c21fdd7
fix: stop trackMetricsOf clock before running metrics extractor
mattrmc1 Jun 23, 2026
4c96dca
fix: record operation duration when trackMetricsOf extractor throws
mattrmc1 Jun 23, 2026
4da5478
fix: downgrade null-arg track logs from warn to debug per spec
mattrmc1 Jun 23, 2026
f8a0100
pull latest + fix conflicts
mattrmc1 Jun 23, 2026
394a044
fix: remove unnecessary NoOpAIConfigTracker
mattrmc1 Jun 24, 2026
caff9ce
Merge branch 'mmccarthy/AIC-2664/ai-config-tracker-overhaul' of githu…
mattrmc1 Jun 24, 2026
5381bf4
fix: remove resumption-token length cap
mattrmc1 Jun 24, 2026
c175baf
pull latest + fix conflicts
mattrmc1 Jun 24, 2026
0bb8379
fix: remove token length cap, defensive copy trackPath, downgrade nul…
mattrmc1 Jun 24, 2026
d0ae81b
fix: make GraphEdge.handoff a defensive unmodifiable copy
mattrmc1 Jun 24, 2026
d22532a
fix: don't emit graph total-tokens event when total is zero
mattrmc1 Jun 24, 2026
4d6565c
fix tests
mattrmc1 Jun 24, 2026
77e49d4
fix: guard against empty runId and graphKey
mattrmc1 Jun 24, 2026
3aa5d08
fix: Add security note to LDAIConfigTracker.getResumptionToken()
mattrmc1 Jun 24, 2026
121b140
fix: Add security note to MetricSummary.getResumptionToken()
mattrmc1 Jun 24, 2026
35d8b02
Merge branch 'mmccarthy/AIC-2664/ai-config-tracker-overhaul' of githu…
mattrmc1 Jun 24, 2026
a0a3a54
fix: add debugs helper to tests
mattrmc1 Jun 24, 2026
80ef017
fix: pass instance logger to createGraphTracker for resumed runs
mattrmc1 Jun 24, 2026
96a810e
Merge branch 'main' of github.com:launchdarkly/java-core into mmccart…
mattrmc1 Jun 25, 2026
1688f7a
guard trackDuration against non-finite values
mattrmc1 Jun 29, 2026
a67c618
remove the unnecessary version clamp
mattrmc1 Jun 29, 2026
a3c2b56
Merge branch 'main' into mmccarthy/AIC-2837/java-ai-sdk-agent-graph
mattrmc1 Jun 29, 2026
30d937c
Merge branch 'main' into mmccarthy/AIC-2837/java-ai-sdk-agent-graph
mattrmc1 Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package com.launchdarkly.sdk.server.ai;

import com.launchdarkly.sdk.server.ai.datamodel.LDAITrackingTypes.TokenUsage;

import java.util.List;

/**
* A snapshot of the metrics tracked so far by an {@link AIGraphTracker}.
* <p>
* All fields are nullable: a {@code null} value means the corresponding metric has not been
* recorded yet on the tracker. {@link #getResumptionToken()} is always present.
* <p>
* Instances are immutable.
*/
public final class AIGraphMetricSummary {
private final Boolean success;
private final Double durationMs;
private final TokenUsage tokens;
private final List<String> path;
private final String resumptionToken;

AIGraphMetricSummary(
Boolean success,
Double durationMs,
TokenUsage tokens,
List<String> path,
String resumptionToken) {
this.success = success;
this.durationMs = durationMs;
this.tokens = tokens;
this.path = path;
this.resumptionToken = resumptionToken;
}

/**
* Returns the invocation outcome: {@code true} if {@code trackInvocationSuccess} was called,
* {@code false} if {@code trackInvocationFailure} was called, or {@code null} if neither has
* been called yet.
*
* @return the success flag, or {@code null} if not yet recorded
*/
public Boolean getSuccess() {
return success;
}

/**
* Returns the tracked graph-level duration in milliseconds, or {@code null} if not recorded.
*
* @return the duration in ms, or {@code null}
*/
public Double getDurationMs() {
return durationMs;
}

/**
* Returns the tracked token usage, or {@code null} if not recorded.
*
* @return the token usage, or {@code null}
*/
public TokenUsage getTokens() {
return tokens;
}

/**
* Returns the tracked node path (ordered list of node keys visited), or {@code null} if not
* recorded.
*
* @return an unmodifiable list of node keys, or {@code null}
*/
public List<String> getPath() {
return path;
}

/**
* Returns the resumption token for this graph run, which can be passed to
* {@link LDAIClient#createGraphTracker(String, com.launchdarkly.sdk.LDContext)} to reconstruct
* the tracker on a subsequent request.
*
* @return the resumption token; never {@code null}
*/
public String getResumptionToken() {
return resumptionToken;
}
}
Loading
Loading