Phoenix.new - Local git clone doesn't include changes after starting app generation over

After trying out Phoenix.new to build an application, I hit the credit limit for the current pay period.

I tried to export the latest progress by using the Clone 'app' to your local computer option. But the git repository is 22 hours behind and missing most of the changes to the application that were made.

I don’t see any other way to export current progress. Does anyone know if the data will eventually be available in git? Is my only option to manually create files locally and copy the contents over one-by-one? Do I have a limited time to do that before the Preview environment and changes are lost?

Any help or insights are appreciated!

Could you mention what Phoenix.new is, and what the credit limit allows you to do?

Hey @halfer, thanks for the response. Happy to provide some more context!

Links

Product summary

To quote the blog entry:

World, meet Phoenix.new, a batteries-included fully-online coding agent tailored to Elixir and Phoenix.

And the official website:

The Remote AI Runtime for Phoenix

Describe your app, and watch it take shape. Prototype quickly, experiment freely, and share instantly.

Pragmatic summary

When you log into your fly.io dashboard, you should see a new section between Managed PostgreSQL and Upstash Redis in the sidebar. It’s a subscription service, starting at $20 a month. Since the product is so new, there’s still little documentation out there. Which is part of the reason why I’m posting on the forum, in hopes of learning from others while there’s still time to save the progress I’ve made on this app :crossed_fingers:

Oh right, it’s a Fly service. I think this is the place to ask then. Apologies; I thought this was an external service, and I assumed you were lost. :zany_face:

All good! Thanks for asking for more context. In hindsight, I should have thought to provide it given how new the service is.

It was a good experience overall, though it was difficult to gauge how much credit remained since the real-time usage stats aren’t live yet :sweat_smile: I was being thoughtful about usage, but couldn’t gauge how close I actually was. Watching the agent get stuck in a debug loop a few times and burning resources wasn’t the funnest. Even so, hitting the end was a surprise!

At this point I’m just hoping there’s a way to get a reliable export soon, so I can keep developing this app locally and manually deploy it. If anyone has any ideas, I’m all ears!

1 Like

Update: the project was marked as public and previously available at the URL https://73l59v-4000.phx.run/. But that site is no longer resolving. I noticed the preview tab inside Phoenix.new IDE is no longer working either. Feels like a matter of time before the IDE is recycled as well :sweat_smile:

Looks like it’s time to bite-the-bullet and manually copy files one-by-one out of the VScode web editor into local files.

Can you walk me through exactly what happens when you copy the git clone url from the hamburger menu. It clones a fresh project, but it doesn’t contain the up to date files? Are you trying to pull changes locally into an already cloned repo, or doing fresh? There’s a bug in our instructions for replacing your remote, but please try cloning into a fresh local dir to verify state. On the IDE machine there is a bare git repo that the agent’s git pushes to, and that’s what we’re cloning. It uses a post-commit hook, but something that may have gotten wedged. You can verify that from the agent terminate by running git push fly which will push to the local git repo, to see if things are up to date or bugged.

If you’re not able to hit your phx.run, then the webserver stopped running. You can ask the agent to start it again, but we’re going to add UI around this to give you a click to relaunch once your server has launched before. Let me know and we’ll help you get things sorted out. Your IDE /files won’t be recycled :slight_smile:

Hey Chris, thanks for the quick response!

Looking it over again, I think I know what happened. It was caused by me asking Phoenix.new to start over. The first time I used it, it did a great job generating an app without much intervention. After looking over the app, I decided to take it in a different direction. So I put into the chat:

Thanks for the help so far. I’d like to delete this app and start over. Is that possible?

To which it replied:

Then from there I started writing the new app.

Looking back over the git history that is included in the git clone, it matches that original application build. Not the app I generated after it :light_bulb:

Not sure how much visibility you have into the Phoenix.new logs, but I give you (or anyone else at fly.io) full permission to look into any of the ones on my account if it could help. If you don’t, let me know and I’m happy to provide any additional information that’s visible only from my side!

On a related note, now that we have the root cause I’ve edited the forum post title accordingly to better reflect the reality:

Phoenix.new - Local git clone doesn’t include changes after starting app generation over

Note for future reference you can start a new chat. You can generate any number of projects within your IDE. They all live in /workspace. You can have multiple chats around the same codebase, ie dedicated to testing, refactors, etc, or multiple chats around different codebases, so in the future start a new chat and have it go to town. The phx.run urls are port forwarded, so you can even ask the agent to start other projects at different ports and have [slug]-4000.phx.run and [slug]-4001.phx.run etc running at the same time. The only limitation currently is we don’t allow concurrent LLM requests, so you can have agents actively working on files within multiple chats at the same time (it will cancel the inflight one), but you can absolutely hop back and forth b/w chats.

Hey @chrismccord, thanks again for the responses and background on how this all works!

Unfortunately I’m still having issues :sweat_smile:

Billing Issue

I tried purchasing an additional $30 credit, but the new usage meter shows I only have $9.82 remaining:

I sent an email to billing@fly.io about it too.

Upload code issue

The more important issue for me is the Upload local code to IDE button isn’t working. The command completes, but I don’t see changes in the IDE. It’s still showing the original outdated files.

My best guess is when I asked it to “start over” it broke something at the git level in my environment.

Is it possible to reset my account / Phoenix.new environment entirely so I can start fresh?

I’m trialing the tool for potential use at work but right now am blocked until I can get it uploading and downloading code it generates.

Any help is appreciated :folded_hands:

Ps. I know this is all new and I expect things to not work perfectly. No concerns here on that front! I just want to get back to being able to use it :smiley:

You are hard reset. Your usage showed you consumed $40 of token usage, but it’s possible you got caught in the bug where we allowed folks to over consume balances, causing their credit purchase to be eating by the “negative” usage. I fixed up those cases but maybe missed yours. In any case, I credited you $30 for the hassle. Let me know how it goes! Thanks!

1 Like

Wonderful!

Thank you again Chris for the thoughtful and fast response. The hard reset seems to have worked great. I can easily upload the latest files via git and see them in the IDE :+1:

Shout out to Kate for the equally fast response on the billing@fly.io message too.

No product is ever perfect at launch (if it is, it’s launching too late). I didn’t expect this to be perfect. But even with the hiccups, the strength of the product is clear. That alone would be enough to balance things out.

But what really puts it over the top is folks the high-quality responses in record breaking time. That sets you all apart. That combined with the values of the products are unmatched.

Finally, thank you for the credits, you didn’t have to. It’s above and beyond - I’m grateful.

Excited to dive back in to phoenix.new! :tada:

Update: :white_check_mark: I have a potential workaround for the git issues, see the next reply for details.

I may have spoken too soon :sweat_smile:

The Push local code to your IDE command worked yesterday, but it’s not working today.

I’ll detail the exact steps in case it helps spot the issue (including a potential error on my part).

Yesterday

The Push local code to your IDE command worked successfully. I saw the initial commit successfully reflected in the phoenix.new IDE. And I saw the commit from the agent terminal using git log.

I made no other changes last night on either phoenix.new or locally.

Today

Today I made a small change to some files in my local development. I committed the latest changes locally.

I used the git push --quiet fly main command, which understandably failed with the error:

remote: ========================================================================
remote: !!! Your phoenix.new git remote token has expired !!!
remote:
remote: Retry with a new git remote token from your https://phoenix.new dashboard
remote: =========================================================================

So I did a git remote rm fly. Then I went back to the IDE and copied the latest code from the Push local code to your IDE. That succeeded.

I didn’t see the changes in the IDE. So I tried the Restart IDE action. After a restart, I still didn’t see the files changed.

In the phoenix.new agent terminal I ran git log -n 2 and saw yesterdays commit but not today’s:

In my local environment, I see both:

Discussion
No other changes have been made. Any ideas on what the issue could be?

I may have the wrong mental model of how this is supposed to work. I am assuming it’s possible to do bi-directional development where code is updated in either environment using git. Maybe the Push local code to your IDE more of a “one time” import action at the moment?

Okay! I think I have a solution. Or at the very least, a work around.

After using the agent terminal, I better understand the git topology in my environment. Both my local development and my phoenix.new environment have a git remote fly instance.

That repository can be used to synchronize commits from local development and phoenix.new using standard git commands. Running the following commands in either the phoenix.new agent terminal or local development works.

For example, to get the latest changes:

git fetch fly
git merge fly/main

And to push changes:

git push fly main

If this interface for synchronizing is stable (which I expect it to be) then it’ll be easy to implement cross-environment development :raising_hands:

Is there a documentation for this. How to work on phoenix.new locally ?

Hey Shubham, what I’m doing may not be the intended workflow so I wouldn’t expect there to be formal documentation around it. Nor would I expect what I’m describing to continue to work this way in the future.

With that said, if it helps all I’m doing is using standard git commands to navigate a fairly standard development workflow.

There’s essentially three repository instances:

local -> fly <- phoenix_new

Your local repository and the Phoenix.new IDE repository both connect to the same fly repository. That’s the bridge between the two development environments.

As an added bonus, the Phoenix.new instance is smart and pushes changes made in Phoenix.new to the fly repository automatically. So there’s even less you have to manage yourself!

Pushing changes from local to Phoenix.new

If I haven’t done it already, the first step I have to do is clone the repository locally. I use the standard command provided by the Phoenix.new interface to do that. This only has to be done one time.

Once it’s cloned, I cd into the repository. I make my local code changes and commit them. Then it’s time to push those changes into the fly repository.

Connections with the fly repository use tokens that expire quickly (which is a good thing). But it does mean you have to remove and re-add the remote repository often. I do that by running git remote rm fly.

With the git remote cleared, you can use the standard command provided by the Phoenix.new interface to push your changes. At the time of writing, all that command does is a git remote add fly ... && git push fly main.

Once the changes are in the fly repo, the last step is to get them into the Phoenix.new repo. To do that, I open the command line in the Phoenix.new Web UI. Then I do a standard git fetch fly and git merge fly main.

Pulling down changes from Phoenix.new

Since changes are automatically synced from Phoenix.new to the fly repository, there’s nothing you have to do manually on that side. The only thing you have to worry about is pulling down the latest changes from fly to your local repository.

There’s two ways to do that.

One way to do this would be to just clone the repository again using the command provided in the Phoenix.new web UI.

A second way to do it is to manually manage the remote fly repo definition. This is essentially the same commands as above, just in reverse. Clear your existing remote git remote rm fly and then add it back using the git remote add fly ... && git push fly main provided in the Phoenix.new web UI.

Conclusion

The good news as at the time of writing, it’s all just git. And Phoenix.new provides you plenty of help in generating the additional information needed. It’s just a matter of slowing down, thinking through what you’re given, and then doing some commands to wire it all together.