When using the dev container extension in the IDE and the cloud agents simulatenously, the IDE disconnect from the dev container.
Note that the cloud agent and the dev container are using the same container image (not sure it’s relevant).
After digging, I narrowed it down to an interaction between the 2 systems, maybe something related to port forwarding.
Steps to Reproduce
Open IDE with dev container, connect successfully.
Open “Agents” window and click on one of the sessions.
=> IDE disconnect from container after a few seconds / minutes.
If I do not open the Agent window (or leave it in the background), the dev container connexion is rock solid.
Expected Behavior
Beeing able to use both features at the same time.
This is a known issue we’re already tracking, and I’ve added your report to it.
The Agents Window opens its own connection to your dev container, and when you switch it over to a cloud agent session that connection is released. The Dev Containers extension then treats that as “the editor closed” and stops the container about 15 seconds later, which is what knocks your IDE window off it. It isn’t related to the container image or to port forwarding.
As a workaround, you should be able to add "shutdownAction": "none" to your devcontainer.json (top level), then rebuild or reopen the container once. With that set, Cursor never auto-stops the container when a window or session goes away, so the IDE and the Agents Window can share it. The trade-off is that the container keeps running after you close Cursor until you stop it yourself (docker stop <name> or via Docker Desktop).
If you get a chance, one thing that would confirm it on your side: right after the disconnect, run docker ps -a on the host. If your dev container shows as Exited a few seconds after you clicked the cloud agent session, that’s exactly this issue.
Thanks for the quick reply !
I’ll try disabling shutdownAction.
That beeing said, in my experience, the container was still running in docker (/orbstack) but it was indeed disconned cleanly from the point of view of cursor (based on logs).