{"record":{"id":"594b81f390d44afe","repo":"multica-ai/multica","slug":"ambiguous-s-id-prefix-q-matches-s-use-more-ch","errorCode":null,"errorMessage":"ambiguous %s id prefix %q; matches:\n%s\nUse more characters or run the list command with --full-id","messagePattern":"ambiguous (.+?) id prefix %q; matches:\n(.+?)\nUse more characters or run the list command with --full-id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_id_resolver.go","lineNumber":127,"sourceCode":"\t\tdisplay := matches[0].Display\n\t\tif display == \"\" {\n\t\t\tdisplay = matches[0].ID\n\t\t}\n\t\treturn resolvedID{ID: matches[0].ID, Display: display}, nil\n\tdefault:\n\t\treturn resolvedID{}, ambiguousIDPrefixError(kind, input, matches)\n\t}\n}\n\nfunc ambiguousIDPrefixError(kind, input string, matches []idCandidate) error {\n\tsort.Slice(matches, func(i, j int) bool {\n\t\treturn matches[i].ID < matches[j].ID\n\t})\n\tparts := make([]string, 0, len(matches))\n\tfor _, m := range matches {\n\t\tparts = append(parts, \"  \"+m.ID)\n\t}\n\treturn fmt.Errorf(\"ambiguous %s id prefix %q; matches:\\n%s\\nUse more characters or run the list command with --full-id\", kind, input, strings.Join(parts, \"\\n\"))\n}\n\n// resolveIssueRef accepts only the two canonical issue references:\n//\n//   - the human-facing issue key, e.g. \"MUL-1852\" (validated by\n//     looksLikeIssueIdentifier and resolved server-side);\n//   - the full UUID in dashed canonical form (validated by uuidRegexp).\n//\n// Short UUID prefixes (e.g. \"1881abcd\") were briefly supported but are no\n// longer — on large workspaces the CLI had to page the entire issue list\n// client-side to disambiguate, causing 14–35s timeouts (GH #4701). Since\n// `MUL-123` already covers every human use case for an issue reference, the\n// short-prefix path is removed instead of being moved server-side. Other\n// resources without a human-readable key (autopilots, projects, labels,\n// task runs, workspaces, ...) continue to accept short UUID prefixes; see\n// resolveIDByPrefix.\nfunc resolveIssueRef(ctx context.Context, client *cli.APIClient, input string) (resolvedID, error) {\n\ttrimmed := strings.TrimSpace(input)","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_id_resolver.go#L109-L145","documentation":"Returned by ambiguousIDPrefixError when the prefix matches two or more candidates. It lists all matching UUIDs (sorted) and asks for more characters or the full UUID, because the CLI cannot safely choose among multiple matches.","triggerScenarios":"Passing a short prefix that is a common substring of several resource UUIDs — the shorter the prefix, the higher the collision probability. The full candidate list was fetched and filtered by compact-UUID prefix match, yielding len(matches) >= 2.","commonSituations":"Using minimal 4-char prefixes repeatedly in scripts; large workspaces where UUIDs share leading digits; automation that truncates ids to a fixed short length.","solutions":["Add more hex characters to the prefix until it is unique (the error lists the competing matches)","Copy the full UUID with the list command's --full-id flag","In scripts, store and use full UUIDs rather than truncated prefixes"],"exampleFix":"# before\nmultica project show \"a1b2\"\n# error: ambiguous project id prefix \"a1b2\"; matches:\n#   0a1b2c33-...\n#   7a1b2f99-...\n\n# after\nmultica project show \"0a1b2c33\"  # or the full UUID","handlingStrategy":"validation","validationCode":"// ensureUnambiguous returns the unique match or fails before the CLI call.\nfunc ensureUnambiguous(prefix string, ids []string) (string, error) {\n    var match string\n    for _, id := range ids {\n        if strings.HasPrefix(compactUUID(id), prefix) {\n            if match != \"\" {\n                return \"\", fmt.Errorf(\"prefix %q is ambiguous\", prefix)\n            }\n            match = id\n        }\n    }\n    if match == \"\" {\n        return \"\", fmt.Errorf(\"prefix %q matches nothing\", prefix)\n    }\n    return match, nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Store full UUIDs in scripts and config instead of truncated prefixes","When a prefix must be short, verify uniqueness against the current id list first"],"tags":["cli","id-resolution","ambiguity","uuid"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}