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 broken connections when copying and pasting an agent #9138

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

RitikDutta
Copy link

Summary

This pull request fixes the issue of broken connections when copying and pasting an agent. The connections are now preserved during the copy-paste operation.

Changes

  • Modified the useCopyPaste.ts file to ensure that connections are preserved during the copy-paste operation.

Steps to Reproduce

  1. Copy a small section from an Agent that features links to outside the area you're selecting (use shift + click & drag).
  2. Go to a fresh builder canvas in a new tab.
  3. Paste the copied section.
  4. Try to save the Agent; previously, it would fail due to the outgoing link being broken.

Testing

  • Verified that connections remain intact when copying and pasting agents.
  • Tested by saving the agent to ensure no broken links.

Related Issue

Fixes #9137

Notes

Please review the changes and let me know if any further adjustments are needed.

@RitikDutta RitikDutta requested a review from a team as a code owner December 28, 2024 13:41
@RitikDutta RitikDutta requested review from ntindle and aarushik93 and removed request for a team December 28, 2024 13:41
@CLAassistant
Copy link

CLAassistant commented Dec 28, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

This PR targets the master branch but does not come from dev or a hotfix/* branch.

Automatically setting the base branch to dev.

@github-actions github-actions bot changed the base branch from master to dev December 28, 2024 13:42
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end labels Dec 28, 2024
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

9137 - PR Code Verified

Compliant requirements:

  • Fix broken connections when copying and pasting an agent section with links outside the selected area
  • Ensure copied agent section can be saved after pasting without failing due to broken outgoing links

Requires further human verification:

  • Manual testing needed to verify that copied agent sections with external links can be successfully saved after pasting
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Edge Case Validation

Verify that the connections are properly preserved when copying nodes with multiple incoming and outgoing connections, especially when some connected nodes are not included in the selection

  connections: node.data.connections || [], // Preserve connections
},

Copy link

netlify bot commented Dec 28, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit b03752f
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/677007382c5c3e0008ce9c26

@github-actions github-actions bot added size/m and removed size/l labels Dec 28, 2024
Copy link

netlify bot commented Dec 28, 2024

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit b03752f
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/67700738304353000866ef58

@github-actions github-actions bot added size/s and removed size/m labels Dec 28, 2024
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
Status: No status
Development

Successfully merging this pull request may close these issues.

Broken Connections Copy when Copy & Pasting an Agent
2 participants