Skip to content

fix(msg): Fix ToolResultBlock transient field#455

Merged
AlbumenJ merged 2 commits intoagentscope-ai:mainfrom
AlbumenJ:0105-jackson
Jan 5, 2026
Merged

fix(msg): Fix ToolResultBlock transient field#455
AlbumenJ merged 2 commits intoagentscope-ai:mainfrom
AlbumenJ:0105-jackson

Conversation

@AlbumenJ
Copy link
Collaborator

@AlbumenJ AlbumenJ commented Jan 5, 2026

Change-Id: I2d6314ae6bbd480758786106da1f614e114e18a8

AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.5, 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.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

Change-Id: I2d6314ae6bbd480758786106da1f614e114e18a8
Change-Id: I194c47a5e6fed658aef9a2e7a392139b8de429fc
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR attempts to fix a transient field issue in the ToolResultBlock class by adding annotations to the isSuspended() method. However, the implementation uses incorrect Jackson annotations.

Key Changes:

  • Added @Transient annotation (from java.beans) to the isSuspended() getter method
  • Added @JsonInclude annotation (incorrect - should be @JsonIgnore)
  • Added import for com.fasterxml.jackson.annotation.JsonInclude

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

package io.agentscope.core.message;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

This import should be com.fasterxml.jackson.annotation.JsonIgnore instead of JsonInclude. The annotation used on line 125 should be @JsonIgnore to exclude the derived property from serialization, following the pattern established in Msg.java.

Suggested change
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonIgnore;

Copilot uses AI. Check for mistakes.
*/
@Transient
@JsonInclude
public boolean isSuspended() {
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The annotation should be @JsonIgnore instead of @JsonInclude. The isSuspended() method is a derived/computed property that reads from the metadata field, so it should be excluded from JSON serialization to prevent redundant data. Using @JsonInclude would cause this property to be serialized, which is incorrect.

This pattern is consistently used in Msg.java where all derived properties annotated with @Transient also use @JsonIgnore (see lines 182-183, 195-196, 209-210, etc. in Msg.java).

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AlbumenJ AlbumenJ merged commit edc06b4 into agentscope-ai:main Jan 5, 2026
4 checks passed
yaohuitc pushed a commit to yaohuitc/agentscope-java that referenced this pull request Jan 10, 2026
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.

1 participant