feat(a2a): migrate server runner to streamEvents#2222
Conversation
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR migrates the A2A server's AgentRunner contract and AgentScopeAgentExecutor from the deprecated coarse-grained Event / EventType API to the fine-grained typed AgentEvent / AgentEventType hierarchy. The migration is well-aligned with the project's deprecation direction and fixes #2207. However, a critical logic gap in finalMessage population was faithfully carried over from the old code: when requireInnerMessages=false, the finalMessage is never populated because AgentResultEvent handling is gated behind both isLifecycleEvent() (which returns false for AGENT_RESULT) and the requireInnerMessages flag in handleInnerMessage(). This leads to completeTaskWithMessage() being called with a null finalMessage on stream completion, likely causing an NPE.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR migrates the A2A server's AgentRunner contract and AgentScopeAgentExecutor from the deprecated coarse-grained Event / EventType API to the fine-grained typed AgentEvent / AgentEventType hierarchy. The migration is well-aligned with the project's deprecation direction and fixes #2207. However, a critical logic gap in finalMessage population was faithfully carried over from the old code: when requireInnerMessages=false, the finalMessage is never populated because AgentResultEvent handling is gated behind both isLifecycleEvent() (which returns false for AGENT_RESULT) and the requireInnerMessages flag in handleInnerMessage(). This leads to completeTaskWithMessage() being called with a null finalMessage on stream completion, likely causing an NPE.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
AgentRunnercontract from deprecatedstream()/EventtostreamEvents()/AgentEventBaseReActAgentRunnerto callReActAgent.streamEvents()AgentScopeAgentExecutorto convert typed agent events into A2A streaming artifacts and final messagesFixes #2207
Test
mvn -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-a2a/agentscope-extensions-a2a-server -am testmvn -pl agentscope-extensions/agentscope-spring-boot-starters/agentscope-a2a-spring-boot-starter -am -DskipTests testmvn -pl agentscope-extensions/agentscope-spring-boot-starters/agentscope-a2a-spring-boot-starter -am -Dtest=AgentscopeA2aAutoConfigurationTest,A2aJsonRpcControllerTest -DfailIfNoTests=false test