-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Describe the Bug
The A2A outbound connector throws a NullPointerException when the remote agent's Task response contains history messages without a contextId:
{"type":"java.lang.RuntimeException","message":"java.lang.NullPointerException: contextId is required"}
The A2aMessage record uses @AgenticAiRecord which applies defaultNotNull = true via RecordBuilder. This generates a builder that enforces Objects.requireNonNull(contextId, "contextId is required") on all fields not annotated with @Nullable.
When a Task response includes history messages (which don't carry a contextId), the conversion in A2aSdkObjectConverterImpl.java:54-58 calls convert(Message) for each entry. At line 34, message.getContextId() returns null, and the generated A2aMessageBuilder.build() throws the NPE.
Per the A2A Protocol specification, contextId on a Message is optional. The A2A Java SDK (io.a2a.spec.Message) also marks it as @Nullable.
Steps to Reproduce
- Configure an A2A outbound connector (Send Message operation)
- Send a message to a remote A2A agent that returns a Task response with
historyentries - The history messages in the response do not include
contextId(which is valid per the A2A spec) - The connector fails with
NullPointerException: contextId is required
Expected Behavior
The connector should handle Task responses with history messages that omit contextId, since the field is optional per the A2A specification.
Suggested fix: Add @Nullable to contextId in A2aMessage.java:25, consistent with how taskId is already annotated on line 26:
@Nullable String contextId,Environment
- OS: macOS
- Library version: main branch (commit 8535117)
- Camunda version: 8.9
Metadata
Metadata
Assignees
Type
Projects
Status