feat(skill): refactor RuntimeContext to use AIAgent and AIConfig directly, removing contextLoader

This commit is contained in:
mlogclub
2026-04-17 17:37:36 +08:00
parent d5d1956964
commit 3b062c327c
6 changed files with 35 additions and 53 deletions
+4 -3
View File
@@ -11,8 +11,9 @@ import (
func TestBuildRunLogMatchedPlan(t *testing.T) {
log := BuildRunLog(
RuntimeContext{
AIAgent: &models.AIAgent{ID: 22},
AIConfig: &models.AIConfig{ID: 33},
ConversationID: 11,
AIAgentID: 22,
ManualSkillCode: "manual_refund",
IntentCode: "refund",
UserMessage: "我要退款",
@@ -54,7 +55,7 @@ func TestBuildRunLogMatchedPlan(t *testing.T) {
func TestBuildRunLogNotMatchedAndError(t *testing.T) {
log := BuildRunLog(
RuntimeContext{
AIAgentID: 22,
AIAgent: &models.AIAgent{ID: 22},
UserMessage: "随便问问",
},
nil,
@@ -73,7 +74,7 @@ func TestBuildRunLogNotMatchedAndError(t *testing.T) {
}
noMatchLog := BuildRunLog(
RuntimeContext{AIAgentID: 22, UserMessage: "随便问问"},
RuntimeContext{AIAgent: &models.AIAgent{ID: 22}, UserMessage: "随便问问"},
&ExecutionPlan{MatchReason: ""},
&ExecutionTrace{Status: "not_matched"},
nil,