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

fix(backend): Fix iteration and timer block #8596

Closed
wants to merge 16 commits into from

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Nov 8, 2024

Background

Improvement on the Step Through Items & Timer block.

Changes 🏗️

  • Avoid mixing data types for items input on Step Through Items block.
  • Make input pins on CountDownTimer block non-advanced.

Testing 🔍

Note

Only for the new autogpt platform, currently in autogpt_platform/

  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

Configuration Changes 📝

Note

Only for the new autogpt platform, currently in autogpt_platform/

If you're making configuration or infrastructure changes, please remember to check you've updated the related infrastructure code in the autogpt_platform/infra folder.

Examples of such changes might include:

  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

@majdyz majdyz requested review from Swiftyos and Bentlybro November 8, 2024 09:52
@majdyz majdyz requested a review from a team as a code owner November 8, 2024 09:52
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end platform/blocks size/xl labels Nov 8, 2024
Copy link

qodo-merge-pro bot commented Nov 8, 2024

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Code Duplication
The StepThroughItemsBlock has three redundant input fields (items, items_object, items_str) that serve the same purpose. This increases complexity and maintenance burden.

Validation Gap
Output validation is skipped for non-standard blocks, which could lead to invalid data propagating through the system.

Error Handling
The error handling in add_execution() could be improved by using more specific exception types instead of generic ValueError.

@majdyz majdyz force-pushed the zamilmajdy/fix-iteration-and-timer-block branch from 289f829 to 57ddeb4 Compare November 8, 2024 09:53
@github-actions github-actions bot added size/m and removed platform/frontend AutoGPT Platform - Front end size/xl labels Nov 8, 2024
Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 12bd53f
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/673c058f4227ed00085e3add

@majdyz majdyz requested a review from ntindle November 12, 2024 03:45
ntindle
ntindle previously approved these changes Nov 12, 2024
Copy link
Member

@ntindle ntindle left a comment

Choose a reason for hiding this comment

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

I agree with the changes here, but we need to figure out migration routes for these type of changes in general. Can you check the marketplace for these being used? if not problematic, feel free to merge

…:Significant-Gravitas/AutoGPT into zamilmajdy/fix-iteration-and-timer-block
@majdyz
Copy link
Contributor Author

majdyz commented Nov 12, 2024

@ntindle good point, I don't see it being used at all in the marketplace, but I can see some historical graphs using it. So I reverted the breaking change.

@majdyz majdyz enabled auto-merge (squash) November 12, 2024 06:07
@majdyz majdyz requested a review from ntindle November 12, 2024 06:07
@Torantulino
Copy link
Member

Is this compatible with loading graphs that have the old version of the block in it now?
Since you've (just) added inputs I wonder whether it will break the graphs or not.

Nick is right that we need to not break blocks until we implement block versioning.

@majdyz
Copy link
Contributor Author

majdyz commented Nov 12, 2024

The added input is not mandatory, so it's not going to break the old block

@majdyz
Copy link
Contributor Author

majdyz commented Nov 12, 2024

The only case that it might break is if there is a graph that uses item input but as str not as list

@majdyz
Copy link
Contributor Author

majdyz commented Nov 19, 2024

Superseded by: #8713

@majdyz majdyz closed this Nov 19, 2024
auto-merge was automatically disabled November 19, 2024 04:38

Pull request was closed

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

Successfully merging this pull request may close these issues.

3 participants