multi_edit creates phantom folders on failed calls

multi_edit creates Folder instances for missing path segments before validating arguments. If the call errors, the folders stay.

Repro (empty ServerScriptService):

  1. Call multi_edit with file_path ServerScriptService.Notepad.Modules.DataManager, no className
  2. Errors with “className is required…”
  3. ServerScriptService now has Notepad > Modules > DataManager, all Folders

The final segment gets created as a Folder instead of the intended script class, so later require() calls silently return a Folder.

At scale this is really bad. In long agentic sessions if the AI hallucinates a path once, you get stray folders scattered across services with no way to trace them. It can also fully break games since a lot of systems only create certain things on load up, so phantom duplicates shadow the real ones.

Expected behavior

Failed calls leave the DataModel untouched. Validate everything before creating anything.

1 Like