fix(plugin): setting the default value of the agent tool does not take effect (#341)

This commit is contained in:
mrh997
2025-07-30 22:51:16 +08:00
committed by GitHub
parent 357da72a52
commit 9660a85454
7 changed files with 115 additions and 46 deletions

View File

@@ -114,7 +114,6 @@ func (t *ToolDraftDAO) Create(ctx context.Context, tool *entity.ToolInfo) (toolI
}
func (t *ToolDraftDAO) genToolID(ctx context.Context) (id int64, err error) {
retryTimes := 5
for i := 0; i < retryTimes; i++ {
@@ -123,11 +122,13 @@ func (t *ToolDraftDAO) genToolID(ctx context.Context) (id int64, err error) {
return 0, err
}
if _, ok := conf.GetToolProduct(id); !ok {
_, ok := conf.GetToolProduct(id)
if !ok {
break
}
if i == retryTimes-1 {
return 0, fmt.Errorf("id %d is confilict with product tool id.", id)
return 0, fmt.Errorf("id %d is confilict with product tool id", id)
}
}