Renaming Scripts - Different name UI vs YAML

I’m sure this is mentioned by someone previously but I can’t find an exact hit.
I duplicated a script in order to removed some unwanted actions. In fact I duplicate a script twice so that I could remove different options in a condition. I renamed those duplicated scripts.
In the visual editor I see this (correctly)

Script: Stop Security Session V2

But in YAML mode I see this

action: script.start_security_session_duplicate_2
metadata: {}
data: {}

Obviously the contents of said scripts are the same. I believe it is just the reference that is different. I think is a bit confusing. In the past I have just copied and pasted into a new script, but it would be nice if the rename option was consistent.

That’s the action name, not the entity_id. Due to how scripts are loaded, renaming never changes the action name, only the entity_id. Yes it’s confusing. The easiest way to get the action name you want is to delete your script and recreate it.

Thanks for the clarification. I’ll do the copy/paste to a new script via a third paste area.