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

Self healing and workspace update agent #663

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

Conversation

Occupying-Mars
Copy link
Contributor

@Occupying-Mars Occupying-Mars commented Dec 5, 2024

Big pr and needs to be tested more
with following changes

Self-Healing Agent Features

  • πŸ” Automatic runtime error detection and analysis
  • πŸ› οΈ LLM-powered error fixing with confidence scoring
  • πŸ“Š Structured JSON output with error analysis and solutions
  • πŸ”„ Auto-retry mechanism with configurable thresholds
  • πŸ“ Detailed error context and metadata collection
  • πŸš€ Integration with existing agent workflows
  • πŸ§ͺ Comprehensive test suite included

Handles common errors like:

  • Zero Division
  • Type Errors
  • Key Errors
  • Index Errors
  • Import Errors
  • And more...

Output format:

{
   "error_type": str,
   "analysis": str,
   "solution": str,
   "confidence": float,
   "metadata": {...}
}

πŸ“š Documentation preview πŸ“š: https://swarms--663.org.readthedocs.build/en/663/

@github-actions github-actions bot added documentation Improvements or additions to documentation tests structs tools utils agents labels Dec 5, 2024
start = end = int(line_range)

# Apply the changes
with open(file_path, 'r') as f:

Check failure

Code scanning / Bearer

Unsanitized dynamic input in file path Error

Unsanitized dynamic input in file path
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be in the WORKSPACE_DIR="agent_workspace".
Can you change file_path to be under that dir?

start -= 1
lines[start:end] = new_code.splitlines(True)

with open(file_path, 'w') as f:

Check failure

Code scanning / Bearer

Unsanitized dynamic input in file path Error

Unsanitized dynamic input in file path
Copy link
Contributor

Choose a reason for hiding this comment

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

This also needs the path change

Comment on lines +245 to +251
process = subprocess.Popen(
code,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)

Check failure

Code scanning / Bearer

Unsanitized user input in OS command Error

Unsanitized user input in OS command
Copy link
Contributor

Choose a reason for hiding this comment

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

The input needs to be filtered to remove hazardous characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents documentation Improvements or additions to documentation structs tests tools utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants