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(frontend): Fix connection value clash #8559

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Nov 5, 2024

Background

Steps to repro:
Create two AiTextGeneratorBlock, and connect a link to one of the fields in prompt values.
The value will be replicated across nodes.

Changes 🏗️

A piece of code was introduced to prevent a dynamic pin from being connected by a key-value pair that is not yet defined in the node. But that logic only checks the field name without checking the id of the node. Instead of fixing it, we removed it altogether, since the current UX has prevented this scenario from happening:

  • A pin will only show up after we click Add Property
  • Remove pin will be hidden when the pin is connected, meaning it will always have a default value with the same name.
  • We are allowed to set empty string as default value.

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 ntindle and aarushik93 November 5, 2024 04:37
@majdyz majdyz requested a review from a team as a code owner November 5, 2024 04:37
Copy link

qodo-merge-pro bot commented Nov 5, 2024

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

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

Potential Functionality Loss
The removal of the code that filters and processes connections might lead to loss of functionality. The PR description mentions removing logic that prevents a dynamic pin from being connected by an undefined key-value pair. Ensure this removal doesn't introduce unintended side effects or break existing features.

Dependency Change
The dependencies of the useCallback hook have been reduced from [connections, entries, schema.default, selfKey] to [entries, schema.default]. Verify if removing connections and selfKey from the dependency array doesn't cause any stale closure issues or unexpected behavior.

@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end size/s labels Nov 5, 2024
@majdyz majdyz enabled auto-merge (squash) November 5, 2024 05:32
@majdyz majdyz merged commit e84910b into dev Nov 5, 2024
8 checks passed
@majdyz majdyz deleted the zamilmajdy/fix-connection-value-clash branch November 5, 2024 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end Review effort [1-5]: 2 size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants