Skip to content

bug(vm): restarting a stopped sandbox re-resolves its image tag under the preserved overlay #6186

Backlog

Description

@137137137

User Story

I use OpenShell VM sandboxes on my own projects.

Problem Statement

Restarting a stopped VM sandbox re-resolves its image tag. provision_sandbox_inner with PreserveExisting passes the original reference (usually a tag) to prepare_images_in_worker, which does a fresh HEAD and uses whatever digest the tag points to now. If the tag moved while the sandbox was stopped, the preserved overlay is mounted over a different lower image than the one it was written against. image-identity is overwritten without any event.

The same path also means a restart needs the registry even when the disk is already cached. rootfs_tar_path sandboxes already avoid this by reusing the persisted identity.

Impact / Why This Matters

A restarted sandbox can end up with a mixed root filesystem (for example a package database copied up from the old image next to the new image's libraries). The only workaround is pinning every image by digest at create time.

Proposed Design

Record the digest-pinned reference (repo@sha256:...) when the overlay is first prepared, and resolve that on restart instead of the tag. A cached, digest-pinned prepared disk is used without a registry call, the same rule the bootstrap cache follows since #4582. Sandboxes without a recorded pin behave as today. Local Docker/Podman images are out of scope.

Alternatives Considered

  • Reuse the persisted image-identity disk directly. This breaks after an upgrade, because the prepared-disk identity includes the OpenShell version.
  • Refuse to restart when the tag moved. Every stopped sandbox would fail after a routine image push.

Acceptance Criteria

  • A sandbox created from a registry tag restarts on the same digest after the tag moves.
  • A restart from a cached, pinned disk makes no registry request.
  • A pin for another repository, or one without a digest, is rejected.
  • Sandboxes without a pin are unchanged.

Activity

  1. added
    state:triage-needed
    on Dec 3, 2026
  2. 137137137 commented on Dec 3, 2026

    @137137137
    Author

    Fix is in ai-openshell/desktop#18, since the VM driver now lives there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions