From 305f1cb62f145f65a7e8243048764d408141ebfd Mon Sep 17 00:00:00 2001 From: junwen-lee Date: Mon, 1 Sep 2025 10:39:45 +0800 Subject: [PATCH] fix(singleagent): shortcmd without default value (#1881) --- backend/application/singleagent/single_agent.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/application/singleagent/single_agent.go b/backend/application/singleagent/single_agent.go index 7b0e3791..dde12c73 100644 --- a/backend/application/singleagent/single_agent.go +++ b/backend/application/singleagent/single_agent.go @@ -730,15 +730,18 @@ func (s *SingleAgentApplicationService) getAgentInfo(ctx context.Context, botID AgentID: ptr.Of(si.ObjectID), Command: si.ShortcutCommand, Components: slices.Transform(si.Components, func(i *playground.Components) *bot_common.ShortcutCommandComponent { - return &bot_common.ShortcutCommandComponent{ + sc := &bot_common.ShortcutCommandComponent{ Name: i.Name, Description: i.Description, Type: i.InputType.String(), ToolParameter: ptr.Of(i.Parameter), Options: i.Options, - DefaultValue: ptr.Of(i.DefaultValue.Value), IsHide: i.Hide, } + if i.DefaultValue != nil { + sc.DefaultValue = ptr.Of(i.DefaultValue.Value) + } + return sc }), } })