-
Notifications
You must be signed in to change notification settings - Fork 15
fix bugs #12
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
base: main
Are you sure you want to change the base?
fix bugs #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 2 files
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
@@ -83,10 +83,10 @@ def get(obj, attr, default=None): | |||
for py_name_safe, orig_name in param_map.items(): | |||
func_code += f" if {py_name_safe} is not None:\n" | |||
func_code += f" args['{orig_name}'] = {py_name_safe}\n" | |||
func_code += f" return await bridge.client.call_tool('{get(tool, 'name')}', args)\n" | |||
func_code += f" return await client.call_tool('{get(tool, 'name')}', args)\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tool name is inserted into generated code without escaping; a single quote in the name will break the generated function string.
Prompt for AI agents
Address the following comment on web_ui_utcp_mcp_bridge/src/utcp_proxy_mcp.py at line 86:
<comment>Tool name is inserted into generated code without escaping; a single quote in the name will break the generated function string.</comment>
<file context>
@@ -83,10 +83,10 @@ def get(obj, attr, default=None):
func_code += f" if {py_name_safe} is not None:\n"
func_code += f" args['{orig_name}'] = {py_name_safe}\n"
- func_code += f" return await bridge.client.call_tool('{get(tool, 'name')}', args)\n"
+ func_code += f" return await client.call_tool('{get(tool, 'name')}', args)\n"
# Create function
</file context>
func_code += f" return await client.call_tool('{get(tool, 'name')}', args)\n" | |
func_code += f" return await client.call_tool({get(tool, 'name')!r}, args)\n" |
@@ -83,10 +83,10 @@ def get(obj, attr, default=None): | |||
for py_name_safe, orig_name in param_map.items(): | |||
func_code += f" if {py_name_safe} is not None:\n" | |||
func_code += f" args['{orig_name}'] = {py_name_safe}\n" | |||
func_code += f" return await bridge.client.call_tool('{get(tool, 'name')}', args)\n" | |||
func_code += f" return await client.call_tool('{get(tool, 'name')}', args)\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generated proxy references client, but exec assigns it only to locals; at runtime client is not in the function's globals, causing NameError when the proxy is called.
Prompt for AI agents
Address the following comment on web_ui_utcp_mcp_bridge/src/utcp_proxy_mcp.py at line 86:
<comment>Generated proxy references client, but exec assigns it only to locals; at runtime client is not in the function's globals, causing NameError when the proxy is called.</comment>
<file context>
@@ -83,10 +83,10 @@ def get(obj, attr, default=None):
func_code += f" if {py_name_safe} is not None:\n"
func_code += f" args['{orig_name}'] = {py_name_safe}\n"
- func_code += f" return await bridge.client.call_tool('{get(tool, 'name')}', args)\n"
+ func_code += f" return await client.call_tool('{get(tool, 'name')}', args)\n"
# Create function
</file context>
fixes #11 and some other stuff
Summary by cubic
Expose the MCP bridge externally and fix tool invocation in generated proxies to prevent call failures. Fixes #11.