Currently there is no way to rename an existing code environment through the UI. Sometimes end users create a code environment that is helpful for their project and may be scaled to use for others as well. The original name of the code environment might not make sense and end users may want to rename for wider usage. Right now as a work around end users would need to create a new code environment altogether.
For complex code environments, it would be helpful to allow end users to directly update the code environment name rather than create a net new one.