Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Add Docker runtime for running workspaces in isolated containers.

Key Features

  • One container per workspace: Container name derived from mux-{projectName}-{workspaceName}, sanitized for Docker's naming requirements
  • Fixed paths inside container: /src for workspace, /tmp/mux-bashes for background processes
  • Container lifecycle: Created on workspace creation, destroyed on deletion
  • Project sync via git bundle: Similar to SSH - uses git bundle create locally, docker cp to transfer, then git clone from bundle inside container

Usage

/new my-feature -r docker ubuntu:22.04

This creates container mux-myproject-my-feature with workspace at /src.

Schema

Docker runtime config only requires:

{ type: "docker", image: string }

Changes

  • DockerRuntime.ts: Main runtime implementation (~800 LoC) with exec, file operations, workspace management
  • DockerRuntime.test.ts: Basic unit tests
  • Schema: Added docker to RuntimeModeSchema enum
  • Frontend: DockerIcon, runtime selector styles, globals.css color variables
  • chatCommands: Parse docker <image> format
  • systemMessage: Docker-specific environment context

Test Results

  • make typecheck
  • make lint
  • bun test src/browser/utils/chatCommands.test.ts ✅ (23 tests)
  • bun test src/node/runtime/DockerRuntime.test.ts ✅ (4 tests)
  • bun test src/common src/browser ✅ (968 tests)

Generated with mux

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- Add DockerRuntime implementation (docker exec-based runtime)\n- Add runtime parsing/config support for docker\n- Keep container naming compatible with existing workspaces\n\n_Generated with mux_
- Extract RemoteRuntime base class (shared exec + file ops)\n- Switch runtime selection UI/state to discriminated union (SSH host / Docker image)\n- Add Docker option to CreationControls and persist last-used host/image\n- Fix remote stdin.close idempotence and SSH tilde expansion edge cases\n\n_Generated with mux_
- Add DockerRuntime to runtime contract integration matrix (reusing ssh fixture container)\n- Make runtime contract tests sequential for remote fixtures to avoid timeouts\n- Avoid global bun module mocks leaking across tests\n- Make lockfile failure test deterministic in CI\n- Reduce sendMessage heavy test flake and ensure CI uses enough Jest workers\n\n_Generated with mux_
deletePlanFilesForWorkspace() used runtime.exec() without waiting for completion.\nAwait stdin.close() + exitCode so callers can assume plan files are gone when it resolves.\n\n_Generated with mux_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant