feat(prefabs): add refresh flag to save_prefab_stage to skip AssetDatabase.Refresh()#1123
feat(prefabs): add refresh flag to save_prefab_stage to skip AssetDatabase.Refresh()#1123sssooonnnggg wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds an optional ChangesPrefab-stage save refresh control
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Server/src/services/tools/manage_prefabs.py (1)
24-48:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd explicit tool group in the decorator.
This tool decorator is missing the required
groupargument. Please set it explicitly (for example,group="core"if that’s intended) to keep visibility behavior deterministic.Proposed fix
`@mcp_for_unity_tool`( description=( "Manages Unity Prefab assets. " "Actions: get_info, get_hierarchy, create_from_gameobject, modify_contents, open_prefab_stage, save_prefab_stage, close_prefab_stage. " @@ annotations=ToolAnnotations( title="Manage Prefabs", destructiveHint=True, ), + group="core", )As per coding guidelines:
Server/src/services/tools/*.py: “must use the@mcp_for_unity_tooldecorator with a description and group parameter” and “Use thegroupparameter in@mcp_for_unity_toolto control tool visibility...”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Server/src/services/tools/manage_prefabs.py` around lines 24 - 48, The `@mcp_for_unity_tool` decorator on the Manage Prefabs tool is missing the required group argument; update the decorator call (the one annotating the manage_prefabs tool) to include an explicit group value (e.g., group="core") alongside the existing description and annotations so the tool's visibility is deterministic; ensure you add the group parameter to the `@mcp_for_unity_tool`(...) invocation that wraps this module's managed-prefab functions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@Server/src/services/tools/manage_prefabs.py`:
- Around line 24-48: The `@mcp_for_unity_tool` decorator on the Manage Prefabs
tool is missing the required group argument; update the decorator call (the one
annotating the manage_prefabs tool) to include an explicit group value (e.g.,
group="core") alongside the existing description and annotations so the tool's
visibility is deterministic; ensure you add the group parameter to the
`@mcp_for_unity_tool`(...) invocation that wraps this module's managed-prefab
functions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5cc54f6c-8a05-49fc-951f-378c3ff56332
📒 Files selected for processing (2)
MCPForUnity/Editor/Tools/Prefabs/ManagePrefabs.csServer/src/services/tools/manage_prefabs.py
…abase.Refresh() Allows callers to opt out of the trailing AssetDatabase.Refresh() (often ~1s on large projects) and trigger refresh_unity themselves when needed. SaveAssets() still runs unconditionally so any dirty assets are flushed before returning.
Allows callers to opt out of the trailing SaveAssets()+Refresh() (often ~1s on large projects) and trigger refresh_unity themselves when needed.
Summary by CodeRabbit
New Features
Documentation