-
Notifications
You must be signed in to change notification settings - Fork 38
Update all plugins to 1.1 #78
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
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.
3 issues found across 19 files
Prompt for AI agents (all 3 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="plugins/communication_protocols/text/src/utcp_text/text_communication_protocol.py">
<violation number="1" location="plugins/communication_protocols/text/src/utcp_text/text_communication_protocol.py:71">
P1: `OpenApiConverter` does not accept a `base_url` keyword argument, so registering OpenAPI manuals now crashes with `TypeError`.</violation>
</file>
<file name="plugins/communication_protocols/file/src/utcp_file/file_communication_protocol.py">
<violation number="1" location="plugins/communication_protocols/file/src/utcp_file/file_communication_protocol.py:27">
P2: Library modules should not call `logging.basicConfig`, as it reconfigures the root logger for every importing application and can break existing logging settings.</violation>
</file>
<file name="core/src/utcp/implementations/default_variable_substitutor.py">
<violation number="1" location="core/src/utcp/implementations/default_variable_substitutor.py:104">
P1: Strings such as `$refresh_token` now bypass substitution entirely because they contain the substring `$ref`, so legitimate variables that merely start with “ref” are no longer resolved.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| call_template_name=manual_call_template.name, | ||
| auth_tools=manual_call_template.auth_tools | ||
| auth_tools=manual_call_template.auth_tools, | ||
| base_url=manual_call_template.base_url |
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.
P1: OpenApiConverter does not accept a base_url keyword argument, so registering OpenAPI manuals now crashes with TypeError.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/communication_protocols/text/src/utcp_text/text_communication_protocol.py, line 71:
<comment>`OpenApiConverter` does not accept a `base_url` keyword argument, so registering OpenAPI manuals now crashes with `TypeError`.</comment>
<file context>
@@ -47,63 +46,52 @@ async def register_manual(self, caller: 'UtcpClient', manual_call_template: Call
call_template_name=manual_call_template.name,
- auth_tools=manual_call_template.auth_tools
+ auth_tools=manual_call_template.auth_tools,
+ base_url=manual_call_template.base_url
)
utcp_manual = converter.convert()
</file context>
|
|
||
| import logging | ||
|
|
||
| logging.basicConfig( |
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.
P2: Library modules should not call logging.basicConfig, as it reconfigures the root logger for every importing application and can break existing logging settings.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/communication_protocols/file/src/utcp_file/file_communication_protocol.py, line 27:
<comment>Library modules should not call `logging.basicConfig`, as it reconfigures the root logger for every importing application and can break existing logging settings.</comment>
<file context>
@@ -0,0 +1,140 @@
+
+import logging
+
+logging.basicConfig(
+ level=logging.INFO,
+ format="%(asctime)s [%(levelname)s] %(filename)s:%(lineno)d - %(message)s"
</file context>
| elif isinstance(obj, str): | ||
| if isinstance(obj, str): | ||
| # Skip substitution for JSON $ref strings | ||
| if '$ref' in obj: |
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.
P1: Strings such as $refresh_token now bypass substitution entirely because they contain the substring $ref, so legitimate variables that merely start with “ref” are no longer resolved.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At core/src/utcp/implementations/default_variable_substitutor.py, line 104:
<comment>Strings such as `$refresh_token` now bypass substitution entirely because they contain the substring `$ref`, so legitimate variables that merely start with “ref” are no longer resolved.</comment>
<file context>
@@ -95,18 +99,22 @@ def substitute(self, obj: dict | list | str, config: UtcpClientConfig, variable_
- elif isinstance(obj, str):
+ if isinstance(obj, str):
+ # Skip substitution for JSON $ref strings
+ if '$ref' in obj:
+ return obj
+
</file context>
| if '$ref' in obj: | |
| if '"$ref"' in obj: |
Summary by cubic
Updates UTCP core and all communication protocol plugins to 1.1, introduces a new file protocol, and makes the text protocol content-based for browser environments. Improves variable substitution to safely handle OpenAPI specs.
New Features
Migration
Written for commit e722413. Summary will update automatically on new commits.