Skip to content

Add Docker sandbox backend with backend-aware workspace resolution#100

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-docker-sandbox-backend
Draft

Add Docker sandbox backend with backend-aware workspace resolution#100
Copilot wants to merge 3 commits intomainfrom
copilot/add-docker-sandbox-backend

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 30, 2026

This change adds Docker as an additive sandbox backend behind --sandbox docker while keeping worktree as the default. It also decouples workspace lookup/execution from host-only filesystem paths so clone, create, run, attach, prompt, and remove can target either backend consistently.

  • Runtime/backend selection

    • Added a global --sandbox flag with worktree as the default and docker as the additive backend.
    • Switched CLI runtime wiring from a hardcoded worktree layer to backend selection at process startup.
  • Backend-aware workspace resolution

    • Introduced WorkspaceRegistryService and WorkspaceHandle as the lookup boundary for workspace selection and execution.
    • Updated run / attach / prompt / list flows to resolve a workspace handle first instead of deriving everything from host cwd strings.
    • Kept the existing filesystem service for host checkout management, but stopped using it as the only source of truth for workspace discovery.
  • Docker sandbox backend

    • Added a Docker runtime, sandbox adapter, filesystem adapter, and registry implementation.
    • Docker workspaces are identified from container labels/names rather than host directories.
    • Added lazy image bootstrap from a Dockerfile under ~/.local/share/skipper/docker.
    • The image starts from Ubuntu and installs Node, Bun, GitHub CLI, and OpenCode.
  • Repo snapshot + branch creation behavior

    • Docker workspace creation copies a refreshed default-branch snapshot from the host checkout into the container without mutating the user’s checkout.
    • The copied snapshot includes .git metadata, then branch workspaces create/check out the target branch inside the container.
    • Main gets its own container; each branch workspace gets its own long-lived container.
  • Command/prompt parity

    • workspace run now executes through backend-specific workspace handles.
    • workspace attach uses backend-aware attach behavior; Docker attaches via docker exec -it <container> bash.
    • workspace prompt is container-aware and runs OpenCode against the container workspace rather than assuming a host path.
    • workspace remove routes cleanup through the selected backend, including Docker container removal.
    • Docker detach is treated as a no-op.
  • Docs and coverage

    • Updated the README to document Docker as an optional backend and show --sandbox docker usage.
    • Added focused tests around sandbox flag parsing, workspace registry behavior, and the updated workspace-handle-based prompt/list flows.

Example usage:

# Clone host checkout + create main container
sk clone git@github.com:owner/repo.git --sandbox docker

# Create a branch workspace container from the default-branch snapshot
sk workspace create --repository repo --branch feat/x --sandbox docker

# Run inside the container workspace
sk workspace run --repository repo --branch feat/x --command 'pwd' --sandbox docker

# Prompt OpenCode inside the container workspace
sk workspace prompt --repository repo --branch feat/x "Explain this codebase" --sandbox docker

Copilot AI and others added 2 commits March 30, 2026 20:18
Agent-Logs-Url: https://github.com/blntrsz/skipper/sessions/96d6cfde-ae6a-479a-8b54-fa642731971b

Co-authored-by: blntrsz <81449016+blntrsz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/blntrsz/skipper/sessions/96d6cfde-ae6a-479a-8b54-fa642731971b

Co-authored-by: blntrsz <81449016+blntrsz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Docker sandbox backend with runtime repo copy Add Docker sandbox backend with backend-aware workspace resolution Mar 30, 2026
Copilot AI requested a review from blntrsz March 30, 2026 20:23
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.

Add Docker sandbox backend with runtime repo copy

2 participants