Skip to content

[Bug]:使用@Tool定义工具时如果有其他注解无法注册到智能中 #626

Open

Description

@Caoyaya
@SaveToolResult
@Tool(name = "countCaseWall", description = "统计案例总数,返回案例总数,开始时间和结束时间的时间格式必须为yyyy-MM-dd HH:mm:ss")
public String countCaseWall(@ToolParam(name = "startTime", description = "开始时间", required = false) String startTime,
                            @ToolParam (name = "endTime", description = "结束时间", required = false)String endTime,
                            ToolExecutionContext toolContext) {
    return "案例总数:" + caseWallService.countCaseWall(startTime,endTime);
}

@SaveToolResult是自定义注解

Activity

  1. added
    bug
    on Jan 22, 2026
  2. fishl3j commented on Jan 22, 2026

    @fishl3j
    Contributor

    可能是因为你使用了spring aop,这个类被代理了,toolkit读取不到@ Tool

  3. Reagan1947 commented on Jan 28, 2026

    @Reagan1947

    Hello, I attempted to reproduce the issue you described but was unable to do so. I noticed your caseTools instance was not created using the new caseTools() method. Was it created via Spring's automatic injection? Perhaps you could provide more details.

    您好, 我尝试复现您提出的问题, 但并没有成功。我注意到您的 caseTools 并未通过 new caseTools() 的方法生成, 是使用的 Spring 自动注入吗? 或许能提供更多细节信息

  4. Caoyaya commented on Feb 2, 2026

    @Caoyaya
    Author

    是的

  5. vowor commented on Feb 3, 2026

    @vowor
    Contributor
    @SaveToolResult
    @Tool(name = "countCaseWall", description = "统计案例总数,返回案例总数,开始时间和结束时间的时间格式必须为yyyy-MM-dd HH:mm:ss")
    public String countCaseWall(@ToolParam(name = "startTime", description = "开始时间", required = false) String startTime,
                                @ToolParam (name = "endTime", description = "结束时间", required = false)String endTime,
                                ToolExecutionContext toolContext) {
        return "案例总数:" + caseWallService.countCaseWall(startTime,endTime);
    }
    

    @SaveToolResult是自定义注解

    Image Image

    兄弟,你的sk暴漏了

  6. fang-tech commented on Feb 4, 2026

    @fang-tech
    Collaborator

    是的

    Did you use JDK dynamic proxy instead of CGLIB?

  7. added theissue type on Apr 3, 2026
  8. added
    area/core/tool
    on May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/core/toolbug

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions