{"record":{"id":"eebbb76752fe6ee9","repo":"multica-ai/multica","slug":"ambiguous-workspace-id-prefix-q-matches-s-use","errorCode":null,"errorMessage":"ambiguous workspace id prefix %q; matches:\n%s\nUse more characters, the slug, or the full UUID","messagePattern":"ambiguous workspace id prefix %q; matches:\n(.+?)\nUse more characters, the slug, or the full UUID","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_workspace.go","lineNumber":412,"sourceCode":"\t\t\treturn matches[0], nil\n\t\tdefault:\n\t\t\treturn workspaceSummary{}, ambiguousWorkspacePrefixError(target, matches)\n\t\t}\n\t}\n\n\treturn workspaceSummary{}, fmt.Errorf(\"workspace %q not found or you do not have access; run 'multica workspace list' to see options\", target)\n}\n\nfunc ambiguousWorkspacePrefixError(input string, matches []workspaceSummary) error {\n\tparts := make([]string, 0, len(matches))\n\tfor _, m := range matches {\n\t\tlabel := m.Name\n\t\tif m.Slug != \"\" {\n\t\t\tlabel = fmt.Sprintf(\"%s (%s)\", m.Name, m.Slug)\n\t\t}\n\t\tparts = append(parts, fmt.Sprintf(\"  %s  %s\", m.ID, label))\n\t}\n\treturn fmt.Errorf(\"ambiguous workspace id prefix %q; matches:\\n%s\\nUse more characters, the slug, or the full UUID\", input, strings.Join(parts, \"\\n\"))\n}\n\n// resolveWorkspaceRef fetches the caller's workspaces and resolves the input\n// (UUID, slug, or short UUID prefix) to a workspaceSummary. Shared by\n// `workspace get`, `workspace update`, `workspace member list`, and\n// `workspace switch` so all four accept the same identifiers users see in\n// `workspace list`.\nfunc resolveWorkspaceRef(ctx context.Context, cmd *cobra.Command, input string) (workspaceSummary, error) {\n\ttarget := strings.TrimSpace(input)\n\tif target == \"\" {\n\t\treturn workspaceSummary{}, fmt.Errorf(\"workspace id, slug, or id prefix is required\")\n\t}\n\tworkspaces, err := fetchWorkspaces(ctx, cmd)\n\tif err != nil {\n\t\treturn workspaceSummary{}, err\n\t}\n\treturn resolveWorkspaceByIDOrSlug(workspaces, target)\n}","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_workspace.go#L394-L430","documentation":"The short UUID prefix given to a workspace subcommand matched more than one workspace in the caller's list. Resolution order is exact UUID → exact slug → prefix; on the prefix pass, multiple matches trigger this error, which lists every candidate with its full UUID and name/slug so the user can disambiguate.","triggerScenarios":"`multica workspace switch abc1` where two accessible workspace IDs both start with abc1. Distinct IDs share a prefix more often than users expect once UUID prefixes are shortened aggressively.","commonSituations":"Large teams with many workspaces, scripts truncating UUIDs for brevity, copy-paste losing trailing characters.","solutions":["Use one of the listed full UUIDs, or the slug, from the matches printed in the error.","Extend the prefix until it is unique (the error shows exactly which IDs collide).","Prefer slugs in scripts — they are unique, human-readable, and never ambiguous."],"exampleFix":"# before\nmultica workspace switch 9a4f\n\n# after\nmultica workspace switch my-team   # slug from the matches list","handlingStrategy":"validation","validationCode":"# prefer slugs or full UUIDs in scripts; if using prefixes, ensure >= 4 hex chars\nif ! [[ \"$WS\" =~ ^[0-9a-fA-F]{4,}$ ]]; then echo 'use slug or full UUID to avoid ambiguity'; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default to slugs or full UUIDs; reserve short prefixes for interactive use only.","When the ambiguity error fires, copy the exact UUID from its match list."],"tags":["cli","validation","workspace","uuid"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}