Repository navigation
Conversation
With save_as_prefab and no prefab_path, the default prefab path is built from prefab_folder, which the comment says has a default. Since the parameter moved to an Annotated[...] | None = None signature its default is None, so the path became "None/<name>.prefab" and Unity was asked to save the prefab outside Assets. Fall back to "Assets/Prefabs", the original default, when prefab_folder is not given, and add tests for the default, an explicit folder and an explicit prefab_path. Assisted-by: Claude:claude-opus-5-5
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Resolve prefab creation paths Server/src/services/tools/manage_gameobject.py, Server/tests/test_manage_gameobject.py |
When no explicit path or folder is supplied, prefab creation uses Assets/Prefabs/<name>.prefab and omits prefabFolder. Tests also check custom-folder and explicit-path behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: msanatan
Merge Risk: 
Minimal · up to a5695
-
The scoped prefab path change is supported by focused coverage and presents minimal merge risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description follows the repository template, explains the defect and fix, lists affected files, records compatibility details, identifies the test command and results, and explains why documentation and Unity tests were not required.
-
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Description
manage_gameobject(action="create", name="Enemy", save_as_prefab=True)withoutprefab_pathsendsprefabPath = "None/Enemy.prefab"to Unity.The default path is built from
prefab_folder, and the comment says that parameter "has a default". It did originally (prefab_folder: str = "Assets/Prefabs"in cb603b7), but since the parameter becameAnnotated[str, ...] | None = Noneits default isNone, so the f-string produces"None/<name>.prefab". ReadingGameObjectCreate.cs, that path goes toDirectory.CreateDirectoryandPrefabUtility.SaveAsPrefabAssetAndConnectoutsideAssets/(not run in Unity).This PR falls back to
"Assets/Prefabs"whenprefab_folderis not given. An explicitprefab_folderorprefab_pathbehaves as before.Type of Change
Changes Made
Server/src/services/tools/manage_gameobject.py: useprefab_folder or "Assets/Prefabs"when constructing the default prefab path, and update the comment.Server/tests/test_manage_gameobject.py: addTestManageGameObjectPrefabPath(default folder, explicitprefab_folder, explicitprefab_path), using the existingmock_unityfixture.Compatibility / Package Source
#beta,#main, tag, branch, orfile:): not applicablePackages/packages-lock.json(if using a Git package URL): not applicableTesting/Screenshots/Recordings
cd Server && uv run pytest tests/ -v)Before the fix, the new default-folder test fails with
assert 'None/Enemy.prefab' == 'Assets/Prefabs/Enemy.prefab'. After the fix,uv run --extra dev pytest tests -q --ignore=tests/e2epasses: 1579 passed, 18 skipped.Documentation Updates
tools/UPDATE_DOCS_PROMPT.md(recommended)No tool or parameter was added or renamed; only the default used for an omitted
prefab_folderchanges.Related Issues
None.
AI assistance: this change was prepared with Claude (claude-opus-5-5), which found the bug, wrote the fix and tests, ran the test suite, and drafted this description.
Summary by CodeRabbit
Assets/Prefabsusing the GameObject’s name. Specifying a folder or an explicit path continues to use that location.