Skip to content
Merged
Changes from all commits
Commits
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
Expand Up @@ -16,8 +16,8 @@
package com.google.adk.plugins;

import com.google.adk.plugins.recordings.Recordings;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/** Per-invocation replay state to isolate concurrent runs. */
class InvocationReplayState {
Expand All @@ -33,7 +33,7 @@ public InvocationReplayState(String testCasePath, int userMessageIndex, Recordin
this.testCasePath = testCasePath;
this.userMessageIndex = userMessageIndex;
this.recordings = recordings;
this.agentReplayIndices = new HashMap<>();
this.agentReplayIndices = new ConcurrentHashMap<>();
}

public String getTestCasePath() {
Expand All @@ -57,7 +57,6 @@ public void setAgentReplayIndex(String agentName, int index) {
}

public void incrementAgentReplayIndex(String agentName) {
int currentIndex = getAgentReplayIndex(agentName);
setAgentReplayIndex(agentName, currentIndex + 1);
agentReplayIndices.merge(agentName, 1, Integer::sum);
}
}
Loading