refactor: tighten the tool map types - #7555
Conversation
Type ResolverMap and DeprecatedTools without undefined values and look them up through getToolType, which only matches own keys. Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io> Co-Authored-By: Claude Sonnet 5.5 <michael.kriese+claude-code@mend.io>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: containerbase/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughTool type lookup now checks map ownership before returning a mapped type. Install and uninstall commands and the pip package check use the new helper. ChangesTool type lookup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This refactor stops inherited names such as constructor from resolving as tool types, and existing install, uninstall and pip-check behavior is preserved. No merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Changes
ResolverMapandDeprecatedToolsare typed withoutundefinedvalues. Lookups go through the newgetToolType, which only matches own keys, so a tool name likeconstructorno longer resolves to anObjectprototype member.Split out of #7435, which lists these maps.
Context
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Code and tests were written by Claude Opus 5.5 and Claude Sonnet 5.5 in Claude Code.
Use of AI in replying to PR comments
Who answers review comments:
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
🤖 Generated with Claude Code
Summary by CodeRabbit