feat(subagent): enhance event forwarding with rich metadata#529
feat(subagent): enhance event forwarding with rich metadata#529chickenlj merged 5 commits intoagentscope-ai:mainfrom
Conversation
Change-Id: Iae897d08d190ef1fdf65e8e16a8d6cb29da818f1
There was a problem hiding this comment.
Pull request overview
This PR enhances the SubAgentTool's event forwarding mechanism by adding rich metadata to forwarded events. The changes enable parent agents to identify which sub-agent generated an event and track the session context, improving observability and debugging capabilities.
Changes:
- Modified
forwardEventmethod to include metadata map with sub-agent information (name, ID, session ID, and original event) - Added Jackson annotations to
Eventclass for proper JSON serialization/deserialization support - Replaced unused
StreamOptionsparameter with relevantAgentandsessionIdparameters
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| agentscope-core/src/main/java/io/agentscope/core/tool/subagent/SubAgentTool.java | Enhanced forwardEvent method to create ToolResultBlock with metadata map containing sub-agent context |
| agentscope-core/src/main/java/io/agentscope/core/agent/Event.java | Added @JsonCreator, @JsonProperty, and @JsonIgnoreProperties annotations to support JSON serialization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
agentscope-core/src/main/java/io/agentscope/core/tool/subagent/SubAgentTool.java
Outdated
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/tool/subagent/SubAgentTool.java
Outdated
Show resolved
Hide resolved
…/SubAgentTool.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
agentscope-core/src/main/java/io/agentscope/core/tool/subagent/SubAgentTool.java
Outdated
Show resolved
Hide resolved
Change-Id: I5f226cb8a527f67cfce88ba57d5fbfac74a38fd8
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Change-Id: Id03e810eb0f8e91f9f5e545f572f5ba8ed098375
Change-Id: Iae897d08d190ef1fdf65e8e16a8d6cb29da818f1
AgentScope-Java Version
[The version of AgentScope-Java you are working on, e.g. 1.0.6, check your pom.xml dependency version or run
mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]Description
[Please describe the background, purpose, changes made, and how to test this PR]
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)