AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

feat(forge): Implement a very very bad, but "functional" agent by default

Open ntindle opened this issue 1 year ago • 6 comments
trafficstars

Background

We’ve received some notes about Forge being difficult to use and a bit broken. This PR aims to solve some of the core issues with that.

Changes 🏗️

  • Fixes various issues
    • Windows Compatibility
    • FastAPI interface Issues
    • Hardcoded paths removed
    • Formatting
    • Ability -> Action Fixes
    • Prompt
    • Imports
    • Actions Files themselves
    • Notes for the codebase
    • Endpoint Error message fixes
  • Updates typing throughout
  • Swaps agent from one that always replies Washington DC to one that has a very bad agent loop

Do we want to keep Washington DCcand make a real agent instead?

PR Quality Scorecard ✨

  • [x] Have you used the PR description template?   +2 pts
  • [ ] Is your pull request atomic, focusing on a single change?   +5 pts
  • [ ] Have you linked the GitHub issue(s) that this PR addresses?   +5 pts
  • [ ] Have you documented your changes clearly and comprehensively?   +5 pts
  • [ ] Have you changed or added a feature?   -4 pts
    • [ ] Have you added/updated corresponding documentation?   +4 pts
    • [ ] Have you added/updated corresponding integration tests?   +5 pts
  • [ ] Have you changed the behavior of AutoGPT?   -5 pts
    • [ ] Have you also run agbenchmark to verify that these changes do not regress performance?   +10 pts

ntindle avatar Mar 17 '24 05:03 ntindle

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Mar 17 '24 05:03 github-actions[bot]

Deploy Preview for auto-gpt-docs ready!

Name Link
Latest commit 26b582c0d4fc9b916cdf06d50c1971d195c4f559
Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/663caca5d05ea400076e1685
Deploy Preview https://deploy-preview-7021--auto-gpt-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 17 '24 05:03 netlify[bot]

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

github-actions[bot] avatar Apr 03 '24 21:04 github-actions[bot]

@CodiumAI-Agent /review

Swiftyos avatar Apr 23 '24 14:04 Swiftyos

PR Review

⏱️ Estimated effort to review [1-5]

4, because the PR includes a wide range of changes across multiple files and functionalities, including updates to action definitions, file operations, and agent behavior. The complexity and breadth of these changes require a thorough review to ensure that all modifications are correct and do not introduce new issues.

🧪 Relevant tests

No

🔍 Possible issues

Possible Bug: The new agent loop might not handle exceptions properly, leading to unhandled exceptions if the JSON response from chat_completion_request is malformed or if the action execution fails.

Performance Concern: The use of synchronous file operations in an asynchronous context could lead to blocking behavior and reduce the efficiency of the application.

🔒 Security concerns

No

Code feedback:
relevant fileautogpts/forge/forge/__main__.py
suggestion      

Consider removing the placeholder ASCII art added in the main file, as it does not contribute to the functionality and clutters the codebase. [important]

relevant line

relevant fileautogpts/forge/forge/actions/file_system/files.py
suggestion      

Replace the synchronous file operations with asynchronous versions to avoid blocking the event loop in an async environment. This change will improve the performance and responsiveness of the application. [important]

relevant linereturn agent.workspace.list(task_id=task_id, path=str(path))

relevant fileautogpts/forge/forge/agent.py
suggestion      

Implement error handling for JSON parsing and action execution within the execute_step method to prevent the agent from crashing due to unexpected exceptions. [important]

relevant linechat_response = await chat_completion_request(**chat_completion_kwargs)

relevant fileautogpts/forge/forge/actions/registry.py
suggestion      

Ensure cross-platform compatibility by handling path separators correctly when registering actions. The current replacement might not cover all edge cases. [medium]

relevant line.replace("\\", "/")


✨ Review tool usage guide:

Overview: The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

  • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
[pr_reviewer]
some_config1=...
some_config2=...

See the review usage page for a comprehensive guide on using this tool.

CodiumAI-Agent avatar Apr 23 '24 14:04 CodiumAI-Agent

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar May 15 '24 22:05 github-actions[bot]

@ntindle closing this now as too much has changed since it was made

Swiftyos avatar Aug 07 '24 08:08 Swiftyos