Commit f81ffd1
fix: Reject messages to tasks in terminal states (#760)
Per A2A spec CORE-SEND-002, SendMessage must return
UnsupportedOperationError when attempting to send messages to tasks in
terminal states (completed, canceled, rejected, failed).
Added validation in DefaultRequestHandler.initMessageSend() to check if
the existing task is in a terminal state (using TaskState.isFinal()) and
throw UnsupportedOperationError before the message reaches the
AgentExecutor.
This fixes the issue on all three transports (JSON-RPC, gRPC, HTTP+JSON)
since they all use the same DefaultRequestHandler code path.
Fixes #741 🦕
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 79cea44 commit f81ffd1
File tree
1 file changed
+7
-0
lines changed- server-common/src/main/java/io/a2a/server/requesthandlers
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1048 | 1055 | | |
1049 | 1056 | | |
1050 | 1057 | | |
| |||
0 commit comments