Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(studio): Fixed an issue where the app would crash if a team was n…
…ot set when opening a playground page. (#5794) <!-- Thank you for your contribution! Please review https://microsoft.github.io/autogen/docs/Contribute before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? <!-- Please give a short summary of the change and the problem this solves. --> (I'm not familiar with English, so I use Goggle translation a lot. So please forgive me if I say something rude.) I started autogen-studio and opened the page in the browser, nothing was rendered. I checked using the Developer tool, the following error appeared: ``` TypeError: Cannot read properties of null (reading 'label') at editor.tsx:114:42 ``` I check the implementation, it looks like `team.component` is `null`, which seems to be caused during initialization process when the team is not registered. [source](https://github.com/microsoft/autogen/blob/78ff883d24b936ca3055df56ed2590e165fb44d2/python/packages/autogen-studio/frontend/src/components/views/playground/manager.tsx#L199) So I fixed the issue where the gallery wasn't being retrieved which was causing the issue. ### Reproduce bug 1. clone this repository 2. open devcontainer(`python/packages/autogen-studio`) 3. Running the application ```sh cd frontend yarn build cd - OPENAI_API_KEY="" autogenstudio ui --port 8081 ``` 4. Open `localhost:8081` in browser. ## Related issue number <!-- For example: "Closes #1234" --> Probably not found. (sorry if I had to raise an issue before PR) ## Checks - [x] I've included any doc changes needed for <https://microsoft.github.io/autogen/>. See <https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to build and test documentation locally. - [-] I've added tests (if relevant) corresponding to the changes introduced in this PR. - [x] I've made sure all auto checks have passed. Co-authored-by: Victor Dibia <[email protected]>
- Loading branch information