Skip to content

Commit ef7bd42

Browse files
authored
Merge branch 'main' into patch-1
2 parents 189c9c9 + c7a99be commit ef7bd42

File tree

49 files changed

+2082
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2082
-223
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.5.0"
2+
".": "0.6.0"
33
}

CHANGELOG.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,103 @@
11
# Changelog
22

3+
## [0.6.0](https://github.com/google/adk-java/compare/v0.5.0...v0.6.0) (2026-02-19)
4+
5+
6+
### Features
7+
8+
* Add Compact processor to SingleFlow ([ee459b3](https://github.com/google/adk-java/commit/ee459b3198d19972744514d1e74f076ee2bd32a7))
9+
* Add Compaction RequestProcessor for event compaction in llm flow ([af1fafe](https://github.com/google/adk-java/commit/af1fafed0470c8afe81679a495ed61664a2cee1a))
10+
* Add ContextCacheConfig to InvocationContext ([968a9a8](https://github.com/google/adk-java/commit/968a9a8944bd7594efc51ed0b5201804133f350e))
11+
* Add event compaction config to InvocationContext ([8f7d7ea](https://github.com/google/adk-java/commit/8f7d7eac95cc606b5c5716612d0b08c41f951167))
12+
* Add event compaction framework in Java ADK ([dd68c85](https://github.com/google/adk-java/commit/dd68c8565ae43e30c2dd02bc956173ab199ebb56))
13+
* add eventId in CallbackContext and ToolContext ([ac05fde](https://github.com/google/adk-java/commit/ac05fde31ec6a67baf7cacb6144f5912eca029ac))
14+
* add ExampleTool to ComponentRegistry ([2e1b09f](https://github.com/google/adk-java/commit/2e1b09fdd07fb22839ea91bd109e409b44df4f82))
15+
* add response converters to support multiple A2A client events ([4e8de90](https://github.com/google/adk-java/commit/4e8de90f13b995c908fc4c6f742bce836e7209db))
16+
* Add token usage threshold to TailRetentionEventCompactor ([9901307](https://github.com/google/adk-java/commit/9901307b1cb9be75f2262f116388f93cdcf3eeb6))
17+
* Add tokenThreshold and eventRetentionSize to EventsCompactionConfig ([588b00b](https://github.com/google/adk-java/commit/588b00bbd327e257a78271bf2d929bc52875115f))
18+
* Add VertexAiSearchTool and AgentTools for search ([b48b194](https://github.com/google/adk-java/commit/b48b194448c6799e08e778c4efa2d9c920f0c1fb))
19+
* Adding a .close() method to Runner, Agent and Plugins ([495bf95](https://github.com/google/adk-java/commit/495bf95642b9159aa6040868fcaa97fed166035b))
20+
* Adding a new `ArtifactService.saveAndReloadArtifact()` method ([59e87d3](https://github.com/google/adk-java/commit/59e87d319887c588a1ed7d4ca247cd31dffba2c6))
21+
* adding a new temporary store of context for callbacks ([ed736cd](https://github.com/google/adk-java/commit/ed736cdf84d8db92dfde947b5ee84e7430f3ae6d))
22+
* Adding autoCreateSession in Runner ([6dd51cc](https://github.com/google/adk-java/commit/6dd51cc201b15aaa2cebb5372ece647c4484da06))
23+
* Adding GlobalInstructionPlugin ([72e20b6](https://github.com/google/adk-java/commit/72e20b652b8d697e5dc0605db284e3b637f11bac))
24+
* Adding OnModelErrorCallback ([dfd2944](https://github.com/google/adk-java/commit/dfd294448528a9e429ddbbb8e650e432b34fafb2))
25+
* adding resume / event management primitives ([2de03a8](https://github.com/google/adk-java/commit/2de03a86f97eb602dee55270b910d0d425ae75e9))
26+
* Adding TODO files for reaching idiomatic java ([4ac1dd2](https://github.com/google/adk-java/commit/4ac1dd2b6e480fefd4b0a9198b2e69a9c6334c40))
27+
* Adding validation to BaseAgent ([5dfc000](https://github.com/google/adk-java/commit/5dfc000c9019b4d11a33b35c71c2a04d1f657bf2))
28+
* Adding validation to BaseAgent and RunConfig ([503caa6](https://github.com/google/adk-java/commit/503caa6393635a56c672a6592747bcb6e034b8a1))
29+
* Adding validation to InvocationContext 'session_service', 'invocation_id', ([0502c21](https://github.com/google/adk-java/commit/0502c2141724a238bbf5f7a72e1951cbb401a3e8))
30+
* Allow EventsCompactionConfig to have a null summarizer initially ([229654e](https://github.com/google/adk-java/commit/229654e20a6ffc733854e3c0de9049bbad494228))
31+
* enable LoopAgent configuration ([d1a1cea](https://github.com/google/adk-java/commit/d1a1cea4a633f376463d7e47b79bfb67126537ad))
32+
* EventAction.stateDelta() now has a remove by key variant ([32a6b62](https://github.com/google/adk-java/commit/32a6b625d96e5658be77d5017f10014d8d4036c1))
33+
* Extend google_search support to Gemini 3 in Java ADK ([ddb00ef](https://github.com/google/adk-java/commit/ddb00efc1a1f531448b9f4dae28d647c6ffdf420))
34+
* Fix a handful of small changes related to headers, logging and javadoc ([0b63ca3](https://github.com/google/adk-java/commit/0b63ca30294ea05572707c420306ae41bf7d60c7))
35+
* Forward state delta to parent session ([00d6d30](https://github.com/google/adk-java/commit/00d6d3034e07ceaa738a1ff1384d8fd879339b06))
36+
* HITL - remove the events between the confirmed FC & its response ([3670555](https://github.com/google/adk-java/commit/367055544509321e845712b89b793c98e0dc510d))
37+
* HITL - Revert the "Boolean confirmation" changes, we'll fix it differently ([f65e58b](https://github.com/google/adk-java/commit/f65e58bd73ea33b38d5fe43c897b01216ac34ac6))
38+
* **HITL:** Declining a proposal now correctly intercepts the run ([9611f89](https://github.com/google/adk-java/commit/9611f8967e528c6242e17ad3ad5419e0b25fb3fb))
39+
* **HITL:** Let ADK resume after HITL approval is present ([9611f89](https://github.com/google/adk-java/commit/9611f8967e528c6242e17ad3ad5419e0b25fb3fb))
40+
* Improving LoggingPlugin ([acfaa04](https://github.com/google/adk-java/commit/acfaa04284dec12fa7245caee11cd7a3d8e4342c))
41+
* Integrate event compaction in Java ADK runner ([54c826c](https://github.com/google/adk-java/commit/54c826c80c2bfe09056396c2a21f8241f9d2898b))
42+
* Introduce TailRetentionEventCompactor to compact and retain the tail of the event stream ([efe58d6](https://github.com/google/adk-java/commit/efe58d6e0e5e0ff35d39e56bcb0f57cc6ccc7ccc))
43+
* Introduce the `App` class for defining agentic applications ([d7c5c6f](https://github.com/google/adk-java/commit/d7c5c6f4bdc2c2b06448af72bc311abf36b8e726))
44+
* introduces context caching configuration for apps, ported from Python ADK ([12defee](https://github.com/google/adk-java/commit/12defeedbaf6048bc83d484f421131051b7e81a5))
45+
* new ContextFilterPlugin ([f8e9bc3](https://github.com/google/adk-java/commit/f8e9bc30350082f048cb0ded6226f27f80655602))
46+
* Refactor EventsCompactionConfig to require a summarizer ([864d606](https://github.com/google/adk-java/commit/864d6066eb98af6567592055f7cd24cb78defaf3))
47+
* refactor remote A2A agent to use A2A SDK client ([7792233](https://github.com/google/adk-java/commit/7792233832e95dfe1ae93b04d91bd7507c37cc8d))
48+
* Refine bug and feature request issue templates ([3e74c9a](https://github.com/google/adk-java/commit/3e74c9a960cba6582e914d36925516039d57913c))
49+
* register GoogleMapsTool in ComponentRegistry ([464f0b2](https://github.com/google/adk-java/commit/464f0b2fc0231dbe161b0b5fe524687bb304cd49))
50+
* Reorder compaction events in chronological order ([66e2296](https://github.com/google/adk-java/commit/66e22964e67d0756e3351dae93e18aa5ae73f22e))
51+
* Setting up data structures for pause/resume/rewind ([c6c52c4](https://github.com/google/adk-java/commit/c6c52c43439468eb87fc6a029fa25a46a35dd6e7))
52+
* Skip post-invocation compaction if parameters not set ([76f86c5](https://github.com/google/adk-java/commit/76f86c54eb1a242e604f7b43e3ee18940168b6ec))
53+
* Support function calls in LLM event summarizer ([55144ac](https://github.com/google/adk-java/commit/55144aca3c1d77e06cf7101cf2504311c0585ed1))
54+
* support stdio_connection_params in McpToolset config ([cc1588a](https://github.com/google/adk-java/commit/cc1588a3e669dc670595ecbdebb12dc9d2ae40f0))
55+
* Token count estimation fallback for tail retention compaction ([3338565](https://github.com/google/adk-java/commit/3338565cff976fdad1eda1fccafef58c9d4a51ba))
56+
* Update event compaction logic to include events after compaction end times ([ea12505](https://github.com/google/adk-java/commit/ea12505d7c4e22a237db5a8d3f78564ace0b216b))
57+
* Updating Baseline Code executors ([a3f1763](https://github.com/google/adk-java/commit/a3f176322c47354d5c18d8371cb38bd2dd719904))
58+
* updating Telemetry ([5ba63f4](https://github.com/google/adk-java/commit/5ba63f4015d369bc58ad7dfe76198acf003e7450))
59+
* Updating the Tracing implementation and updating BaseAgent.runLive ([8acb1ea](https://github.com/google/adk-java/commit/8acb1eafb099723dfae065d8b9339bb5180aa26f))
60+
* use Credentials' request metadata to populate headers ([e01df11](https://github.com/google/adk-java/commit/e01df116e311016df92e69487c0a6607b00384bc))
61+
62+
63+
### Bug Fixes
64+
65+
* Add name and description to configagent pom.xml ([4948bfc](https://github.com/google/adk-java/commit/4948bfc9a35ea22660f37a6afc3474fab220b630))
66+
* Align InMemorySessionService listSessions with Python implementation ([9434949](https://github.com/google/adk-java/commit/94349499d03f3a131af4464def4b208db52a8feb))
67+
* Always use a mutable HashMap for default function arguments ([c6c9557](https://github.com/google/adk-java/commit/c6c9557ff28feece54265fcff82478156afbe67f))
68+
* emit multiple LlmResponses in GeminiLlmConnection ([7bf55f1](https://github.com/google/adk-java/commit/7bf55f1be6381ae5319bb0532f32c0287461546d))
69+
* Events for HITL are now emitted correctly ([9611f89](https://github.com/google/adk-java/commit/9611f8967e528c6242e17ad3ad5419e0b25fb3fb))
70+
* fix linter error ([f49260e](https://github.com/google/adk-java/commit/f49260e05c5d36b85066caf299fda9346b6ff788))
71+
* Fixing a problem with serializing sessions that broke integration with Vertex AI Session Service ([8190ed3](https://github.com/google/adk-java/commit/8190ed3d78667875ee0772e52b7075dcdaa14963))
72+
* Fixing a regression in InMemorySessionService ([d11bedf](https://github.com/google/adk-java/commit/d11bedf42976242d1c3dd6b99ebae0babe59535c))
73+
* Fixing Vertex session storage ([5607f64](https://github.com/google/adk-java/commit/5607f644c95a053bf381c2021879e6f31d5c6bde))
74+
* HITL endless loop when asking for approvals ([9611f89](https://github.com/google/adk-java/commit/9611f8967e528c6242e17ad3ad5419e0b25fb3fb))
75+
* include usage_metadata events in live postprocessing ([8137d66](https://github.com/google/adk-java/commit/8137d661d7b29eab066c23b7f302068f82423eb7))
76+
* javadocs in ResponseConverter ([be35b22](https://github.com/google/adk-java/commit/be35b2277e8291336013623cb9f0c86f62ed1f43))
77+
* Make FunctionResponses respect the order of FunctionCalls ([a99c75b](https://github.com/google/adk-java/commit/a99c75bf79d86866db26135568bf36b685886659))
78+
* Making stepsCompleted thread-safe ([d432c64](https://github.com/google/adk-java/commit/d432c6414128cf83eb0211eb18ef058dbbcd1807))
79+
* Merging of events in rearrangeEventsForAsyncFunctionResponsesInHistory ([67c29e3](https://github.com/google/adk-java/commit/67c29e3a33bda22d8a18a17c99e5abc891bf19f8))
80+
* Mutate EventActions in-place in AgentTool ([ded5a4e](https://github.com/google/adk-java/commit/ded5a4e760055d3d2bcd74d3bd8f21517821e7d0))
81+
* pass mutable function args map to beforeToolCallback ([e989ae1](https://github.com/google/adk-java/commit/e989ae1337a84fd6686504050d2a3bf2db15c32c))
82+
* populate finishReason in LlmResponse ([dace210](https://github.com/google/adk-java/commit/dace2106cd2451d8271c842da13daff65de0922e))
83+
* Propagate trace context across async boundaries ([279c977](https://github.com/google/adk-java/commit/279c977d9eefda39159dd4bd86acea03a47c6101))
84+
* recursively extract input/output schema for AgentTool ([7019d39](https://github.com/google/adk-java/commit/7019d39e490cef1b4b443d1755547a3a701bc964))
85+
* Reduce the logging level ([dd601ca](https://github.com/google/adk-java/commit/dd601ca8ed939d42fa186113bf0dca31c6e4a6db))
86+
* Remove checking ToolConfirmation from Functions to align with Python SDK ([0724330](https://github.com/google/adk-java/commit/0724330c66d26b2e80e458663ca88bb333c40c2c))
87+
* remove client-side function call IDs from LlmRequest ([99b5fc2](https://github.com/google/adk-java/commit/99b5fc26d791175e4dad2c818191c8c31e4269f6))
88+
* Remove obsolete [@param](https://github.com/param) tags from SessionController Javadoc ([a77971a](https://github.com/google/adk-java/commit/a77971a9ac983acbceab15db7eeb36460a0ba759))
89+
* Replace [@api](https://github.com/api)Note with <p> in Javadoc comments. ([ac16d53](https://github.com/google/adk-java/commit/ac16d53db0d7b0d2a3aa3a12c1db1f819d7c6c21))
90+
* restore invocationContext() method ([c9e2a5b](https://github.com/google/adk-java/commit/c9e2a5b37b31f5fa0e0a193076f7dc836320de97))
91+
* revert: Merging of events in rearrangeEventsForAsyncFunctionResponsesInHistory ([101adce](https://github.com/google/adk-java/commit/101adce314dd65328af6ad9281afb46f9b160c1a))
92+
* update converters package classes ([b66e4a5](https://github.com/google/adk-java/commit/b66e4a5280688a9533ed314103a0b290191a51cf))
93+
* update EmbeddingModelDiscoveryTest package statement ([adeb9dc](https://github.com/google/adk-java/commit/adeb9dca945004334f4af6a6442e41dd856d1612))
94+
* Updated BasePlugin JavaDoc for name parameter ([2e59550](https://github.com/google/adk-java/commit/2e59550eff9ad50e81c310ba83b9d49af6bb8987))
95+
96+
97+
### Documentation
98+
99+
* Update comment in Runner ([fe00ef8](https://github.com/google/adk-java/commit/fe00ef87f9c7cdf3d1005a411055b90cebdd0c98))
100+
3101
## [0.3.0](https://github.com/google/adk-java/compare/v0.2.0...v0.3.0) (2025-09-17)
4102

5103

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ If you're using Maven, add the following to your dependencies:
5050
<dependency>
5151
<groupId>com.google.adk</groupId>
5252
<artifactId>google-adk</artifactId>
53-
<version>0.3.0</version>
53+
<version>0.6.0</version>
5454
</dependency>
5555
<!-- Dev UI -->
5656
<dependency>
5757
<groupId>com.google.adk</groupId>
5858
<artifactId>google-adk-dev</artifactId>
59-
<version>0.3.0</version>
59+
<version>0.6.0</version>
6060
</dependency>
6161
```
6262

a2a/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.google.adk</groupId>
77
<artifactId>google-adk-parent</artifactId>
8-
<version>0.5.1-SNAPSHOT</version><!-- {x-version-update:google-adk:current} -->
8+
<version>0.6.1-SNAPSHOT</version><!-- {x-version-update:google-adk:current} -->
99
</parent>
1010

1111
<artifactId>google-adk-a2a</artifactId>

a2a/src/main/java/com/google/adk/a2a/AgentExecutor.java

Lines changed: 92 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
import com.google.adk.a2a.converters.EventConverter;
44
import com.google.adk.a2a.converters.PartConverter;
5+
import com.google.adk.agents.BaseAgent;
56
import com.google.adk.agents.RunConfig;
7+
import com.google.adk.apps.App;
8+
import com.google.adk.artifacts.BaseArtifactService;
69
import com.google.adk.events.Event;
10+
import com.google.adk.memory.BaseMemoryService;
11+
import com.google.adk.plugins.Plugin;
712
import com.google.adk.runner.Runner;
813
import com.google.adk.sessions.BaseSessionService;
914
import com.google.adk.sessions.Session;
@@ -21,6 +26,7 @@
2126
import io.reactivex.rxjava3.core.Maybe;
2227
import io.reactivex.rxjava3.disposables.CompositeDisposable;
2328
import io.reactivex.rxjava3.disposables.Disposable;
29+
import java.util.List;
2430
import java.util.Map;
2531
import java.util.Optional;
2632
import java.util.UUID;
@@ -41,29 +47,98 @@ public class AgentExecutor implements io.a2a.server.agentexecution.AgentExecutor
4147
private static final RunConfig DEFAULT_RUN_CONFIG =
4248
RunConfig.builder().setStreamingMode(RunConfig.StreamingMode.NONE).setMaxLlmCalls(20).build();
4349

44-
private final Runner runner;
4550
private final Map<String, Disposable> activeTasks = new ConcurrentHashMap<>();
51+
private final Runner.Builder runnerBuilder;
52+
private final RunConfig runConfig;
4653

47-
private AgentExecutor(Runner runner) {
48-
this.runner = runner;
54+
private AgentExecutor(
55+
App app,
56+
BaseAgent agent,
57+
String appName,
58+
BaseArtifactService artifactService,
59+
BaseSessionService sessionService,
60+
BaseMemoryService memoryService,
61+
List<? extends Plugin> plugins,
62+
RunConfig runConfig) {
63+
this.runnerBuilder =
64+
Runner.builder()
65+
.agent(agent)
66+
.appName(appName)
67+
.artifactService(artifactService)
68+
.sessionService(sessionService)
69+
.memoryService(memoryService)
70+
.plugins(plugins);
71+
if (app != null) {
72+
this.runnerBuilder.app(app);
73+
}
74+
// Check that the runner is configured correctly and can be built.
75+
var unused = runnerBuilder.build();
76+
this.runConfig = runConfig == null ? DEFAULT_RUN_CONFIG : runConfig;
4977
}
5078

5179
/** Builder for {@link AgentExecutor}. */
5280
public static class Builder {
53-
private Runner runner;
81+
private App app;
82+
private BaseAgent agent;
83+
private String appName;
84+
private BaseArtifactService artifactService;
85+
private BaseSessionService sessionService;
86+
private BaseMemoryService memoryService;
87+
private List<? extends Plugin> plugins = ImmutableList.of();
88+
private RunConfig runConfig;
89+
90+
@CanIgnoreReturnValue
91+
public Builder app(App app) {
92+
this.app = app;
93+
return this;
94+
}
95+
96+
@CanIgnoreReturnValue
97+
public Builder agent(BaseAgent agent) {
98+
this.agent = agent;
99+
return this;
100+
}
101+
102+
@CanIgnoreReturnValue
103+
public Builder appName(String appName) {
104+
this.appName = appName;
105+
return this;
106+
}
107+
108+
@CanIgnoreReturnValue
109+
public Builder artifactService(BaseArtifactService artifactService) {
110+
this.artifactService = artifactService;
111+
return this;
112+
}
113+
114+
@CanIgnoreReturnValue
115+
public Builder sessionService(BaseSessionService sessionService) {
116+
this.sessionService = sessionService;
117+
return this;
118+
}
54119

55120
@CanIgnoreReturnValue
56-
public Builder runner(Runner runner) {
57-
this.runner = runner;
121+
public Builder memoryService(BaseMemoryService memoryService) {
122+
this.memoryService = memoryService;
123+
return this;
124+
}
125+
126+
@CanIgnoreReturnValue
127+
public Builder plugins(List<? extends Plugin> plugins) {
128+
this.plugins = plugins;
129+
return this;
130+
}
131+
132+
@CanIgnoreReturnValue
133+
public Builder runConfig(RunConfig runConfig) {
134+
this.runConfig = runConfig;
58135
return this;
59136
}
60137

61138
@CanIgnoreReturnValue
62139
public AgentExecutor build() {
63-
if (runner == null) {
64-
throw new IllegalStateException("Runner must be provided.");
65-
}
66-
return new AgentExecutor(runner);
140+
return new AgentExecutor(
141+
app, agent, appName, artifactService, sessionService, memoryService, plugins, runConfig);
67142
}
68143
}
69144

@@ -96,13 +171,14 @@ public void execute(RequestContext ctx, EventQueue eventQueue) {
96171

97172
EventProcessor p = new EventProcessor();
98173
Content content = PartConverter.messageToContent(message);
174+
Runner runner = runnerBuilder.build();
99175

100176
taskDisposables.add(
101-
prepareSession(ctx, runner.sessionService())
177+
prepareSession(ctx, runner.appName(), runner.sessionService())
102178
.flatMapPublisher(
103179
session -> {
104180
updater.startWork();
105-
return runner.runAsync(getUserId(ctx), session.id(), content, DEFAULT_RUN_CONFIG);
181+
return runner.runAsync(getUserId(ctx), session.id(), content, runConfig);
106182
})
107183
.subscribe(
108184
event -> {
@@ -130,13 +206,14 @@ private String getUserId(RequestContext ctx) {
130206
return USER_ID_PREFIX + ctx.getContextId();
131207
}
132208

133-
private Maybe<Session> prepareSession(RequestContext ctx, BaseSessionService service) {
209+
private Maybe<Session> prepareSession(
210+
RequestContext ctx, String appName, BaseSessionService service) {
134211
return service
135-
.getSession(runner.appName(), getUserId(ctx), ctx.getContextId(), Optional.empty())
212+
.getSession(appName, getUserId(ctx), ctx.getContextId(), Optional.empty())
136213
.switchIfEmpty(
137214
Maybe.defer(
138215
() -> {
139-
return service.createSession(runner.appName(), getUserId(ctx)).toMaybe();
216+
return service.createSession(appName, getUserId(ctx)).toMaybe();
140217
}));
141218
}
142219

0 commit comments

Comments
 (0)