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

Closed

Conversation

Occupying-Mars
Copy link
Collaborator

@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/

Your Name and others added 30 commits September 20, 2024 18:10
Updates the requirements on [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions) to permit the latest version.
- [Release notes](https://github.com/facelessuser/pymdown-extensions/releases)
- [Commits](facelessuser/pymdown-extensions@10.9...10.10.1)

---
updated-dependencies:
- dependency-name: pymdown-extensions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
…-0.5.1-and-lt-0.6.8

Update ruff requirement from >=0.5.1,<0.6.4 to >=0.5.1,<0.6.8
…extensions-approx-eq-10.10

Update pymdown-extensions requirement from ~=10.9 to ~=10.10
Updates the requirements on [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions) to permit the latest version.
- [Release notes](https://github.com/facelessuser/pymdown-extensions/releases)
- [Commits](facelessuser/pymdown-extensions@10.10...10.11.1)

---
updated-dependencies:
- dependency-name: pymdown-extensions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@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.

6 participants