Skip to content

feat(backend): Migrate old models in existing agents #9452

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

Merged

Conversation

kcze
Copy link
Contributor

@kcze kcze commented Feb 10, 2025

Some existing nodes use models that no longer exist as values on LlmModel enum.

Changes πŸ—οΈ

  • Update models for all blocks with LlmModel fields that do not exist in LlmModel enum to gpt-4o, directly in AgentNode->constantInput db column, on server startup

Checklist πŸ“‹

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Updates wrong models to gpt-4o for all affected AgentNodes
    • Doesn't update correct models
    • Doesn't insert model when unnecessary
    • Doesn't break other values in jsonb

@kcze kcze requested a review from majdyz February 10, 2025 12:30
@kcze kcze requested a review from a team as a code owner February 10, 2025 12:30
@kcze kcze requested review from Bentlybro and removed request for a team February 10, 2025 12:30
Copy link

netlify bot commented Feb 10, 2025

βœ… Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
πŸ”¨ Latest commit d51ee08
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/67e14d169738ee00084f67bb

Copy link

deepsource-io bot commented Feb 10, 2025

Here's the code health analysis summary for commits 7ba566e..d51ee08. View details on DeepSourceΒ β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScriptβœ…Β SuccessView CheckΒ β†—
DeepSource Python LogoPythonβœ…Β Success
❗ 20 occurences introduced
🎯 20 occurences resolved
View CheckΒ β†—

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

netlify bot commented Feb 10, 2025

βœ… Deploy Preview for auto-gpt-docs canceled.

Name Link
πŸ”¨ Latest commit d51ee08
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/67e14d1695b6910008bc3a7d

Swiftyos
Swiftyos previously approved these changes Feb 11, 2025
Copy link
Contributor

@Swiftyos Swiftyos left a comment

Choose a reason for hiding this comment

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

In general happy with this approach. However, I don't feel we should be migrating ai models with clearly communicating it to the user.

Can we add a ticket to push a notification to the user when a model has to be migrated and we can address this at an appropriate time

@majdyz majdyz removed their request for review February 13, 2025 10:26
@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Feb 13, 2025
Copy link
Contributor

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

Copy link
Contributor

Conflicts have been resolved! πŸŽ‰ A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Mar 11, 2025
@github-project-automation github-project-automation bot moved this to πŸ†• Needs initial review in AutoGPT development kanban Mar 11, 2025
@kcze kcze requested review from ntindle, Pwuts and majdyz March 11, 2025 15:01
@kcze
Copy link
Contributor Author

kcze commented Mar 11, 2025

@Swiftyos Added ticket for notifications #9614

Swiftyos
Swiftyos previously approved these changes Mar 13, 2025
@github-project-automation github-project-automation bot moved this from πŸ†• Needs initial review to πŸ‘πŸΌ Mergeable in AutoGPT development kanban Mar 13, 2025
Copy link
Contributor

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

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Mar 16, 2025
Copy link
Contributor

Conflicts have been resolved! πŸŽ‰ A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Mar 23, 2025
@kcze kcze enabled auto-merge March 23, 2025 09:27
@kcze kcze requested a review from Swiftyos March 23, 2025 09:27
Copy link
Contributor

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

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Mar 24, 2025
@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Mar 24, 2025
Copy link
Contributor

Conflicts have been resolved! πŸŽ‰ A maintainer will review the pull request shortly.

Copy link
Contributor

@majdyz majdyz left a comment

Choose a reason for hiding this comment

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

Won't this get slower on every run? we will keep increasing the number of nodes we are checking

Though we've been doing it on other startup query so I guess it's fine 🀷

@kcze kcze added this pull request to the merge queue Mar 25, 2025
Merged via the queue into dev with commit b7ca8d9 Mar 25, 2025
24 checks passed
@kcze kcze deleted the kpczerwinski/open-2150-migrate-old-models-in-existing-agents branch March 25, 2025 09:59
@github-project-automation github-project-automation bot moved this from πŸ‘πŸΌ Mergeable to βœ… Done in AutoGPT development kanban Mar 25, 2025
github-merge-queue bot pushed a commit that referenced this pull request Apr 19, 2025
#9452 was throwing
`operator does not exist: text ? unknown` on deployed dev and so the
function call was commented as a hotfix.
This PR fixes and re-enables the llm model migration function.

### Changes πŸ—οΈ

- Uncomment and fix `migrate_llm_models` function

### Checklist πŸ“‹

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  - [x] Migrate nodes with non-existing models
  - [x] Don't migrate nodes without any model or with correct models

---------

Co-authored-by: Zamil Majdy <[email protected]>
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 size/m
Projects
Status: βœ… Done
Development

Successfully merging this pull request may close these issues.

4 participants