Skip to content

Provision ~/.openclaw/extensions as persistent volume instead of symlink (NemoClaw sandbox) #925

Closed as not planned

Description

@prekshivyas

Problem

OpenClaw's plugin install validator in install-safe-path.ts rejects symlinks as install bases:

const baseLstat = await fs.lstat(baseDir);
if (!baseLstat.isDirectory() || baseLstat.isSymbolicLink()) {
  throw new Error(`Invalid ${params.boundaryLabel}: base directory must be a real directory`);
}

NemoClaw's sandbox layout establishes ~/.openclaw/extensions as a symlink to /sandbox/.openclaw-data/extensions so installed plugins survive sandbox recreation (see NemoClaw/Dockerfile.base line 113). This is structurally incompatible with OpenClaw's validator.

Result: openclaw plugins install <anything> fails inside the sandbox with Invalid extensions directory: base directory must be a real directory. Tracked in NemoClaw as:

Proposed fix

Provision ~/.openclaw/extensions as a separately-mounted persistent volume at the pod-spec level, rather than as an intra-container symlink pointing to .openclaw-data/extensions.

  • Inside the container the path is a real directory — passes OpenClaw's validator.
  • Plugin persistence preserved (volume survives sandbox recreation).
  • No CAP_SYS_ADMIN needed in-container — mount is established by the orchestrator before the container starts.
  • Decouples the extensions persistence layer from OpenClaw's internal validation semantics; future OpenClaw validator changes won't re-break plugin install.

Alternatives considered

  • Intra-container bind mount. Needs CAP_SYS_ADMIN in the sandbox, which Docker's default capability set omits and granting would significantly expand the sandbox's privilege surface. Not preferred.
  • NemoClaw-side patch of compiled OpenClaw dist (swap fs.lstat → fs.stat in install-safe-path.js). Works as a short-term bridge but requires re-verification on every OpenClaw version bump and weakens a (defense-in-depth) TOCTOU check.
  • Upstream OpenClaw PR to accept symlinks-to-real-directories. Cleanest long-term but slowest, and unclear OpenClaw maintainers would accept the relaxation.

Suggested coordination

If pod-spec persistent-volume provisioning is feasible, NemoClaw would:

  • Stop creating the .openclaw-data/extensions → ~/.openclaw/extensions symlink in Dockerfile.base.
  • Rely on the OpenShell-provisioned mount to place the persistent directory at ~/.openclaw/extensions directly.

Happy to collaborate on the transition plan — migration path for existing sandboxes, volume naming, whether this is a one-off for extensions or a broader template for other persistent paths under ~/.openclaw/.

Activity

  1. johntmyers commented on Apr 22, 2026

    @johntmyers
    Contributor

    @prekshivyas what specific change are you asking for in OpenShell? Making a pod-spec pv isn't feasible here as that will be a specific deployment mode that isn't always used. We'll be deprecating K3s + Docker so you have to assume that k8s API is not always available.

  2. prekshivyas commented on Apr 22, 2026

    @prekshivyas
    ContributorAuthor

    Thanks for the information.

    Closing this as out-of-scope for OpenShell. The realistic fixes are both NemoClaw/OpenClaw-side: patching NemoClaw's build to rewrite install-safe-path.js (same pattern as the existing fetch-guard and exec-approvals patches in the Dockerfile), or upstreaming a fix to OpenClaw itself. Moving the conversation back to NemoClaw #2203 / #2295.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions