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
10 changes: 8 additions & 2 deletions core/src/main/java/com/google/adk/agents/InvocationContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ protected InvocationContext(Builder builder) {
this.eventsCompactionConfig = builder.eventsCompactionConfig;
this.contextCacheConfig = builder.contextCacheConfig;
this.invocationCostManager = builder.invocationCostManager;
this.callbackContextData = new ConcurrentHashMap<>(builder.callbackContextData);
// Don't copy the callback context data. This should be the same instance for the full
// invocation invocation so that Plugins can access the same data it during the invocation
// across all types of callbacks.
this.callbackContextData = builder.callbackContextData;
}

/**
Expand Down Expand Up @@ -345,7 +348,10 @@ private Builder(InvocationContext context) {
this.eventsCompactionConfig = context.eventsCompactionConfig;
this.contextCacheConfig = context.contextCacheConfig;
this.invocationCostManager = context.invocationCostManager;
this.callbackContextData = new ConcurrentHashMap<>(context.callbackContextData);
// Don't copy the callback context data. This should be the same instance for the full
// invocation invocation so that Plugins can access the same data it during the invocation
// across all types of callbacks.
this.callbackContextData = context.callbackContextData;
}

private BaseSessionService sessionService;
Expand Down