feat: remove fallback mode and max AI reply rounds from AIAgent model and related components

This commit is contained in:
mlogclub
2026-04-10 16:08:17 +08:00
parent ea327e2d97
commit c1d42be1fc
11 changed files with 11 additions and 172 deletions
+7 -1
View File
@@ -3,6 +3,8 @@ package registry
import (
"strings"
"cs-agent/internal/pkg/toolx"
einotool "github.com/cloudwego/eino/components/tool"
)
@@ -28,7 +30,7 @@ func (r *Registry) Resolve(ctx Context) (*ToolSet, error) {
}
toolCode := strings.TrimSpace(toolDef.Code())
if len(allowedToolCodes) > 0 {
if _, ok := allowedToolCodes[toolCode]; !ok {
if _, ok := allowedToolCodes[toolCode]; !ok && !isAlwaysAllowedToolCode(toolCode) {
continue
}
}
@@ -63,3 +65,7 @@ func makeAllowedToolCodeSet(input []string) map[string]struct{} {
}
return ret
}
func isAlwaysAllowedToolCode(toolCode string) bool {
return strings.TrimSpace(toolCode) == toolx.GraphHandoffConversationToolCode
}