-
Notifications
You must be signed in to change notification settings - Fork 574
Fix/script path assets prefix and ctx warn bug #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. Fix script path doubling when Assets prefix is used - ManageScript.TryResolveUnderAssets now properly handles both Assets and Assets/ prefixes - Previously, paths like Assets/Script.cs would create files at Assets/Assets/Script.cs - Now correctly strips the prefix and creates files at the intended location 2. Fix FastMCP Context API call in manage_asset - Changed ctx.warn() to ctx.warning() to match FastMCP Context API - Fixes AttributeError when manage_asset encounters property parse errors - Affects ScriptableObject creation and other asset operations with invalid properties
Changed ctx.warning to ctx.error for property parse errors in manage_asset tool to properly handle error cases. This ensures parse errors are reported as errors rather than warnings, and fixes compatibility with FastMCP Context API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
WalkthroughThe PR makes two targeted improvements: enhanced path normalization in ManageScript's TryResolveUnderAssets to handle both "Assets" and "Assets/..." prefixes more robustly, and elevated error reporting in manage_asset.py from warnings to errors when properties parsing fails. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-09-03T16:00:55.839ZApplied to files:
🧬 Code graph analysis (1)Server/src/services/tools/manage_asset.py (1)
🔇 Additional comments (2)
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 |
* Fix script path handling and FastMCP Context API usage 1. Fix script path doubling when Assets prefix is used - ManageScript.TryResolveUnderAssets now properly handles both Assets and Assets/ prefixes - Previously, paths like Assets/Script.cs would create files at Assets/Assets/Script.cs - Now correctly strips the prefix and creates files at the intended location 2. Fix FastMCP Context API call in manage_asset - Changed ctx.warn() to ctx.warning() to match FastMCP Context API - Fixes AttributeError when manage_asset encounters property parse errors - Affects ScriptableObject creation and other asset operations with invalid properties * Fix manage_asset error handling to use ctx.error Changed ctx.warning to ctx.error for property parse errors in manage_asset tool to properly handle error cases. This ensures parse errors are reported as errors rather than warnings, and fixes compatibility with FastMCP Context API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.5 <[email protected]>
handle Assets/ prefix. Previously, paths like Assets/Script.cs would incorrectly
create files at Assets/Assets/Script.cs due to prefix duplication. Now correctly
strips the prefix and creates files at the intended location.
the FastMCP Context API, preventing AttributeError crashes.
ctx.error() for property parse errors in manage_asset. This ensures parse failures
(e.g., invalid ScriptableObject properties) are properly reported as errors rather
than warnings, improving error visibility and semantics.
Combined Impact: These fixes resolve crashes when creating ScriptableObjects with
invalid properties and ensure script files are created at the correct paths when
using the Assets/ prefix.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.