When I started trying out Cloud Agents a few days ago I created an environment using the built-in setup agent. It was working fine, but then at some point I needed to update it.
I decided I will use a dockerfile because this gives me more control. The thing is, it never gets applied. Every new agent is reusing an old environment. I tried with the setup agent again, it finds my configuration in the repo, tries to apply it, does the necessary checks and tells me that everything is fine with my setup.
Not sure what I must do at this point, but it opffers me to save my environment, so I do that. A new snapshot appears in the History and is marked as active. However, new agents with that repo still get the previous environment (different node.js version and some other differences).
I tried starting fresh, but I could find no way to delete snapshots or environments. Tried disconnecting the repo and then reconnecting again, but it remembers everything.
Unfortunately none of the proposed workarounds works (posted in the other thread as well).
Here is the request ID of a session that uses the wrong image: bc-9721837b-569f-4964-899d-7ec8525a0f74 (I have many of those, just picked a random one)
Here is a session with the setup agent that seems to have been successful, but does not change anything: bc-3d15488e-5a66-4f22-9839-853c53a84e29
Thanks for your help. Let me know if you need anything else.
Thanks for the details, and sorry for the confusion here.
I dug into your recent cloud agents on the teamfly-product repo, and here’s what’s going on. There are actually two different paths that decide which environment an agent uses, and they’re disagreeing:
Agents that read your repo’s .cursor/environment.json directly DO build from your Dockerfile correctly. I can see your recent agents building the Docker image as expected, so the Dockerfile itself is fine.
The web “Set up environment” wizard is the part that’s stale. When you re-run it and hit Save, it’s restoring/saving the older base-image snapshot (the original Node version) instead of rebuilding from your updated Dockerfile. That saved snapshot is what your new agents were picking up, which is why you kept seeing the old Node version even after saving a “new” snapshot. This is a known limitation we’re tracking, and your report is linked to it.
To get unblocked now:
Make sure your Dockerfile and .cursor/environment.json are committed and pushed to the branch you start agents from, and that environment.json does not pin a “snapshot” field (just your build/install config).
Delete the saved environment(s) for this repo so agents fall back to building from your repo’s Dockerfile. You can do this from the Dashboard: Cloud Agents > Environments > open the environment > the “…” menu > Delete. I noticed a few saved environments for the same repo (including ones named “devbot” and “devbot-environment”), so it’s worth removing the extras to avoid ambiguity.
If you still see an old environment after that, start an agent from a brand-new branch that has never had an environment. That guarantees there’s no cached snapshot to restore, and it will build fresh from your current Dockerfile.
Once you’re relying on the repo’s Dockerfile rather than a saved snapshot, new agents should consistently pick up your changes. If anything still looks off after these steps, reply here with the agent link (with Privacy Mode off), and I’ll take another look.
I tried using a branch that I had not used before that, but it also got the same (or another but still not the right one) environment - checked by examining the node.js version (I have put 24 in the dockerfile and it is 22 in all environments I was able to run)