chore: add back tck modules by jmesnil · Pull Request #861 · a2aproject/a2a-java · GitHub
Skip to content

chore: add back tck modules - #861

Merged
kabir merged 1 commit into
a2aproject:mainfrom
jmesnil:put_back_tck
May 11, 2026
Merged

kabir merged 1 commit into
a2aproject:mainfrom
jmesnil:put_back_tck

Conversation

@jmesnil

@jmesnil jmesnil commented May 11, 2026

Copy link
Copy Markdown
Contributor

Copy the generated code from a2a-tck/sut/a2a-java

Copy the generated code from a2a-tck/sut/a2a-java

Signed-off-by: Jeff Mesnil <jmesnil@ibm.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new TCK (Technology Compatibility Kit) module to the Java SDK, providing a System Under Test (SUT) implementation. It includes a Quarkus-based application with CDI producers for the agent card and executor, handling various TCK scenarios such as streaming artifacts and task lifecycles. Feedback suggests ensuring consistent artifact IDs when streaming chunked data to prevent the creation of separate artifacts and using the emitter's reject method instead of throwing an error to maintain correct task state transitions.

Comment on lines +36 to +42

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

When append is set to true, the artifactId must be consistent across calls to indicate that the chunks belong to the same artifact. Passing null causes AgentEmitter to generate a new random UUID for each call, which results in the creation of two separate artifacts instead of appending to one. This will likely cause the TCK test for chunked artifacts to fail.

Suggested change
if (messageId.startsWith("tck-stream-artifact-chunked")) {
emitter.startWork();
emitter.addArtifact(List.of(new TextPart("chunk-1 ")), null, null, null, true, false);
emitter.addArtifact(List.of(new TextPart("chunk-2")), null, null, null, true, true);
emitter.complete();
return;
}
if (messageId.startsWith("tck-stream-artifact-chunked")) {
emitter.startWork();
String artifactId = "tck-chunked-artifact";
emitter.addArtifact(List.of(new TextPart("chunk-1 ")), artifactId, null, null, true, false);
emitter.addArtifact(List.of(new TextPart("chunk-2")), artifactId, null, null, true, true);
emitter.complete();
return;
}

Comment on lines +111 to +113
if (messageId.startsWith("tck-reject-task")) {
throw new A2AError(-1, "rejected", null);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For a task rejection scenario, it is more appropriate to use emitter.reject() to transition the task to the REJECTED state. Throwing an A2AError is intended for exceptional conditions and will typically result in a FAILED state, which may not match the expectations of the tck-reject-task test case. Additionally, the AgentExecutor documentation recommends using the emitter for business logic outcomes.

Suggested change
if (messageId.startsWith("tck-reject-task")) {
throw new A2AError(-1, "rejected", null);
}
if (messageId.startsWith("tck-reject-task")) {
emitter.reject(A2A.toAgentMessage("rejected"));
return;
}
References
  1. Adhere to the A2A protocol specification for error code mappings and state transitions, especially in TCK implementations.

@kabir
kabir merged commit f17c451 into a2aproject:main May 11, 2026
6 of 8 checks passed
@kabir

kabir commented May 11, 2026

Copy link
Copy Markdown
Collaborator

salaboy pushed a commit to salaboy/a2a-java that referenced this pull request Jun 19, 2026
Copy the generated code from a2a-tck/sut/a2a-java

Signed-off-by: Jeff Mesnil <jmesnil@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants