feat: implement skill debug resume functionality and related API endpoints

This commit is contained in:
mlogclub
2026-04-10 17:27:44 +08:00
parent 1087ddca44
commit 97f0df17b6
6 changed files with 292 additions and 0 deletions
@@ -12,6 +12,7 @@ import (
var SkillRuntimeService = newSkillRuntimeService()
var SkillDebugRunHook func(ctx context.Context, req request.SkillDebugRunRequest) (*response.SkillDebugRunResponse, error)
var SkillDebugResumeHook func(ctx context.Context, req request.SkillDebugResumeRequest) (*response.SkillDebugRunResponse, error)
func newSkillRuntimeService() *skillRuntimeService {
return &skillRuntimeService{}
@@ -34,3 +35,19 @@ func (s *skillRuntimeService) DebugRun(ctx context.Context, req request.SkillDeb
}
return SkillDebugRunHook(ctx, req)
}
func (s *skillRuntimeService) DebugResume(ctx context.Context, req request.SkillDebugResumeRequest) (*response.SkillDebugRunResponse, error) {
if req.AIAgentID <= 0 {
return nil, errorsx.InvalidParam("aiAgentId不能为空")
}
if strings.TrimSpace(req.CheckPointID) == "" {
return nil, errorsx.InvalidParam("checkPointId不能为空")
}
if strings.TrimSpace(req.UserMessage) == "" {
return nil, errorsx.InvalidParam("userMessage不能为空")
}
if SkillDebugResumeHook == nil {
return nil, fmt.Errorf("skill debug resume runner is not initialized")
}
return SkillDebugResumeHook(ctx, req)
}