feat: enhance handoff reason extraction and improve trace data handling in run log service

This commit is contained in:
mlogclub
2026-04-14 11:45:55 +08:00
parent 13903baf61
commit 48ad418f06
2 changed files with 46 additions and 24 deletions
+18
View File
@@ -85,6 +85,24 @@ func TestGraphPlanReason(t *testing.T) {
}
}
func TestExtractHandoffReason(t *testing.T) {
summary := &Summary{
TraceData: `{
"graphTools": {
"items": [
{
"toolCode":"` + toolx.GraphHandoffConversation.Code + `",
"arguments":{"reason":" 用户明确要求人工处理 "}
}
]
}
}`,
}
if got := extractHandoffReason(summary); got != "用户明确要求人工处理" {
t.Fatalf("unexpected handoff reason: %q", got)
}
}
type fakeErr string
func (e fakeErr) Error() string {