Ai/feature enhancement - #1531
Open
charmi-reddy wants to merge 68 commits into
Open
Conversation
…on update failure
Mitigates CWE-22 Zip Slip by validating ZIP member paths before extraction in marketplace and tool download flows, preventing arbitrary file write outside extraction directories. Adds regression tests for traversal payloads like ../../evil.py.
…cted run updates.
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.
Overview
This branch introduces critical improvements to SuperAGI's core AI infrastructure, focusing on robustness, type safety, and better error handling across the LLM integration and agent task management layers.
Key Improvements
Added custom ParsingError exception for granular error handling
Input validation before parsing with validate_response() method
Specific exception types (ValueError, KeyError) with descriptive messages
Comprehensive docstrings for all methods
Model validation with supported models list (gpt-4, gpt-3.5-turbo, gpt-4-turbo-preview)
Parameter clamping to ensure valid ranges:
Temperature: 0-2 range
Top-p: 0-1 range
Penalties: -2 to 2 range
Improved logging with f-strings and error-level severity
Removed debug print statements
Added validation to raise errors on empty tool lists
Enhanced type hints and comprehensive docstrings
Better regex pattern documentation
Full type hints for all methods
Redis connection verification on initialization
Comprehensive error handling and logging for all operations
Detailed docstrings with Args/Returns/Raises sections
Redis-specific error handling (RedisError, ConnectionError)
Enhanced docstring documenting tool purpose and structure
Constructor validation ensuring required fields (name, description)
Better error messages for missing required attributes