Dev container recreation failure to attach

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Hi!

I’m trying to use dev containers, but it looks like it depends on the container ID in order ot work properly.
So if I connect to some container, for example, bla with id 1234, and then i will recreate this container it stop working and there is no visible configuration that can be changed if I want to continue using the dev container.
Faced this issue on mac and ubuntu 22

Any additional info that can help to fix/debug this will be provided upon request

Is it intentional, or a bug?

Steps to Reproduce

  1. cmd + shift +p (mac)
  2. Dev container attach to the running container
  3. Choose a container name from the list
  4. Opens a new window without any issue, installs server-side stuff for VScode
  5. Recreate the container and preserve the same name, outputs with these errors

[info] Inspecting docker container 23663616bb78
2025-07-03 15:33:09.184 [info] Spawned process 78934: ‘docker’ ‘inspect’ ‘23663616bb78’
2025-07-03 15:33:10.387 [error] Error resolving dev container authority Failed to start Dev Container: container is not running: 23663616bb78
2025-07-03 15:33:10.419 [error] forwarderProcess stderr: forwarder error: Too many retries in 30 seconds, assuming container is actually dead

2025-07-03 15:33:10.419 [info] forwarderProcess stdout: forwarder: Stopping forwarding for port 61214
forwarder: Forwarder exiting

2025-07-03 15:33:10.422 [info] Forwarder process exited with status 0, disposing of local tunnel
2025-07-03 15:33:10.422 [info] [tcpForward][(remote) 127.0.0.1:61214 → (local) 127.0.0.1:61214] Disposing of local tunnel
2025-07-03 15:33:10.422 [info] Stopping forwarder process
Looks like it still tries to use the old container ID, instead of the name that was used to connect

If need anything else, let me know

Expected Behavior

Recreation of the container can use a new container ID, the name remains the same.
Like it works in VS Code

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.27 (Universal)
VSCode Version: 1.99.3
Commit: d750e54bba5cffada6d7b3d18e5688ba5e944ad0
Date: 2025-09-17T20:21:17.042Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Additional Information

Installation
Identifier
anysphere.remote-containers
Version
1.0.24
Last Updated
2025-09-10, 08:33:41

Does this stop you from using Cursor

Yes - Cursor is unusable

Me too. Same issue.

Anytime i reload the container, i have to restart everything with Cursor. I would expect that the dev container will allow me to reattach to the new container (maybe sugget it or automatically do it) with sane name and that would seamlessly perform the required extentions installation.

Hi @Reuven and @Barak, thank you for sharing – yes, for “Attach to Running Container”, we do look things up by container id.

Sharing this request with the team to see if we can fallback to container name if the ID doesn’t exist.