Skip to content
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

feat: update file upload and download mechanism on toolset #1124

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

angrybayblade
Copy link
Collaborator

@angrybayblade angrybayblade commented Jan 2, 2025

🔍 Review Summary

Purpose:

  • Enhance file upload/download capabilities and improve action schema processing within the Composio toolset.

Changes:

  • Enhancement:

    • Added file_uploadable and file_downloadable attributes to streamline file path and content handling.
    • Improved file data substitution mechanisms in parameters and responses.
  • Refactor:

    • Simplified the execute function by removing redundant logic.
    • Revamped schema processing for better file operations.

Impact:

  • Provides a more robust and efficient Composio toolset, enhancing file handling capabilities and toolset reliability.
Original Description

[!IMPORTANT]
Enhance file handling in Composio toolset by adding new attributes and methods for file upload/download, and refactoring existing logic.

  • Enhancement:
    • Add file_uploadable and file_downloadable attributes to ActionParametersModel and ActionResponseModel.
    • Implement _substitute_file_upload_data and _substitute_file_download_data in toolset.py for file data handling.
  • Refactor:
    • Remove redundant file handling logic from execute() in collections.py.
    • Simplify file operations in ComposioToolSet in toolset.py.
  • Misc:
    • Remove unused imports in collections.py and toolset.py.
    • Rename _process_respone to _process_response in toolset.py.

This description was created by Ellipsis for 72314fa. It will automatically update as commits are pushed.


Copy link

vercel bot commented Jan 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
composio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 6, 2025 0:45am

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 19e16a9 in 50 seconds

More details
  • Looked at 514 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. python/composio/tools/toolset.py:702
  • Draft comment:
    Typo in function name _process_respone. Consider renaming it to _process_response for consistency.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. python/composio/tools/toolset.py:584
  • Draft comment:
    The _ensure_output_dir_exists function is removed, but its functionality is still needed to ensure the output directory exists before writing files. Consider adding a check to ensure the directory exists before writing files.
  • Reason this comment was not posted:
    Comment was on unchanged code.
3. python/composio/client/collections.py:1246
  • Draft comment:
    The output_in_file functionality is removed. If this feature is still needed, consider re-implementing it or providing an alternative solution.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_19tVYVciSn6HjqBJ


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

Walkthrough

This update enhances the Composio toolset by improving file upload and download capabilities. It introduces new attributes to the ActionParametersModel and ActionResponseModel, streamlining file path and content handling. The changes ensure correct encoding and decoding of files during operations and refine action schema processing, making the toolset more robust and efficient.

Changes

File(s) Summary
python/composio/client/collections.py Added file_uploadable and file_downloadable attributes to models for improved file handling. Simplified execute function by removing redundant logic.
python/composio/tools/toolset.py Enhanced file upload/download mechanisms with new methods for file data substitution in parameters and responses. Refactored schema processing for better file operations.

🔗 Related PRs

Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @bot + *your message*
Example: @bot Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @bot + *feedback*
Example: @bot Do not comment on `save_auth` function !

Comment on lines 1274 to 1280
"connectedAccountId": connected_account,
"entityId": entity_id,
"appName": action.app,
"input": modified_params,
"input": params,
"text": text,
"authConfig": self._serialize_auth(auth=auth),
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug Fix: Verify the necessity of 'modified_params' before reverting to 'params' to prevent potential logical errors.

🔧 Suggested Code Diff:
- "input": params,
+ "input": modified_params,
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
"connectedAccountId": connected_account,
"entityId": entity_id,
"appName": action.app,
"input": modified_params,
"input": params,
"text": text,
"authConfig": self._serialize_auth(auth=auth),
},
{
"connectedAccountId": connected_account,
"entityId": entity_id,
"appName": action.app,
"input": modified_params, # Ensure modified_params is correctly set and validated
"text": text,
"authConfig": self._serialize_auth(auth=auth),
}

Comment on lines 702 to 708

return processed

def _process_respone(
def _process_response(
self, action: Action, response: t.Dict
) -> t.Union[t.Dict, _Retry]:
processed = self._process(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug Fix: Correct the function name typo to ensure consistency and avoid errors.

🔧 Suggested Code Diff:
-    def _process_respone(
+    def _process_response(
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
return processed
def _process_respone(
def _process_response(
self, action: Action, response: t.Dict
) -> t.Union[t.Dict, _Retry]:
processed = self._process(
def _process_response(
self, action: Action, response: t.Dict
) -> t.Union[t.Dict, _Retry]:
processed = self._process(action, response)
return processed

Comment on lines 790 to 801

def _substitute_file_upload_data(self, action: Action, params: t.Dict) -> t.Dict:
_schema = self._action_schemas.get(action.slug)
if _schema is None:
(_schema,) = self.get_action_schemas(actions=[action])

if _schema.parameters.file_uploadable:
return self._load_file_as_param(_path=params["file"])

return self._substitute_file_upload_data_recursively(
params=params,
schema=_schema.model_dump().pop("parameters"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug Fix: Ensure _substitute_file_upload_data handles all file upload scenarios without regressions. Test thoroughly with diverse inputs.

🔧 Suggested Code Diff:
+    def _substitute_file_upload_data(self, action: Action, params: t.Dict) -> t.Dict:
+        _schema = self._action_schemas.get(action.slug)
+        if _schema is None:
+            (_schema,) = self.get_action_schemas(actions=[action])
+        if _schema.parameters.file_uploadable:
+            return self._load_file_as_param(_path=params.get("file", ""))
+        return self._substitute_file_upload_data_recursively(
+            params=params,
+            schema=_schema.model_dump().pop("parameters"),
+        )
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
def _substitute_file_upload_data(self, action: Action, params: t.Dict) -> t.Dict:
_schema = self._action_schemas.get(action.slug)
if _schema is None:
(_schema,) = self.get_action_schemas(actions=[action])
if _schema.parameters.file_uploadable:
return self._load_file_as_param(_path=params["file"])
return self._substitute_file_upload_data_recursively(
params=params,
schema=_schema.model_dump().pop("parameters"),
def _substitute_file_upload_data(self, action: Action, params: t.Dict) -> t.Dict:
_schema = self._action_schemas.get(action.slug)
if _schema is None:
(_schema,) = self.get_action_schemas(actions=[action])
if _schema.parameters.file_uploadable:
file_path = params.get("file", "")
if not file_path:
raise ValueError("File path is required for file uploadable actions.")
return self._load_file_as_param(_path=file_path)
return self._substitute_file_upload_data_recursively(
params=params,
schema=_schema.model_dump().pop("parameters"),
)

Comment on lines 821 to 845

def _substitute_file_download_data_recursively(
self,
schema: t.Dict,
response: t.Dict,
action: Action,
) -> t.Dict:
for key in schema["properties"]:
if self._is_file_downloadable(schema=schema["properties"][key]):
response[key] = self._store_response_file(
action=action.slug,
response=response[key],
)
continue

if "type" not in schema["properties"][key]:
continue

if schema["properties"][key]["type"] == "object":
response[key] = self._substitute_file_download_data_recursively(
schema=schema["properties"][key],
response=response[key],
action=action,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor: Refactor _substitute_file_download_data_recursively to an iterative approach to prevent stack overflow in deeply nested schemas.

🔧 Suggested Code Diff:
    def _substitute_file_download_data_iteratively(self, schema: t.Dict, response: t.Dict, action: Action) -> t.Dict:
        stack = [(schema, response)]
        while stack:
            current_schema, current_response = stack.pop()
            for key in current_schema['properties']:
                if self._is_file_downloadable(schema=current_schema['properties'][key]):
                    current_response[key] = self._store_response_file(
                        action=action.slug,
                        response=current_response[key],
                    )
                elif 'type' in current_schema['properties'][key] and current_schema['properties'][key]['type'] == 'object':
                    stack.append((current_schema['properties'][key], current_response[key]))
        return response
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
def _substitute_file_download_data_recursively(
self,
schema: t.Dict,
response: t.Dict,
action: Action,
) -> t.Dict:
for key in schema["properties"]:
if self._is_file_downloadable(schema=schema["properties"][key]):
response[key] = self._store_response_file(
action=action.slug,
response=response[key],
)
continue
if "type" not in schema["properties"][key]:
continue
if schema["properties"][key]["type"] == "object":
response[key] = self._substitute_file_download_data_recursively(
schema=schema["properties"][key],
response=response[key],
action=action,
)
def _substitute_file_download_data_iteratively(self, schema: t.Dict, response: t.Dict, action: Action) -> t.Dict:
stack = [(schema, response)]
while stack:
current_schema, current_response = stack.pop()
for key in current_schema['properties']:
if self._is_file_downloadable(schema=current_schema['properties'][key]):
current_response[key] = self._store_response_file(
action=action.slug,
response=current_response[key],
)
elif 'type' in current_schema['properties'][key] and current_schema['properties'][key]['type'] == 'object':
stack.append((current_schema['properties'][key], current_response[key]))
return response

Comment on lines 847 to 875

def _substitute_file_download_data(
self,
action: Action,
response: t.Dict,
) -> t.Dict:
if not response["successfull"]:
return response

_schema = self._action_schemas.get(action.slug)
if _schema is None:
(_schema,) = self.get_action_schemas(actions=[action])

if _schema.response.file_downloadable:
return {
"output_file": self._store_response_file(
action=action.slug,
response=response.pop("data"),
),
**response,
}

return {
**response,
"data": self._substitute_file_download_data_recursively(
schema=_schema.response.model_dump(),
response=response["data"],
action=action,
),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug Fix: Add a check for 'data' in the response to prevent KeyError.

🔧 Suggested Code Diff:
    def _substitute_file_download_data(
        self,
        action: Action,
        response: t.Dict,
    ) -> t.Dict:
        if not response.get("successfull"):
            return response

+        if "data" not in response:
+            self.logger.error("Missing 'data' in response")
+            return response

        _schema = self._action_schemas.get(action.slug)
        if _schema is None:
            (_schema,) = self.get_action_schemas(actions=[action])

        if _schema.response.file_downloadable:
            return {
                "output_file": self._store_response_file(
                    action=action.slug,
                    response=response.pop("data"),
                ),
                **response,
            }

        return {
            **response,
            "data": self._substitute_file_download_data_recursively(
                schema=_schema.response.model_dump(),
                response=response["data"],
                action=action,
            ),
        }
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
def _substitute_file_download_data(
self,
action: Action,
response: t.Dict,
) -> t.Dict:
if not response["successfull"]:
return response
_schema = self._action_schemas.get(action.slug)
if _schema is None:
(_schema,) = self.get_action_schemas(actions=[action])
if _schema.response.file_downloadable:
return {
"output_file": self._store_response_file(
action=action.slug,
response=response.pop("data"),
),
**response,
}
return {
**response,
"data": self._substitute_file_download_data_recursively(
schema=_schema.response.model_dump(),
response=response["data"],
action=action,
),
def _substitute_file_download_data(
self,
action: Action,
response: t.Dict,
) -> t.Dict:
if not response.get("successfull"):
return response
if "data" not in response:
self.logger.error("Missing 'data' in response")
return response
_schema = self._action_schemas.get(action.slug)
if _schema is None:
(_schema,) = self.get_action_schemas(actions=[action])
if _schema.response.file_downloadable:
return {
"output_file": self._store_response_file(
action=action.slug,
response=response.pop("data"),
),
**response,
}
return {
**response,
"data": self._substitute_file_download_data_recursively(
schema=_schema.response.model_dump(),
response=response["data"],
action=action,
),
}

Comment on lines 947 to 953
processed_response = (
response
if action.is_runtime
else self._process_respone(action=action, response=response)
else self._process_response(action=action, response=response)
)
if isinstance(processed_response, _Retry):
self.logger.debug(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug Fix: Correct the function name typo to prevent runtime errors.

🔧 Suggested Code Diff:
- else self._process_respone(action=action, response=response)
+ else self._process_response(action=action, response=response)
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
processed_response = (
response
if action.is_runtime
else self._process_respone(action=action, response=response)
else self._process_response(action=action, response=response)
)
if isinstance(processed_response, _Retry):
self.logger.debug(
processed_response = (
response
if action.is_runtime
else self._process_response(action=action, response=response)
)
if isinstance(processed_response, _Retry):
self.logger.debug(

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 944e2ef in 55 seconds

More details
  • Looked at 171 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. python/composio/tools/toolset.py:848
  • Draft comment:
    The method _substitute_file_upload_data uses a hardcoded key 'file' to access the file path in params. Consider dynamically determining the key based on the schema properties to avoid potential issues if the file parameter is named differently.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. python/composio/tools/toolset.py:985
  • Draft comment:
    Good practice in handling InvalidFileProvided exception by returning detailed error information as a dictionary. This approach enhances error transparency for the caller.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The InvalidFileProvided exception is being caught and returned as a dictionary in the execute_action method. This is a good practice for handling exceptions gracefully and providing detailed error information to the caller.

Workflow ID: wflow_2YKZMiNSUYk5HBuq


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Comment on lines +820 to +839

def _substitute_file_upload_data_recursively(
self,
params: t.Dict,
schema: t.Dict,
) -> t.Dict:
for key in schema["properties"]:
if self._is_file_uploadable(properties=schema["properties"][key]):
params[key] = self._load_file_as_param(
_path=params[key],
_accept=schema["properties"][key].get("accept", ["*/*"]),
)
continue

if schema["properties"][key]["type"] == "object":
params[key] = self._substitute_file_upload_data_recursively(
params=params[key],
schema=schema["properties"][key],
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential Issue: The method _substitute_file_upload_data_recursively uses recursion to handle nested schemas, which can lead to stack overflow errors if the schema is deeply nested. This is a performance concern that should be addressed to ensure robustness.

Suggestions:

  • Iterative Approach: Consider refactoring the method to use an iterative approach, which can handle deeply nested structures without the risk of stack overflow.
  • Recursion Depth Check: If recursion is preferred, implement a maximum recursion depth check to prevent stack overflow errors.

By addressing this issue, the code will be more resilient and performant, especially when dealing with complex schemas.

🔧 Suggested Code Diff:
    def _substitute_file_upload_data_iteratively(self, params: t.Dict, schema: t.Dict) -> t.Dict:
        stack = [(params, schema)]
        while stack:
            current_params, current_schema = stack.pop()
            for key in current_schema["properties"]:
                if self._is_file_uploadable(properties=current_schema["properties"][key]):
                    current_params[key] = self._load_file_as_param(
                        _path=current_params[key],
                        _accept=current_schema["properties"][key].get("accept", ["*/*"]),
                    )
                elif current_schema["properties"][key]["type"] == "object":
                    stack.append((current_params[key], current_schema["properties"][key]))
        return params
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
def _substitute_file_upload_data_recursively(
self,
params: t.Dict,
schema: t.Dict,
) -> t.Dict:
for key in schema["properties"]:
if self._is_file_uploadable(properties=schema["properties"][key]):
params[key] = self._load_file_as_param(
_path=params[key],
_accept=schema["properties"][key].get("accept", ["*/*"]),
)
continue
if schema["properties"][key]["type"] == "object":
params[key] = self._substitute_file_upload_data_recursively(
params=params[key],
schema=schema["properties"][key],
)
def _substitute_file_upload_data_iteratively(self, params: t.Dict, schema: t.Dict) -> t.Dict:
stack = [(params, schema)]
while stack:
current_params, current_schema = stack.pop()
for key in current_schema["properties"]:
if self._is_file_uploadable(properties=current_schema["properties"][key]):
current_params[key] = self._load_file_as_param(
_path=current_params[key],
_accept=current_schema["properties"][key].get("accept", ["*/*"]),
)
elif current_schema["properties"][key]["type"] == "object":
stack.append((current_params[key], current_schema["properties"][key]))
return params

Comment on lines 982 to +991
)
try:
params = self._substitute_file_upload_data(action=action, params=params)
except InvalidFileProvided as e:
return {
"successful": False,
"error": e.message,
"file": e.file,
"allowed": e.allowed,
"mimetype": e.mimetype,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug Fix: The recent code change introduces a new exception handling mechanism for invalid file uploads, which is a significant alteration in the file handling logic. This change could potentially impact existing workflows by introducing a new exception that might not be handled elsewhere in the code.

Actionable Suggestions:

  • Review the InvalidFileProvided Exception: Ensure that this exception is well-integrated with the existing file upload logic. Verify that it is raised and caught appropriately across all relevant parts of the code.
  • Comprehensive Testing: Conduct thorough testing to cover all possible scenarios where this exception might be triggered. This includes testing with various file types, sizes, and invalid inputs.
  • User Feedback: Ensure that the error messages provided by this exception are clear and informative, aiding in debugging and providing useful feedback to users.
  • Documentation: Update any relevant documentation to reflect this new exception handling mechanism, ensuring that developers and users are aware of the change.

By addressing these points, you can ensure that the new logic is robust and does not introduce regressions or unexpected behavior.

🔧 Suggested Code Diff:
+        try:
+            params = self._substitute_file_upload_data(action=action, params=params)
+        except InvalidFileProvided as e:
+            return {
+                "successful": False,
+                "error": e.message,
+                "file": e.file,
+                "allowed": e.allowed,
+                "mimetype": e.mimetype,
+            }
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
)
try:
params = self._substitute_file_upload_data(action=action, params=params)
except InvalidFileProvided as e:
return {
"successful": False,
"error": e.message,
"file": e.file,
"allowed": e.allowed,
"mimetype": e.mimetype,
try:
params = self._substitute_file_upload_data(action=action, params=params)
except InvalidFileProvided as e:
return {
"successful": False,
"error": str(e), # Ensure the error message is a string
"file": e.file,
"allowed": e.allowed,
"mimetype": e.mimetype,
}

Comment on lines 1013 to 1019
processed_response = (
response
if action.is_runtime
else self._process_respone(action=action, response=response)
else self._process_response(action=action, response=response)
)
if isinstance(processed_response, _Retry):
self.logger.debug(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug Fix: The identified issue is a typographical error in the method name _process_respone, which has been corrected to _process_response. This correction is crucial as the typo could lead to a NameError, potentially breaking the functionality if the incorrect method name is called elsewhere in the code.

Actionable Steps:

  • Ensure that all instances of _process_respone in the codebase are updated to _process_response to prevent runtime errors.
  • Conduct a thorough search across the codebase to confirm no other occurrences of the typo exist.

This change is critical to maintain the integrity of the code and prevent unexpected errors during execution.

🔧 Suggested Code Diff:
- else self._process_respone(action=action, response=response)
+ else self._process_response(action=action, response=response)
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
processed_response = (
response
if action.is_runtime
else self._process_respone(action=action, response=response)
else self._process_response(action=action, response=response)
)
if isinstance(processed_response, _Retry):
self.logger.debug(
processed_response = (
response
if action.is_runtime
else self._process_response(action=action, response=response)
)
if isinstance(processed_response, _Retry):
self.logger.debug(

action: Action,
response: t.Dict,
) -> t.Dict:
if not response["successfull"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are passing successful also now. Should we use that now?
cc: @utkarsh-dixit


return params

def _substitute_file_upload_data(self, action: Action, params: t.Dict) -> t.Dict:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two related bugs were introduced in file upload handling:
In _substitute_file_upload_data(), when file_uploadable is True, the method returns only the file parameter, discarding other parameters. This means actions requiring multiple parameters will fail because non-file parameters are omitted.
In Actions.execute(), the previous file parameter processing logic was removed. This breaks file upload functionality, as file paths are now sent as raw strings instead of being properly read, encoded, and formatted for upload.
These changes prevent correct file uploads and break backward compatibility for actions that require file parameters.

@@ -1086,6 +1191,8 @@ def get_action_schemas(
if item.name == Action.ANTHROPIC_TEXT_EDITOR.slug:
item.name = "str_replace_editor"

self._action_schemas[item.name] = item
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A schema retrieval bug occurs in the get_actions_schemas method where action schemas are stored using item.name (e.g., 'bash'), but later retrieved using action.slug (e.g., 'anthropic_bash_command'). This inconsistency causes schema lookup to fail when retrieving action schemas, potentially leading to incorrect processing of file uploads and downloads. Specifically, methods like _substitute_file_upload_data and _substitute_file_download_data may encounter None schemas due to this mismatched key usage.

)

if self.output_in_file:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are removing this functionality?

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 671e393 in 20 seconds

More details
  • Looked at 65 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. python/composio/tools/toolset.py:923
  • Draft comment:
    Typo in key 'successfull'. It should be 'successful'.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_3ABYEQpoEdz9hAAf


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 72314fa in 16 seconds

More details
  • Looked at 25 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. python/composio/tools/toolset.py:855
  • Draft comment:
    Refactored to use model_dump() directly on _schema.parameters, which is a more direct and efficient approach.
  • Reason this comment was not posted:
    Confidence changes required: 20%
    The change in line 855 is a refactor to use the correct method for dumping the schema model. This aligns with the PR description's intent to improve schema processing.

Workflow ID: wflow_nwudTfrWoEnIS3t9


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants