feat(tool): implement strict mode configuration for tools#1274
Merged
LearningGp merged 8 commits intoMay 11, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
LearningGp
requested changes
Apr 28, 2026
Member
Contributor
Author
|
@LearningGp I have fixed all the conflicts |
Contributor
Author
|
Hi @LearningGp Can you please merge this? |
liangxingguang
pushed a commit
to liangxingguang/agentscope-java
that referenced
this pull request
May 21, 2026
…-ai#1274) ## AgentScope-Java Version 1.0.12-SNAPSHOT ## Description This PR fixes strict mode propagation consistency across tool schema registration and conversion paths. agentscope-ai#1243 Background: ToolSchema already supports strict, and formatter layers already pass strict to model payloads when supported. However, strict was not preserved consistently in all tool registration flows. What changed: - Added a backward-compatible strict accessor in AgentTool so AgentTool-based tools can expose strict. - Preserved strict when wrapping ToolSchema in SchemaOnlyTool. - Added strict option in the Tool annotation for annotation-based tools. - Propagated annotation strict value in Toolkit registration flow. - Propagated strict in ToolSchemaProvider when building final ToolSchema objects for model APIs. - Added regression tests for: - registerSchema and schema-only path strict preservation - Tool annotation strict propagation - AgentTool implementation strict propagation How to test: 1. Run targeted tests: mvn -pl agentscope-core -Dtest=SchemaOnlyToolTest,ExternalToolSupportTest,ToolSchemaProviderTest test 2. Optional full module tests: mvn -pl agentscope-core test ## Checklist - [x] Code has been formatted and passes Spotless checks - [x] All tests are passing (mvn test) - [x] Javadoc comments are complete and follow project conventions - [x] Related documentation has been updated (no user-facing docs changed in this PR) - [x] Code is ready for review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

AgentScope-Java Version
1.0.12-SNAPSHOT
Description
This PR fixes strict mode propagation consistency across tool schema registration and conversion paths. #1243
Background:
ToolSchema already supports strict, and formatter layers already pass strict to model payloads when supported. However, strict was not preserved consistently in all tool registration flows.
What changed:
How to test:
mvn -pl agentscope-core -Dtest=SchemaOnlyToolTest,ExternalToolSupportTest,ToolSchemaProviderTest test
mvn -pl agentscope-core test
Checklist