fix: Resolve RubyLLM tool names to McpTool names for approval matching#714
Closed
sh1nj1 wants to merge 1 commit into
Closed
fix: Resolve RubyLLM tool names to McpTool names for approval matching#714sh1nj1 wants to merge 1 commit into
sh1nj1 wants to merge 1 commit into
Conversation
RubyLLM generates tool names from Ruby class names (e.g. Tools::CreativeUpdate -> 'tools--creative_update'), but McpTool stores the original tool_name from ToolMeta (e.g. 'creative_update_service'). This mismatch prevented the approval check from finding the correct McpTool record. - Add resolve_mcp_tool_name() to AiClient that maps RubyLLM names to McpTool names via the ToolMeta registry - Pass resolved mcp_tool_name through ApprovalPendingError so Task and Comment store the correct name for ActionExecutor to match on resume - Add tests for name resolution and approval check
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Owner
Author
|
Closed: root cause fixed in rails_mcp_engine v0.4.2 (PR vrerv/rails_mcp_engine#17). The gem now uses tool_name from ToolMeta instead of Ruby class name, so the workaround in Collavre is no longer needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
RubyLLM generates tool names from Ruby class names using its own naming convention:
Tools::CreativeUpdate→tools--creative_updateBut
McpToolstores the originaltool_namefromToolMeta:creative_update_serviceThis name mismatch meant
check_tool_approval!could never find the matchingMcpToolrecord, so approval was never triggered.Solution
resolve_mcp_tool_name()toAiClientthat builds a mapping from RubyLLM tool names to McpTool names via theToolMetaregistrymcp_tool_namethroughApprovalPendingErrorsoTaskand approvalCommentstore the correct nameActionExecutoralready uses the stored name, so resume-after-approval works correctlyChanges
ai_client.rbresolve_mcp_tool_name+build_tool_name_map, use resolved name incheck_tool_approval!approval_pending_error.rbmcp_tool_name:kwarg, prefer it overtool_call.nameai_client_test.rbTests
778 runs, 0 failures, 0 errors ✅