multica-ai/multica · error

ambiguous workspace id prefix %q; matches: %s Use more chara

Error message

ambiguous workspace id prefix %q; matches:
%s
Use more characters, the slug, or the full UUID

What it means

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.

Source

Thrown at server/cmd/multica/cmd_workspace.go:412

			return matches[0], nil
		default:
			return workspaceSummary{}, ambiguousWorkspacePrefixError(target, matches)
		}
	}

	return workspaceSummary{}, fmt.Errorf("workspace %q not found or you do not have access; run 'multica workspace list' to see options", target)
}

func ambiguousWorkspacePrefixError(input string, matches []workspaceSummary) error {
	parts := make([]string, 0, len(matches))
	for _, m := range matches {
		label := m.Name
		if m.Slug != "" {
			label = fmt.Sprintf("%s (%s)", m.Name, m.Slug)
		}
		parts = append(parts, fmt.Sprintf("  %s  %s", m.ID, label))
	}
	return fmt.Errorf("ambiguous workspace id prefix %q; matches:\n%s\nUse more characters, the slug, or the full UUID", input, strings.Join(parts, "\n"))
}

// resolveWorkspaceRef fetches the caller's workspaces and resolves the input
// (UUID, slug, or short UUID prefix) to a workspaceSummary. Shared by
// `workspace get`, `workspace update`, `workspace member list`, and
// `workspace switch` so all four accept the same identifiers users see in
// `workspace list`.
func resolveWorkspaceRef(ctx context.Context, cmd *cobra.Command, input string) (workspaceSummary, error) {
	target := strings.TrimSpace(input)
	if target == "" {
		return workspaceSummary{}, fmt.Errorf("workspace id, slug, or id prefix is required")
	}
	workspaces, err := fetchWorkspaces(ctx, cmd)
	if err != nil {
		return workspaceSummary{}, err
	}
	return resolveWorkspaceByIDOrSlug(workspaces, target)
}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Use one of the listed full UUIDs, or the slug, from the matches printed in the error.
  2. Extend the prefix until it is unique (the error shows exactly which IDs collide).
  3. Prefer slugs in scripts — they are unique, human-readable, and never ambiguous.

Example fix

# before
multica workspace switch 9a4f

# after
multica workspace switch my-team   # slug from the matches list
Defensive patterns

Strategy: validation

Validate before calling

# prefer slugs or full UUIDs in scripts; if using prefixes, ensure >= 4 hex chars
if ! [[ "$WS" =~ ^[0-9a-fA-F]{4,}$ ]]; then echo 'use slug or full UUID to avoid ambiguity'; fi

Prevention

When it happens

Trigger: `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.

Common situations: Large teams with many workspaces, scripts truncating UUIDs for brevity, copy-paste losing trailing characters.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/eebbb76752fe6ee9. Report an issue: GitHub.