sipeed/picoclaw · error

migrateV1ToV2: expected version 1, got %#v

Error message

migrateV1ToV2: expected version 1, got %#v

What it means

Error "migrateV1ToV2: expected version 1, got %#v" thrown in sipeed/picoclaw.

Source

Thrown at pkg/config/migration.go:272

		}
	}

	// map to slice
	result := make([]string, 0, len(set))
	for k := range set {
		result = append(result, k)
	}

	return result
}

// migrateV1ToV2 converts a V1 config JSON to V2 format:
//  1. Migrates legacy "mention_only" to "group_trigger.mention_only"
//  2. Infers "enabled" field for models
//  3. Sets version to 2
func migrateV1ToV2(m map[string]any) error {
	if !compareInt(m["version"], 1) {
		return fmt.Errorf("migrateV1ToV2: expected version 1, got %#v", m["version"])
	}

	// Migrate channels: move "mention_only" to "group_trigger.mention_only"
	if channels, ok := m["channels"]; ok {
		if chMap, ok := channels.(map[string]any); ok {
			for _, ch := range chMap {
				if chVal, ok := ch.(map[string]any); ok {
					if mentionOnly, hasMention := chVal["mention_only"]; hasMention {
						delete(chVal, "mention_only")
						if gt, hasGT := chVal["group_trigger"].(map[string]any); hasGT {
							gt["mention_only"] = mentionOnly
						} else {
							chVal["group_trigger"] = map[string]any{"mention_only": mentionOnly}
						}
					}
				}
			}
		}

View on GitHub (pinned to 49183d7e8d)

When it happens

Trigger: Thrown at pkg/config/migration.go:272 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/7ce4a3160c277af1. Report an issue: GitHub.