Skip to content

Fix provider metadata when duplicating agents#1917

Open
suainam wants to merge 2 commits into
mnfst:mainfrom
suainam:fix-duplicate-user-provider-label
Open

Fix provider metadata when duplicating agents#1917
suainam wants to merge 2 commits into
mnfst:mainfrom
suainam:fix-duplicate-user-provider-label

Conversation

@suainam
Copy link
Copy Markdown

@suainam suainam commented May 14, 2026

Summary

Fix agent duplication failing when copied provider rows hit self-hosted PostgreSQL schemas that require non-null user_providers.label.

This change preserves label and priority when duplicating UserProvider rows.

Why

AgentDuplicationService copied provider rows without label, which caused inserts to fail with a database error on schemas where user_providers.label is NOT NULL.

Testing

  • Added regression coverage for duplicated provider metadata
  • Ran backend duplication unit tests
  • Ran full repo build
  • Verified in the running Docker Compose environment that duplicating an agent now succeeds

Notes

Backend e2e tests were not completed in this environment because the local test database was unavailable from the test runner.


Summary by cubic

Fix agent duplication by preserving provider label and priority when copying UserProvider rows. This prevents insert failures on self-hosted PostgreSQL schemas that require a non-null user_providers.label, with regression tests added to ensure the metadata is kept.

Written for commit 59bb32e. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant