When using F1 > Dev Containers: Rebuild Container, the command fails to properly rebuild. The same devcontainer configuration works correctly in VS Code with the official ms-vscode-remote.remote-containers extension

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When using F1 > Dev Containers: Rebuild Container, the command fails to properly rebuild. Looking at the logs, I see:

Rebuild mode: undefined

Because the rebuild mode is undefined, the CLI doesn’t know a rebuild was requested. Instead it:

  1. Detects the existing container (Container is new: false)
  2. Tries to restore stale temp compose files from /tmp/devcontainercli-$USER/
  3. Runs docker compose up -d --no-recreate instead of removing and recreating

This results in:
Error resolving dev container authority Failed to run devcontainer command: 1.
An error occurred starting Docker Compose up.

The same devcontainer works correctly in VS Code with the official remote-containers extension.

Steps to Reproduce

Steps to reproduce

  1. Open a folder with a working docker-compose based devcontainer
  2. Successfully open in the devcontainer
  3. Make a change to the Dockerfile
  4. Run F1 > Dev Containers: Rebuild Container

Expected Behavior

Container is removed, image is rebuilt with Dockerfile changes, new container is created and started.

Operating System

Linux

Version Information

Version: 2.4.22
VSCode Version: 1.105.1
Commit: 618c607a249dd7fd2ffc662c6531143833bebd40
Date: 2026-01-26T22:51:47.692Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Linux x64 6.18.6-1-default

  • Extension: anysphere.remote-containers 1.0.31
  • OS: Linux (openSUSE Tumbleweed, kernel 6.18.6-1-default)
  • Docker Compose 5.0.1
  • devcontainers CLI 0.80.2

Additional Information

Workaround: manually run docker rm -f and rm -rf /tmp/devcontainercli-$USER, then use “Reopen in Container” instead.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. The root cause detail (rebuild mode = undefined) really helps.

Your workaround (docker rm + delete /tmp/devcontainercli-$USER, then Reopen in Container) is still the most reliable option for now.

I can see the same config works in the official VS Code extension, so this looks like a bug in anysphere.remote-containers 1.0.31.

Let me know if you find any more details or patterns around when this reproduces.