Skip to content

Commit 05c7b7f

Browse files
Merge branch 'main' into fix/memory-leak-delete-session
2 parents 0901370 + f6ab9d9 commit 05c7b7f

134 files changed

Lines changed: 7206 additions & 1918 deletions

File tree

Some content is hidden

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

.github/workflows/pr-commit-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# Step 1: Check out the code
2222
# This action checks out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
2323
- name: Checkout Code
24-
uses: actions/checkout@v4
24+
uses: actions/checkout@v6
2525
with:
2626
# We need to fetch all commits to accurately count them.
2727
# '0' means fetch all history for all branches and tags.

.github/workflows/validation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ jobs:
2020

2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v6
2424

2525
- name: Set up Java ${{ matrix.java-version }}
26-
uses: actions/setup-java@v4
26+
uses: actions/setup-java@v5
2727
with:
2828
distribution: temurin
2929
java-version: ${{ matrix.java-version }}
3030

3131
- name: Cache Maven packages
32-
uses: actions/cache@v3
32+
uses: actions/cache@v5
3333
with:
3434
path: ~/.m2/repository
3535
key: ${{ runner.os }}-maven-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }}

.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.8.0"
2+
".": "1.0.0-rc.1"
33
}

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# AGENTS.md
2+
3+
Validate changes by running `./mvnw test`.

CHANGELOG.md

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

3+
## [1.0.0-rc.1](https://github.com/google/adk-java/compare/v0.9.0...v1.0.0-rc.1) (2026-03-20)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* remove McpToolset constructors taking Optional parameters
9+
* remove deprecated Example processor
10+
11+
### Features
12+
13+
* add handling the a2a metadata in the RemoteA2AAgent; Add the enum type for the metadata keys ([e51f911](https://github.com/google/adk-java/commit/e51f9112050955657da0dfc3aedc00f90ad739ec))
14+
* add type-safe runAsync methods to BaseTool ([b8cb7e2](https://github.com/google/adk-java/commit/b8cb7e2db6d5ce20f4d7a1b237bdc155563cf4bd))
15+
* Enhance LangChain4j to support MCP tools with parametersJsonSchema ([2c71ba1](https://github.com/google/adk-java/commit/2c71ba1332e052189115cd4644b7a473c31ed414))
16+
* fixing context propagation for agent transfers ([9a08076](https://github.com/google/adk-java/commit/9a080763d83c319f539d1bacac4595d13b299e7e))
17+
* Implement basic version of BigQuery Agent Analytics Plugin ([c8ab0f9](https://github.com/google/adk-java/commit/c8ab0f96b09a6c9636728d634c62695fcd622246))
18+
* init AGENTS.md file ([7ebeb07](https://github.com/google/adk-java/commit/7ebeb07bf2ee72475484d8a31ccf7b4c601dda96))
19+
* Propagating the otel context ([8556d4a](https://github.com/google/adk-java/commit/8556d4af16ff04c6e3b678dcfc3d4bb232abc550))
20+
* remove McpToolset constructors taking Optional parameters ([dbb1394](https://github.com/google/adk-java/commit/dbb139439d38157b4b9af38c52824b1e8405a495))
21+
* Return List instead of ImmutableList in CallbackUtil methods ([8af5e03](https://github.com/google/adk-java/commit/8af5e03811dfd548830df43103c81a592c8bf361))
22+
* update requestedAuthConfigs and its builder to be of general Map types ([f145c74](https://github.com/google/adk-java/commit/f145c744482b6b25f29a0b718bd452065e39d930))
23+
* Update return type of App.plugins() from ImmutableList to List ([8ba4bfe](https://github.com/google/adk-java/commit/8ba4bfed3fa7045f3344329de7a39acddc64ee30))
24+
* Update return type of toolsets() from ImmutableList to List ([cd56902](https://github.com/google/adk-java/commit/cd56902b803d4f7a1f3c718529842823d9e4370a))
25+
* update Session.state() and its builder to be of general Map types ([4b9b99a](https://github.com/google/adk-java/commit/4b9b99ae7149a465ba2ae9b7496e01f669786553))
26+
* update stateDelta builder input to Map from ConcurrentMap ([0d1e5c7](https://github.com/google/adk-java/commit/0d1e5c7b0c42cea66b178cf8fedf08a8c20f7fd0))
27+
28+
29+
### Bug Fixes
30+
31+
* fix null handling in runAsyncImpl ([567fdf0](https://github.com/google/adk-java/commit/567fdf048fee49afc86ca5d7d35f55424a6016ba))
32+
* improve processRequest_concurrentReadAndWrite_noException test case ([4eb3613](https://github.com/google/adk-java/commit/4eb3613b65cb1334e9432960d0f864ef09829c23))
33+
* include saveArtifact invocations in event chain ([551c31f](https://github.com/google/adk-java/commit/551c31f495aafde8568461cc0aa0973d7df7e5ac))
34+
* prevent ConcurrentModificationException when session events are modified by another thread during iteration ([fca43fb](https://github.com/google/adk-java/commit/fca43fbb9684ec8d080e437761f6bb4e38adf255))
35+
* Relaxing constraints for output schema ([d7e03ee](https://github.com/google/adk-java/commit/d7e03eeb067b83abd2afa3ea9bb5fc1c16143245))
36+
* Removing deprecated methods in Runner ([0af82e6](https://github.com/google/adk-java/commit/0af82e61a3c0dbbd95166a10b450cb507115ab60))
37+
* Use ConcurrentHashMap in InvocationReplayState ([94de7f1](https://github.com/google/adk-java/commit/94de7f199f86b39bdb7cce6e9800eb05008a8953)), closes [#1009](https://github.com/google/adk-java/issues/1009)
38+
* workaround for the client config streaming settings are not respected ([#983](https://github.com/google/adk-java/issues/983)) ([3ba04d3](https://github.com/google/adk-java/commit/3ba04d33dc8f2ef8b151abe1be4d1c8b7afcc25a))
39+
40+
41+
### Miscellaneous Chores
42+
43+
* remove deprecated Example processor ([28a8cd0](https://github.com/google/adk-java/commit/28a8cd04ca9348dbe51a15d2be3a2b5307394174))
44+
* set version to 1.0.0-rc.1 ([dc5d794](https://github.com/google/adk-java/commit/dc5d794c066571c7d87f006767bd32298e2a3ba8))
45+
46+
## [0.9.0](https://github.com/google/adk-java/compare/v0.8.0...v0.9.0) (2026-03-13)
47+
48+
49+
### ⚠ BREAKING CHANGES
50+
51+
* refactor ApiClient constructors hierarchy to remove Optional parameters
52+
* remove deprecated LlmAgent.canonicalTools method
53+
* remove deprecated LoadArtifactsTool.loadArtifacts method
54+
* update LoopAgent's maxIteration field and methods to be @Nullable instead of Optional
55+
* Remove Optional parameters in EventActions
56+
* remove deprecated url method in ComputerState.Builder
57+
* Remove deprecated create method in ResponseProcessor
58+
* remove McpAsyncToolset constructors
59+
* use @Nullable fields in Event class
60+
* remove methods with Optional params from VertexCredential.Builder
61+
62+
### Features
63+
64+
* add formatting to the RemoteA2A agent so it filters out the previous agent responses and updates the context of the function calls and responses ([0d6dd55](https://github.com/google/adk-java/commit/0d6dd55f4870007e79db23e21bd261879dbfba79))
65+
* add multiple LLM responses to LLM recordings for conformance tests ([bdfb7a7](https://github.com/google/adk-java/commit/bdfb7a72188ce6e72c12c16c0abedb824b846160))
66+
* add support for gemini models in VertexAiRagRetrieval ([924fb71](https://github.com/google/adk-java/commit/924fb7174855b46a58be43373c1a29284c47dfa8))
67+
* Fixing the spans produced by agent calls to have the right parent spans ([3c8f488](https://github.com/google/adk-java/commit/3c8f4886f0e4c76abdbeb64a348bfccd5c16120e))
68+
* Fixing the spans produced by agent calls to have the right parent spans ([973f887](https://github.com/google/adk-java/commit/973f88743cabebcd2e6e7a8d5f141142b596dbbb))
69+
* refactor ApiClient constructors hierarchy to remove Optional parameters ([910d727](https://github.com/google/adk-java/commit/910d727f1981498151dea4cb91b9e5836f91e3ba))
70+
* Remove deprecated create method in ResponseProcessor ([5e1e1d4](https://github.com/google/adk-java/commit/5e1e1d434fa1f3931af30194422800757de96cb6))
71+
* remove deprecated LlmAgent.canonicalTools method ([aabf15a](https://github.com/google/adk-java/commit/aabf15a526ba525cdb47c74c246c178eff1851d5))
72+
* remove deprecated LoadArtifactsTool.loadArtifacts method ([bc38558](https://github.com/google/adk-java/commit/bc385589057a6daf0209a335280bf19d20b2126b))
73+
* remove deprecated url method in ComputerState.Builder ([a86ede0](https://github.com/google/adk-java/commit/a86ede007c3442ed73ee08a5c6ad0e2efa12998a))
74+
* remove executionId method that takes Optional param from CodeExecutionUtils ([be3b3f8](https://github.com/google/adk-java/commit/be3b3f8360888ea1f13796969bb19893c32727e0))
75+
* remove McpAsyncToolset constructors ([82ef5ac](https://github.com/google/adk-java/commit/82ef5ac2689e01676aa95d2616e3b4d8463e573e))
76+
* remove methods with Optional params from VertexCredential.Builder ([0b9057c](https://github.com/google/adk-java/commit/0b9057c9ccab98ea58597ec55b8168e32ac7c9a6))
77+
* Remove Optional parameters in EventActions ([b8316b1](https://github.com/google/adk-java/commit/b8316b1944ce17cc9208963cc09d900c379444c6))
78+
* replace Optional type of version in BaseArtifactService.loadArtifact with Nullable ([5fd4c53](https://github.com/google/adk-java/commit/5fd4c53c88e977d004b9eee8fa3697625ec85f47))
79+
* Trigger traceCallLlm to set call_llm attributes before span ends ([d9d84ee](https://github.com/google/adk-java/commit/d9d84ee67406cce8eeb66abcf1be24fad9c58e29))
80+
* Update converters for task and artifact events; add long running tools ids ([9ce78d7](https://github.com/google/adk-java/commit/9ce78d7c3e1b0fb6d8d4fdce9052a572ffb9e515))
81+
* update LoopAgent's maxIteration field and methods to be @Nullable instead of Optional ([e0d833b](https://github.com/google/adk-java/commit/e0d833b337e958e299d0d11a03f6bfa1468731bc))
82+
* update return type for artifactDelta getter and setter to Map from ConcurrentMap ([d1d5539](https://github.com/google/adk-java/commit/d1d5539ef763b6bfd5057c6ea0f2591225a98535))
83+
* update return type for requestedToolConfirmations getter and setter to Map from ConcurrentMap ([143b656](https://github.com/google/adk-java/commit/143b656949d61363d135e0b74ef5696e78eb270a))
84+
* update return type for stateDelta() to Map from ConcurrentMap ([3f6504e](https://github.com/google/adk-java/commit/3f6504e9416f9f644ef431e612ec983b9a2edd9d))
85+
* update State constructors to accept general Map types ([c6fdb63](https://github.com/google/adk-java/commit/c6fdb63c92e2f3481a01cfeafa946b6dce728c51))
86+
* use @Nullable fields in Event class ([67b602f](https://github.com/google/adk-java/commit/67b602f245f564238ea22298a37bf70049e56a12))
87+
88+
89+
### Bug Fixes
90+
91+
* Explicitly setting the otel parent spans in agents, llm flow and function calls ([20f863f](https://github.com/google/adk-java/commit/20f863f716f653979551c481d85d4e7fa56a35da))
92+
* Make sure that `InvocationContext.callbackContextData` remains the same instance ([14ee28b](https://github.com/google/adk-java/commit/14ee28ba593a9f6f5f7b9bb6003441539fe33a18))
93+
* Removing deprecated InvocationContext methods ([41f5af0](https://github.com/google/adk-java/commit/41f5af0dceb78501ca8b94e434e4d751f608a699))
94+
* Removing deprecated methods in Runner ([0d8e22d](https://github.com/google/adk-java/commit/0d8e22d6e9fe4e8d29c87d485915ba51a22eb350))
95+
* Removing deprecated methods in Runner ([b857f01](https://github.com/google/adk-java/commit/b857f010a0f51df0eb25ecdc364465ffdd9fef65))
96+
97+
98+
### Miscellaneous Chores
99+
100+
* override new version to 0.9.0 ([a47b651](https://github.com/google/adk-java/commit/a47b651b5c4868a603fd79df164b70bc712c3a80))
101+
3102
## [0.8.0](https://github.com/google/adk-java/compare/v0.7.0...v0.8.0) (2026-03-06)
4103

5104

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.8.0</version>
53+
<version>1.0.0-rc.1</version>
5454
</dependency>
5555
<!-- Dev UI -->
5656
<dependency>
5757
<groupId>com.google.adk</groupId>
5858
<artifactId>google-adk-dev</artifactId>
59-
<version>0.8.0</version>
59+
<version>1.0.0-rc.1</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.8.1-SNAPSHOT</version><!-- {x-version-update:google-adk:current} -->
8+
<version>1.0.1-rc.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/agent/RemoteA2AAgent.java

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private RemoteA2AAgent(Builder builder) {
117117
if (this.description.isEmpty() && this.agentCard.description() != null) {
118118
this.description = this.agentCard.description();
119119
}
120-
this.streaming = this.agentCard.capabilities().streaming();
120+
this.streaming = builder.streaming && this.agentCard.capabilities().streaming();
121121
}
122122

123123
public static Builder builder() {
@@ -133,6 +133,13 @@ public static class Builder {
133133
private List<? extends BaseAgent> subAgents;
134134
private List<Callbacks.BeforeAgentCallback> beforeAgentCallback;
135135
private List<Callbacks.AfterAgentCallback> afterAgentCallback;
136+
private boolean streaming;
137+
138+
@CanIgnoreReturnValue
139+
public Builder streaming(boolean streaming) {
140+
this.streaming = streaming;
141+
return this;
142+
}
136143

137144
@CanIgnoreReturnValue
138145
public Builder name(String name) {
@@ -181,6 +188,29 @@ public RemoteA2AAgent build() {
181188
}
182189
}
183190

191+
public boolean isStreaming() {
192+
return streaming;
193+
}
194+
195+
private Message.Builder newA2AMessage(Message.Role role, List<io.a2a.spec.Part<?>> parts) {
196+
return new Message.Builder().messageId(UUID.randomUUID().toString()).role(role).parts(parts);
197+
}
198+
199+
private Message prepareMessage(InvocationContext invocationContext) {
200+
Event userCall = EventConverter.findUserFunctionCall(invocationContext.session().events());
201+
if (userCall != null) {
202+
ImmutableList<io.a2a.spec.Part<?>> parts =
203+
EventConverter.contentToParts(userCall.content(), userCall.partial().orElse(false));
204+
return newA2AMessage(Message.Role.USER, parts)
205+
.taskId(EventConverter.taskId(userCall))
206+
.contextId(EventConverter.contextId(userCall))
207+
.build();
208+
}
209+
return newA2AMessage(
210+
Message.Role.USER, EventConverter.messagePartsFromContext(invocationContext))
211+
.build();
212+
}
213+
184214
@Override
185215
protected Flowable<Event> runAsyncImpl(InvocationContext invocationContext) {
186216
// Construct A2A Message from the last ADK event
@@ -191,14 +221,7 @@ protected Flowable<Event> runAsyncImpl(InvocationContext invocationContext) {
191221
return Flowable.empty();
192222
}
193223

194-
Optional<Message> a2aMessageOpt = EventConverter.convertEventsToA2AMessage(invocationContext);
195-
196-
if (a2aMessageOpt.isEmpty()) {
197-
logger.warn("Failed to convert event to A2A message.");
198-
return Flowable.empty();
199-
}
200-
201-
Message originalMessage = a2aMessageOpt.get();
224+
Message originalMessage = prepareMessage(invocationContext);
202225
String requestJson = serializeMessageToJson(originalMessage);
203226

204227
return Flowable.create(
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.adk.a2a.converters;
17+
18+
/**
19+
* Enum for the type of A2A metadata. Adds a prefix used to differentiage ADK-related values stored
20+
* in Metadata an A2A event.
21+
*/
22+
public enum A2AMetadataKey {
23+
TYPE("type"),
24+
IS_LONG_RUNNING("is_long_running"),
25+
PARTIAL("partial"),
26+
GROUNDING_METADATA("grounding_metadata"),
27+
USAGE_METADATA("usage_metadata"),
28+
CUSTOM_METADATA("custom_metadata"),
29+
ERROR_CODE("error_code");
30+
31+
private final String type;
32+
33+
private A2AMetadataKey(String type) {
34+
this.type = "adk_" + type;
35+
}
36+
37+
public String getType() {
38+
return type;
39+
}
40+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.adk.a2a.converters;
17+
18+
/**
19+
* Enum for the type of ADK metadata. Adds a prefix used to differentiate A2A-related values stored
20+
* in custom metadata of an ADK session event.
21+
*/
22+
public enum AdkMetadataKey {
23+
TASK_ID("task_id"),
24+
CONTEXT_ID("context_id");
25+
26+
private final String type;
27+
28+
private AdkMetadataKey(String type) {
29+
this.type = "a2a:" + type;
30+
}
31+
32+
public String getType() {
33+
return type;
34+
}
35+
}

0 commit comments

Comments
 (0)