MCPcopy Create free account
hub / github.com/53AI/53AIHub / recordProcessStepForHistory

Function recordProcessStepForHistory

api/controller/relay/relay_process_step.go:67–84  ·  view source on GitHub ↗
(ctx context.Context, eid int64, messageStatus *MessageStatsInfo, requestID string, step ProcessStep)

Source from the content-addressed store, hash-verified

65}
66
67func recordProcessStepForHistory(ctx context.Context, eid int64, messageStatus *MessageStatsInfo, requestID string, step ProcessStep) {
68 if messageStatus == nil || eid <= 0 {
69 return
70 }
71 normalized := normalizeProcessStep(step)
72 if !shouldPersistProcessStepForHistory(normalized) {
73 return
74 }
75 if messageStatus.MessageID <= 0 {
76 messageStatus.BufferedSteps = append(messageStatus.BufferedSteps, normalized)
77 return
78 }
79 if err := saveProcessStepRecord(eid, messageStatus.MessageID, requestID, normalized); err != nil {
80 messageStatus.ProcessRecordError = err.Error()
81 logger.Warnf(ctx, "【技能运行】过程记录落库失败: message_id=%d, step_code=%s, err=%v",
82 messageStatus.MessageID, normalized.StepCode, err)
83 }
84}
85
86func shouldPersistProcessStepForHistory(step ProcessStep) bool {
87 status := strings.ToLower(strings.TrimSpace(step.Status))

Callers 3

runAgentLoopFunction · 0.85
sendOutputFilesStepFunction · 0.85
recordProcessStepMethod · 0.85

Calls 5

normalizeProcessStepFunction · 0.85
saveProcessStepRecordFunction · 0.85
WarnfMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected