Skip to content

Commit 6fd1ff9

Browse files
committed
WIP for TCK
1 parent cc846e7 commit 6fd1ff9

File tree

9 files changed

+220
-87
lines changed

9 files changed

+220
-87
lines changed

extras/task-store-database-jpa/src/main/java/io/a2a/extras/taskstore/database/jpa/JpaDatabaseTaskStore.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,13 @@ public ListTasksResult list(ListTasksParams params) {
345345
}
346346

347347
private Task transformTask(Task task, int historyLength, boolean includeArtifacts) {
348-
// Limit history if needed (keep most recent N messages)
348+
// Limit history based on historyLength parameter
349349
List<Message> history = task.getHistory();
350-
if (historyLength > 0 && history != null && history.size() > historyLength) {
350+
if (historyLength == 0) {
351+
// historyLength=0 means no history should be included
352+
history = List.of();
353+
} else if (historyLength > 0 && history != null && history.size() > historyLength) {
354+
// Keep most recent N messages
351355
history = history.subList(history.size() - historyLength, history.size());
352356
}
353357

server-common/src/main/java/io/a2a/server/tasks/InMemoryTaskStore.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,13 @@ public ListTasksResult list(ListTasksParams params) {
133133
}
134134

135135
private Task transformTask(Task task, int historyLength, boolean includeArtifacts) {
136-
// Limit history if needed (keep most recent N messages)
136+
// Limit history based on historyLength parameter
137137
List<Message> history = task.getHistory();
138-
if (historyLength > 0 && history != null && history.size() > historyLength) {
138+
if (historyLength == 0) {
139+
// historyLength=0 means no history should be included
140+
history = List.of();
141+
} else if (historyLength > 0 && history != null && history.size() > historyLength) {
142+
// Keep most recent N messages
139143
history = history.subList(history.size() - historyLength, history.size());
140144
}
141145

spec-grpc/PROTO_DIVERGENCE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Protobuf Schema Divergence from Upstream
2+
3+
This document tracks intentional divergences from the upstream A2A protobuf schema at https://github.com/a2aproject/A2A/blob/main/specification/grpc/a2a.proto
4+
5+
## Current Divergences
6+
7+
### ListTasksResponse.page_size (Field #3)
8+
9+
**Status**: ✅ Aligned with PR #1160 (v1.0 RC)
10+
**Upstream PR**: https://github.com/a2aproject/A2A/pull/1160
11+
**Reason**: TCK tests require `pageSize` field in responses per A2A v0.4.0 spec. PR #1160 adds this field to the schema.
12+
**Action Required**: Remove this divergence once PR #1160 is merged and we sync to v1.0 RC.
13+
**Impact**: Field number change - `total_size` moved from #3 to #4 to accommodate `page_size` at #3.
14+
15+
**Modified**: 2025-11-12
16+
**Tracking Issue**: https://github.com/a2aproject/A2A/pull/1160
17+
18+
## Sync Instructions
19+
20+
When PR #1160 is merged:
21+
1. Verify field numbers match our implementation
22+
2. Remove this divergence note
23+
3. Sync to upstream v1.0 RC tag
24+
4. Regenerate protobuf classes: `cd spec-grpc && mvn clean install -Pproto-compile`

spec-grpc/src/main/java/io/a2a/grpc/A2A.java

Lines changed: 70 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)