Repository navigation
Conversation
3ff8b69 to
9c93bc8
Compare
|
Blocking issue: a failed add of a mounting module can leave the host path mounted in a running workspace even though the manifest rollback removes the module.
Please reconcile the container immediately after rollback so its mount set matches the restored manifest, and add a regression test that fails installation after the container is created and verifies the failed module mount is absent from the resulting container. |
A module.yml can now list `mounts` (host `source`, absolute or `~/`-relative, container `target`, `readOnly`, `optional`). They are bind-mounted only into the containers of the workspaces that have the module installed, unlike the global `extraMounts`, so access to a host path — e.g. a login shared with the host rather than copied — can be granted per workspace. The mounts are fingerprinted into OCM_MODULE_MOUNTS_SHA256, so the container is recreated when the set changes. AddModule records such a module before starting the container, so its install already sees the mounts (and rolls the entry back if it fails); RemoveModule recreates the container after the uninstall. Mount points in the workspace home are created on the host first. A module with mounts cannot set restartServer: false, since recreation interrupts a running task. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed add of a module with mounts rolled back the manifest but left the container it had recreated with the module's mounts running, so the workspace kept access to the host path until the next start. Reconcile the container with the restored manifest after the rollback, or stop it when that fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e205292 to
4551ab5
Compare
|
Thanks, fixed: after the manifest rollback, the container is now reconciled with the restored manifest right away, so it is recreated without the failed module's mounts (and stopped if that fails). Added a regression test that fails the install after the container is created and checks the mount is gone from the resulting container. Also rebased on main. |
Summary
A
module.ymlcan now declaremounts: host paths bind-mounted into the containers of the workspaces that have the module installed, and only those. The globalextraMountsapplies to every workspace; this lets access to a host path be granted per workspace from the module editor, e.g. sharing a host login rather than copying it throughresolve.Fields:
source(absolute, or~/-relative to the host home),target(absolute; not/or the workspace home),readOnly,optional(skip whilesourceis missing instead of failing the start; the mount is added on the first start after it appears).How it works
provisioncollects the mounts of the manifest's installed modules (installedModuleMounts) and records a fingerprint inOCM_MODULE_MOUNTS_SHA256, socontainerSpecDriftrecreates the container when the set changes. They are added before the self-improvement mounts, so its conflict check covers them.AddModulerecords a mounting module in the manifest before starting the container, so itsinstallalready sees the mounts; the entry is rolled back if the install fails.RemoveModulerecreates the container after theuninstall, so access ends right away.restartServer: false(rejected at load). The editor's idle guard then applies as for any restarting module.Tests / docs
internal/module: parsing,~/expansion, validation errors.internal/workspace: mounts only for installed modules, optional sources, fingerprint changes, mount point creation, required-source failure,AddModuleordering, drift cases.docs/writing-modules.mdgains a Mounts section;AGENTS.mddocuments the lifecycle.gofmt,go vet ./...andgo test ./...pass. Used with podman on NixOS through a fork build to share the host Claude Code login with selected workspaces.🤖 Generated with Claude Code