autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Bug]: Workflow 'twoagents' is not among the defined enum values.

Open TheAmazingRoderic opened this issue 1 year ago • 10 comments

Describe the bug

Autogenstudio v0.1.2 allows the upload of an older workflow that defines workflowtype as twoagents. This breaks the app's ability to retrieve existing workflows, displaying

"No workflows found. Please create a new workflow."

caused by

"ERROR | autogenstudio.database.dbmanager:get_items:128 - Error while getting items: Workflow 'twoagents' is not among the defined enum values. Enum name: workflowtype. Possible values: autonomous, sequential"

Additionally, deleting the workflow via the api fails with

{ "message": "Error while deleting: 'twoagents' is not among the defined enum values. Enum name: workflowtype. Possible values: autonomous, sequential", "status": false, "data": null }

Steps to reproduce

1 - Download workflow from AutogenStudio 0.0.56rc9 2 - Upload workflow into AutogenStudio v0.1.2 via the UI 3 - System no longer displays any workflows Screenshot 2024-06-28 at 10 59 17 AM 4 - Attempt to remove offending workflow fails due to invalid workflowtype Screenshot 2024-06-28 at 11 02 21 AM

Model Used

gpt-4

Expected Behavior

Validation of workflowtype upon upload

Screenshots and logs

No response

Additional Information

No response

TheAmazingRoderic avatar Jun 28 '24 16:06 TheAmazingRoderic

Hi @TheAmazingRoderic ,

This error is due to an update in the db schema with v 0.1.0 +. You can correct this by either deleting your current db, or running autogenstudio and pointing it to a new app folder

autogenstudio ui --appdir /path/to/folder

This will create a new db in the /path/to/folder using the right schema.

See docs FAQ on how to specify directory https://microsoft.github.io/autogen/docs/autogen-studio/faqs#q-how-do-i-specify-the-directory-where-fileseg-database-are-stored

victordibia avatar Jun 28 '24 23:06 victordibia

Thank you @victordibia, I was able to repair the database. I reported because I believe it is a bug not to have the same validation/constraint of the schema applied on upload/insert into the database to prevent the situation.

TheAmazingRoderic avatar Jul 01 '24 14:07 TheAmazingRoderic

I do see the TBD in the typescript: https://github.com/microsoft/autogen/blob/d00467ca003274fc2c131b7214c9f12ea2863b6f/samples/apps/autogen-studio/frontend/src/components/views/builder/workflow.tsx#L287 And the commented code used previously: https://github.com/microsoft/autogen/blob/d00467ca003274fc2c131b7214c9f12ea2863b6f/samples/apps/autogen-studio/frontend/src/components/views/builder/workflow.tsx#L300

It seems it would be nice to catch this in back at the the DBManager.upcert

TheAmazingRoderic avatar Jul 01 '24 14:07 TheAmazingRoderic

I have created new db with --appdir instruction, and it allowed me to create one Workflow, but could assign only two agents (proxy and assistant). After that, ALL workflows gone.
image image

RafalSebastian avatar Jul 01 '24 21:07 RafalSebastian

Hi @RafalSebastian ,

Work is being done to improve migration of data across versions, but not yet supported so workflows from previous versions will not be compatible with v 0.1.0 +.

With respect to multiple agents, the way to do that is to.

  • Under agents, create a new agent, select group chat, click create. Once this is created, you should see an agents tab. This should then let you add agents to the group chat. Finally, add a model to your group chat.
  • Under workflow, select your user proxy as sender and then your group chat agent as receiver.

victordibia avatar Jul 01 '24 21:07 victordibia

Thank you Victor for the update. I do not worry much about the issues with migration of data across versions. The problem is I can't define any agent. image same for WIN and LINUX I will carry experiments on previous versions until this issue is fixed. I do strongly regret that I can't contributre much but I truly appreciate everyones effort to make this project better.

RafalSebastian avatar Jul 01 '24 22:07 RafalSebastian

Any chance you can share the command line log that shows up when this error occurs? This will be helpful in debugging the issuel. Eitherway, I'd recommend a fresh conda environment just to ensure there are no conflicts (e.g., version conflicts) and specify a new appdir (ensure the right version of the db is created).

victordibia avatar Jul 02 '24 02:07 victordibia

Victor, the issue appears when trying to upload the previous version workflow json to the latest version of AutoGenStudio. As you said, it won't work and now I know why. Additionally it helped to create fresh conda env and new appdir (which wasn't necessary for clean installation). New ui logic is far more better and "logical". Thank you for your support Victor, very much appreciated.

RafalSebastian avatar Jul 02 '24 05:07 RafalSebastian

A note to whoever comes after this. With the new version, you have to just start from scratch with everything. You cannot bring any agents, any environments, any workflows from your old project files.

You must start from scratch. For me, this entailed creating an entirely new Docker container and building the backend of my application from scratch which was really annoying.

I was able to save the prompts from my old agents but nothing else, there are errors all the way down - this database error was just the beginning. That's the only solution, good luck!

dudetheguydude avatar Jul 16 '24 23:07 dudetheguydude

A note to whoever comes after this. With the new version, you have to just start from scratch with everything. You cannot bring any agents, any environments, any workflows from your old project files.

You must start from scratch. For me, this entailed creating an entirely new Docker container and building the backend of my application from scratch which was really annoying.

I was able to save the prompts from my old agents but nothing else, there are errors all the way down - this database error was just the beginning. That's the only solution, good luck!

I have eventually figured it out. , thank you!

RafalSebastian avatar Jul 28 '24 16:07 RafalSebastian

Closing as this was fixed.

Important - there is a new version of AutoGen Studio, consider upgrading https://github.com/microsoft/autogen/discussions/4208

  • AutoGen Studio documentation - https://microsoft.github.io/autogen/dev/user-guide/autogenstudio-user-guide/index.html
  • To learn about how code executors work ... https://microsoft.github.io/autogen/dev/user-guide/core-user-guide/design-patterns/code-execution-groupchat.html
  • How to convert any agentchat python code and use it in autogen studio - https://microsoft.github.io/autogen/dev/user-guide/autogenstudio-user-guide/usage.html#declarative-specification-of-componenents

victordibia avatar Feb 24 '25 17:02 victordibia