{"record":{"id":"7ce4a3160c277af1","repo":"sipeed/picoclaw","slug":"migratev1tov2-expected-version-1-got-v","errorCode":null,"errorMessage":"migrateV1ToV2: expected version 1, got %#v","messagePattern":"migrateV1ToV2: expected version 1, got %#v","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/migration.go","lineNumber":272,"sourceCode":"\t\t}\n\t}\n\n\t// map to slice\n\tresult := make([]string, 0, len(set))\n\tfor k := range set {\n\t\tresult = append(result, k)\n\t}\n\n\treturn result\n}\n\n// migrateV1ToV2 converts a V1 config JSON to V2 format:\n//  1. Migrates legacy \"mention_only\" to \"group_trigger.mention_only\"\n//  2. Infers \"enabled\" field for models\n//  3. Sets version to 2\nfunc migrateV1ToV2(m map[string]any) error {\n\tif !compareInt(m[\"version\"], 1) {\n\t\treturn fmt.Errorf(\"migrateV1ToV2: expected version 1, got %#v\", m[\"version\"])\n\t}\n\n\t// Migrate channels: move \"mention_only\" to \"group_trigger.mention_only\"\n\tif channels, ok := m[\"channels\"]; ok {\n\t\tif chMap, ok := channels.(map[string]any); ok {\n\t\t\tfor _, ch := range chMap {\n\t\t\t\tif chVal, ok := ch.(map[string]any); ok {\n\t\t\t\t\tif mentionOnly, hasMention := chVal[\"mention_only\"]; hasMention {\n\t\t\t\t\t\tdelete(chVal, \"mention_only\")\n\t\t\t\t\t\tif gt, hasGT := chVal[\"group_trigger\"].(map[string]any); hasGT {\n\t\t\t\t\t\t\tgt[\"mention_only\"] = mentionOnly\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchVal[\"group_trigger\"] = map[string]any{\"mention_only\": mentionOnly}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/migration.go#L254-L290","documentation":"Error \"migrateV1ToV2: expected version 1, got %#v\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/config/migration.go:272 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}