{"record":{"id":"5a6030c224a703b2","repo":"multica-ai/multica","slug":"expected-a-full-uuid-or-at-least-d-hex-characters","errorCode":null,"errorMessage":"expected a full UUID or at least %d hex characters, got %q","messagePattern":"expected a full UUID or at least (.+?) hex characters, got %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_id_resolver.go","lineNumber":62,"sourceCode":"\treturn id\n}\n\nfunc issueCandidate(issue map[string]any) idCandidate {\n\treturn idCandidate{\n\t\tID:      strVal(issue, \"id\"),\n\t\tDisplay: issueDisplayKey(issue),\n\t\tDetail:  strVal(issue, \"title\"),\n\t}\n}\n\nfunc normalizeUUIDPrefix(input string) (string, error) {\n\ttrimmed := strings.TrimSpace(input)\n\tif trimmed == \"\" {\n\t\treturn \"\", fmt.Errorf(\"id is required\")\n\t}\n\tprefix := strings.ToLower(strings.ReplaceAll(trimmed, \"-\", \"\"))\n\tif len(prefix) < minShortIDPrefixLen {\n\t\treturn \"\", fmt.Errorf(\"expected a full UUID or at least %d hex characters, got %q\", minShortIDPrefixLen, input)\n\t}\n\tfor _, r := range prefix {\n\t\tif !((r >= '0' && r <= '9') || (r >= 'a' && r <= 'f')) {\n\t\t\treturn \"\", fmt.Errorf(\"expected a UUID prefix containing only hex characters, got %q\", input)\n\t\t}\n\t}\n\treturn prefix, nil\n}\n\nfunc compactUUID(id string) string {\n\treturn strings.ToLower(strings.ReplaceAll(strings.TrimSpace(id), \"-\", \"\"))\n}\n\nfunc resolveIDByPrefix(ctx context.Context, client *cli.APIClient, kind, input string, fetch func(context.Context, *cli.APIClient) ([]idCandidate, error)) (resolvedID, error) {\n\ttrimmed := strings.TrimSpace(input)\n\tif trimmed == \"\" {\n\t\treturn resolvedID{}, fmt.Errorf(\"%s id is required\", kind)\n\t}","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_id_resolver.go#L44-L80","documentation":"Returned by normalizeUUIDPrefix when the input, after lowercasing and stripping dashes, is shorter than minShortIDPrefixLen (4 hex characters). Short prefixes cannot uniquely identify a resource, so the CLI rejects them before making any network calls.","triggerScenarios":"Passing a 1–3 character id fragment such as \"ab\", \"1a2\", or a dashed fragment whose compact form is under 4 chars. Produced by resolveIDByPrefix for any prefix-resolvable resource (autopilot, project, label, task run) and indirectly by resolveIssueRef's tailored-hint detection.","commonSituations":"Truncated copy-paste from terminal output; shell history editing that cut the id short; scripts slicing substrings of a UUID with too-small an offset or length.","solutions":["Pass at least 4 hex characters of the UUID, or the full UUID","Copy the full UUID via a list command with --full-id and use that","If generating prefixes in a script, validate length >= 4 before calling the CLI"],"exampleFix":"# before\nmultica label rm \"ab\"\n\n# after\nmultica label rm \"ab12cd\"  # or the full UUID from `multica label list --full-id`","handlingStrategy":"validation","validationCode":"// validUUIDPrefix reports whether input can serve as a CLI UUID prefix.\nfunc validUUIDPrefix(input string) bool {\n\tcompact := strings.ToLower(strings.ReplaceAll(strings.TrimSpace(input), \"-\", \"\"))\n\tif len(compact) < 4 {\n\t\treturn false\n\t}\n\tfor _, r := range compact {\n\t\tif !((r >= '0' && r <= '9') || (r >= 'a' && r <= 'f')) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy full UUIDs from list commands using --full-id instead of truncating","Validate prefix length (>=4) and hex-only characters before calling the CLI"],"tags":["cli","validation","id-resolution","uuid"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}