Fix Parameter Schema in ShellExecuteTool#2108
Open
hanydd wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
fc730a0 to
95a05a8
Compare
95a05a8 to
f75cecf
Compare
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.
问题
working_directory和timeout这两个参数在描述和实际代码中,都是有默认值的,但是实际注册schema的时候没有传入 @ToolParam(required=false)`,导致实际上这两个参数会被当成必填项进行校验,造成Agent调用频繁出错,造成效率损失。timeout参数是int类型,如果大模型没有返回这个值,那么反射处理参数的地方会传入null,传给primitiveint会直接报错。Summary
working_directoryandtimeoutas optional in the generated schematimeoutand default it to 30 seconds when omitted or non-positiveRoot cause
@ToolParam.required()defaults totrue, butShellExecuteTooldid not override it for its optional parameters. In addition, the primitiveinttimeout could not receive thenullproduced for an omitted argument.Testing
Result: 3 tests passed, 0 failures.