refactor: replace skill code with skill ID across the application

- Updated skill handling to use skill IDs instead of skill codes in various components, services, and models.
- Modified tests to reflect changes in skill identification.
- Removed references to skill codes in favor of skill IDs for consistency and clarity.
- Updated localization files to remove skill code references and adjust error messages accordingly.
This commit is contained in:
mlogclub
2026-06-20 20:42:07 +08:00
parent 39c648f3c1
commit 541e4c5874
49 changed files with 258 additions and 341 deletions
+7 -11
View File
@@ -11,12 +11,11 @@ import (
func TestBuildRunLogMatchedPlan(t *testing.T) {
log := BuildRunLog(
RuntimeContext{
AIAgent: models.AIAgent{ID: 22},
AIConfig: models.AIConfig{ID: 33},
ConversationID: 11,
ManualSkillCode: "manual_refund",
IntentCode: "refund",
UserMessage: "我要退款",
AIAgent: models.AIAgent{ID: 22},
AIConfig: models.AIConfig{ID: 33},
ConversationID: 11,
ManualSkillDefinitionID: 44,
UserMessage: "我要退款",
},
&ExecutionPlan{
AIAgent: models.AIAgent{ID: 22},
@@ -25,10 +24,7 @@ func TestBuildRunLogMatchedPlan(t *testing.T) {
ModelName: "gpt-test",
Provider: enums.AIProviderOpenAI,
},
Skill: &models.SkillDefinition{
ID: 44,
Code: "refund_skill",
},
Skill: &models.SkillDefinition{ID: 44},
MatchReason: "llm_route",
},
&ExecutionTrace{Status: "ok"},
@@ -41,7 +37,7 @@ func TestBuildRunLogMatchedPlan(t *testing.T) {
if log.ConversationID != 11 || log.AIAgentID != 22 || log.AIConfigID != 33 {
t.Fatalf("unexpected ids in run log: %#v", log)
}
if !log.Matched || !log.FinalSelected || log.SkillCode != "refund_skill" {
if !log.Matched || !log.FinalSelected || log.SkillDefinitionID != 44 {
t.Fatalf("expected matched skill log, got %#v", log)
}
if log.MatchReason != "llm_route" {