AI Studio making things worse

So I have an app working fine. It writes lyrics for me to use on Suno. But then I ask for a minor change that just needs to be done in a single file, which it implements and returns with failing code. The auto-fix pops up, and the AI starts fixing it. By modifying three more files???
So another auto-fix pops up and clicking it will repair more and more source files because… Well, I don’t know. For some reason, an error in the original fix leads to a cascading effect of failure after failure where the AI starts to rewrite about everything, as it cannot see the tiny error it made in the first module.
Now, I know that AI Studio hasn’t saved any changes yet, as I need to click the “save” button to do so, so I can just refresh the website and do the prompt again. (Or go back to a checkpoint, if there is any.) Trying the prompt again tends to result in a slightly different fix without errors so that resolves the problem.
But the problem is that users might get into an endless auto-fix prompt that will never solve the problem, only make it worse. So it would be practical if AI Studio recognizes this problem and just returns to the root of these auto-fix loops and starts the fix again.

To provide an example of this, today I worked on an App with a left sidebar. The sidebar had eight buttons, and I told AI Studio to add a new one. After gazillion attempts, it still failed to add that button, but it had gone through most of the code. So I refreshed the page and tried again, but it kept failing to add the button.
So, one more refresh to return to the original app. This time, I just removed the while sidebar component from the source code. This crashed the app, of course. So now the App was told to create the sidebar again, which it did. This time with nine buttons, yet a lot of the other code now started to fail. So I copied the new code of the sidebar and hit refresh again.
Now, back to the original state, I opened the sidebar component and pasted the code I had copied over the content. And this worked quite well, as now I have nine buttons.
Still, the button did not work, but now I could concentrate on why. Well, the app.tsx component had this:

    const renderCurrentPage = () => {
        switch (currentPage) {
            case 'topic': return <TopicPage setPage={setCurrentPage} />;
            case 'language': return <LanguagePage setPage={setCurrentPage} />;
            case 'qualities': return <QualitiesPage setPage={setCurrentPage} />;
            case 'style': return <StylePage setPage={setCurrentPage} />;
            case 'instruments': return <InstrumentsPage setPage={setCurrentPage} />;
            case 'lyrics': return <LyricsPage setPage={setCurrentPage} />;
            case 'cover': return <CoverImagePage setPage={setCurrentPage} />;
            case 'collection': return <CollectionPage setPage={setCurrentPage} />;
            default: return <TopicPage setPage={setCurrentPage} />;
        }
    };

And that’s just eight options, with my ninth ‘karaoke’ button missing. I just wonder why the AI just could not find it and kept making mistakes and trying to fix things that worked.

Hi @Katje,

Can you help me understand which feature in AI Studio are you using (build or chat) to generate/fix code?

1 Like

I use the “Build” feature to generate the app.
Btw. I’ve made several more changes to the app and it now has ten options, and it works fine. It’s just that I noticed that the build studio sometimes just makes the problem worse as it focuses on the wrong thing. It’s like when I ask someone to go buy milk and, if they have eggs, buy two dozen. And then they come home with two dozens of milk as the store had eggs… :smiley:

Appreciate and thanks for sharing this feedback @Katje..

I will forward this feedback to our internal teams.

Have a nice day :slight_smile:

1 Like