An open-source, faster Devin alternative
TypeScript
roll back persistent flag, unnecessary + teardown cause problems
Brian Reardon1fe0595a24b0
diff --git a/cmd/oc/internal/commands/mounts.go b/cmd/oc/internal/commands/mounts.goindex 355bc86a..7f9689f4 100644--- a/cmd/oc/internal/commands/mounts.go+++ b/cmd/oc/internal/commands/mounts.go@@ -10,16 +10,13 @@ import ("github.com/spf13/cobra")-// MountInfo mirrors internal/api.MountRecord — copied here to avoid an+// MountInfo mirrors internal/mounts.MountRecord — copied here to avoid an// internal-package import from the CLI binary.type MountInfo struct {- Path string `json:"path"`- Remote string `json:"remote"`- Backend string `json:"backend,omitempty"`- ReadOnly bool `json:"readOnly"`- Persistent bool `json:"persistent,omitempty"`- Status string `json:"status,omitempty"`- Error string `json:"error,omitempty"`+ Path string `json:"path"`+ Remote string `json:"remote"`+ Backend string `json:"backend,omitempty"`+ ReadOnly bool `json:"readOnly"`}var mountsCmd = &cobra.Command{@@ -45,7 +42,6 @@ var mountsAddCmd = &cobra.Command{credsFlag, _ := cmd.Flags().GetStringArray("cred")configFile, _ := cmd.Flags().GetString("config-file")readWrite, _ := cmd.Flags().GetBool("read-write")- persistent, _ := cmd.Flags().GetBool("persistent")extraOpts, _ := cmd.Flags().GetStringArray("opt")creds := map[string]string{}@@ -58,10 +54,9 @@ var mountsAddCmd = &cobra.Command{}body := map[string]any{- "path": path,- "remote": remote,- "readOnly": !readWrite,- "persistent": persistent,+ "path": path,+ "remote": remote,+ "readOnly": !readWrite,}if backend != "" {body["backend"] = backend@@ -90,11 +85,7 @@ var mountsAddCmd = &cobra.Command{if info.ReadOnly {ro = "ro"}- persist := ""- if info.Persistent {- persist = ", persistent"- }- fmt.Printf("Mounted %s → %s (%s%s)\n", info.Remote, info.Path, ro, persist)+ fmt.Printf("Mounted %s → %s (%s)\n", info.Remote, info.Path, ro)})return nil},@@ -117,25 +108,14 @@ var mountsListCmd = &cobra.Command{fmt.Println("No mounts.")return}- headers := []string{"PATH", "REMOTE", "BACKEND", "MODE", "PERSIST", "STATUS"}+ headers := []string{"PATH", "REMOTE", "BACKEND", "MODE"}var rows [][]stringfor _, m := range mounts {mode := "rw"if m.ReadOnly {mode = "ro"}- persist := "no"- if m.Persistent {- persist = "yes"- }- status := m.Status- if status == "" {- status = "active"- }- if m.Error != "" {- status = status + ": " + m.Error- }- rows = append(rows, []string{m.Path, m.Remote, m.Backend, mode, persist, status})+ rows = append(rows, []string{m.Path, m.Remote, m.Backend, mode})}printer.Table(headers, rows)})@@ -167,7 +147,6 @@ func init() {mountsAddCmd.Flags().StringArray("cred", nil, "Backend credential as key=value (repeatable; e.g. --cred access_key_id=AKIA...)")mountsAddCmd.Flags().String("config-file", "", "Path to a raw rclone config file (overrides --backend/--cred)")mountsAddCmd.Flags().Bool("read-write", false, "Mount read-write (default is read-only)")- mountsAddCmd.Flags().Bool("persistent", false, "Persist the (encrypted) config server-side so the mount auto-restores on wake")mountsAddCmd.Flags().StringArray("opt", nil, "Extra args appended to `rclone mount` (repeatable)")_ = mountsAddCmd.MarkFlagRequired("path")_ = mountsAddCmd.MarkFlagRequired("remote")diff --git a/cmd/worker/main.go b/cmd/worker/main.goindex 5cbd6340..63c58804 100644--- a/cmd/worker/main.go+++ b/cmd/worker/main.go@@ -614,7 +614,7 @@ func main() {}// HTTP server- httpServer := worker.NewHTTPServer(mgr, ptyMgr, execMgr, jwtIssuer, sandboxDBMgr, sbProxy, sbRouter, cfg.SandboxDomain, store)+ httpServer := worker.NewHTTPServer(mgr, ptyMgr, execMgr, jwtIssuer, sandboxDBMgr, sbProxy, sbRouter, cfg.SandboxDomain)httpAddr := fmt.Sprintf(":%d", cfg.Port)log.Printf("opensandbox-worker: starting HTTP server on %s", httpAddr)go func() {diff --git a/docs/sandboxes/mounts.mdx b/docs/sandboxes/mounts.mdxindex 55c36a2e..9a7f2a08 100644--- a/docs/sandboxes/mounts.mdx+++ b/docs/sandboxes/mounts.mdx@@ -214,80 +214,36 @@ await sandbox.mounts.remove("/mnt/data");## Hibernate behavior-By default, mounts do **not** survive hibernate. The mount is torn down in the-VM before the snapshot is taken (otherwise the snapshot would capture broken-file descriptors that hang processes on wake), and the server doesn't store-your credentials anywhere — they live only in the VM's tmpfs for the lifetime-of the mount.+Mounts survive hibernate/wake transparently. The VM snapshot captures the live+FUSE mount and the rclone daemon process; when the sandbox wakes, both are+restored as-is. No re-mount call needed — the mount is exactly where you left+it, with the same credentials, serving the same path.-If you want the mount to come back automatically, opt in with `persistent: true`:--<CodeGroup>--```typescript TypeScript-await sandbox.mounts.add({- path: "/mnt/data",- remote: "s3:my-bucket",- backend: "s3",- creds: {...},- persistent: true, // ← opt in-});-```+```typescript+await sandbox.mounts.add({ path: "/mnt/data", remote: "s3:my-bucket", backend: "s3", creds });-```python Python-await sandbox.mounts.add(- path="/mnt/data",- remote="s3:my-bucket",- backend="s3",- creds={...},- persistent=True,-)-```+await sandbox.hibernate();+await sandbox.wake();-```bash CLI-oc mounts add sb-abc123 \- --path /mnt/data --remote s3:my-bucket --backend s3 \- --cred access_key_id=... --cred secret_access_key=... \- --persistent+await sandbox.exec.run("ls /mnt/data"); // still works, no re-mount needed```-</CodeGroup>--With `persistent: true`:--- The rendered rclone config (which includes your creds) is encrypted with the- server's `OPENSANDBOX_SECRET_ENCRYPTION_KEY` and stored in PostgreSQL.-- On wake — explicit (`sandbox.wake()`) or auto-wake (when any operation hits a- hibernated sandbox) — the server replays each persistent mount in the- background.-- Wake completes immediately; mount replay doesn't block it. Inspect- `mounts.list()` to see the current state of each mount.--### Wake-time failures--If a persistent mount fails to replay (rotated creds, expired token, network-issue, deleted bucket, etc.), **the wake still succeeds** — we don't punish-your whole sandbox for one bad mount. The mount shows up in `list()` with the-failure surfaced:+When you want a mount gone, call `remove()` explicitly:```typescript-const mounts = await sandbox.mounts.list();-// [-// { path: "/mnt/data", remote: "s3:my-bucket", status: "active", persistent: true },-// { path: "/mnt/stale", remote: "s3:old-bucket", status: "failed", persistent: true,-// error: "rclone mount failed (exit 1): AccessDenied: ..." },-// ]+await sandbox.mounts.remove("/mnt/data");```-To recover, either `remove()` the broken mount or `add()` it again with fresh-creds (re-adding overwrites the prior spec).+That triggers an actual `fusermount3 -u` in the VM and drops the registry+entry. No magic teardown on hibernate.++### Stale credentials-<Note>- `persistent: true` requires the server to have `OPENSANDBOX_SECRET_ENCRYPTION_KEY`- configured (the same key already used for project secrets). On self-hosted- setups without this key, `persistent: true` returns a clear 503 — fall back to- non-persistent mounts and remount after wake.-</Note>+If the credentials behind a mount get rotated or revoked while the sandbox is+hibernated, the in-VM rclone daemon — restored intact from the snapshot — is+still holding the *old* keys and will start hitting auth errors on the next+request. Fix: `mounts.remove(path)` then `mounts.add(...)` again with fresh+credentials.## CLIdiff --git a/internal/api/router.go b/internal/api/router.goindex 62396fa1..5a60c576 100644--- a/internal/api/router.go+++ b/internal/api/router.go@@ -143,9 +143,7 @@ func NewServer(mgr sandbox.Manager, ptyMgr *sandbox.PTYManager, apiKey string, o// sandbox manager). In server mode the CP proxies to a worker, which// instantiates its own mounts.Service backed by its own manager.if mgr != nil {- // Store is nil until opts is processed below; the persistent-mount- // path will return ErrPersistenceUnavailable if it's missing then.- s.mountSvc = mounts.NewService(mgr, nil)+ s.mountSvc = mounts.NewService(mgr)}if opts != nil {@@ -165,21 +163,6 @@ func NewServer(mgr sandbox.Manager, ptyMgr *sandbox.PTYManager, apiKey string, os.execSessionManager = opts.ExecSessionManagers.sandboxDBs = opts.SandboxDBss.router = opts.Router- // Now that we have the store, upgrade the mount service so persistent- // mounts work. The earlier NewService(mgr, nil) was a placeholder for- // the no-store case.- if mgr != nil && s.store != nil {- s.mountSvc = mounts.NewService(mgr, s.store)- }- // Wire the post-auto-wake hook so persistent FUSE mounts are replayed- // when the router auto-wakes a hibernated sandbox on an incoming request.- // Explicit-wake API callers (POST /sandboxes/:id/wake) hit a separate- // path; that handler triggers replay directly.- if s.router != nil && s.mountSvc != nil {- s.router.SetOnWake(func(sandboxID string) {- s.mountSvc.OnWake(context.Background(), sandboxID)- })- }s.workerRegistry = opts.WorkerRegistrys.checkpointStore = opts.CheckpointStores.sandboxDomain = opts.SandboxDomaindiff --git a/internal/api/sandbox.go b/internal/api/sandbox.goindex aa6d820b..fe81f3ac 100644--- a/internal/api/sandbox.go+++ b/internal/api/sandbox.go@@ -1700,15 +1700,6 @@ func (s *Server) hibernateSandbox(c echo.Context) error {})}- // FUSE mounts are torn down in the VM by snapshot.go (`fusermount3 -u -a`- // before savevm). Drop non-persistent rows from the registry; persistent- // rows are kept with status="replaying" so list() reflects the intent- // across the hibernate→wake gap, and mounts.Service.OnWake will rebuild- // them when the sandbox is woken.- if s.mountSvc != nil {- s.mountSvc.OnHibernate(id)- }-// Mark hibernated in sandbox routerif s.router != nil {timeout := 600 // default for explicit hibernate@@ -1879,15 +1870,6 @@ func (s *Server) wakeSandbox(c echo.Context) error {// Apply pending checkpoint patches in backgroundgo s.applyPendingPatches(id, s.workerID)- // Replay any persistent FUSE mounts. Explicit wake doesn't flow through- // router.doWake (which is the auto-wake hook point), so we trigger replay- // directly here. Background context so the wake response isn't held up- // by remote-storage round-trips; failures show up in mounts.list() with- // status="failed" and the error.- if s.mountSvc != nil {- go s.mountSvc.OnWake(context.Background(), id)- }-// Issue fresh JWTorgID, _ := auth.GetOrgID(c)if s.jwtIssuer != nil {diff --git a/internal/api/sandbox_mounts.go b/internal/api/sandbox_mounts.goindex 7f2f2b2a..2206d9bd 100644--- a/internal/api/sandbox_mounts.go+++ b/internal/api/sandbox_mounts.go@@ -2,7 +2,6 @@ package apiimport ("context"- "errors""net/http""github.com/labstack/echo/v4"@@ -30,11 +29,7 @@ func (s *Server) addMount(c echo.Context) error {return err}if err := s.routeOrCall(c, id, "mountAdd", routeOp); err != nil {- status := http.StatusInternalServerError- if errors.Is(err, mounts.ErrPersistenceUnavailable) {- status = http.StatusServiceUnavailable- }- return c.JSON(status, map[string]string{"error": err.Error()})+ return c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})}return c.JSON(http.StatusCreated, rec)}diff --git a/internal/db/sandbox_mounts.go b/internal/db/sandbox_mounts.godeleted file mode 100644index 3e85dbc5..00000000--- a/internal/db/sandbox_mounts.go+++ /dev/null@@ -1,124 +0,0 @@-package db--import (- "context"- "encoding/json"- "fmt"-- "github.com/jackc/pgx/v5"-)--// PersistentMount is one row of sandbox_mounts. The rclone config is stored-// encrypted on disk; callers receive the still-encrypted bytes and decrypt-// via Store.Encryptor() when they actually need to render the config (typically-// during wake-time replay).-type PersistentMount struct {- SandboxID string- Path string- Remote string- Backend string- ReadOnly bool- MountOptions []string- EncryptedConfig []byte- LastError string-}--// UpsertSandboxMount creates or replaces a persistent mount row. Re-issuing-// `mounts.add()` against the same path overwrites the prior spec; this matches-// the in-memory registry's put-with-same-path semantics.-func (s *Store) UpsertSandboxMount(ctx context.Context, m PersistentMount) error {- opts, err := json.Marshal(m.MountOptions)- if err != nil {- return fmt.Errorf("marshal mount options: %w", err)- }- if len(opts) == 0 || string(opts) == "null" {- opts = []byte("[]")- }- _, err = s.pool.Exec(ctx, `- INSERT INTO sandbox_mounts (sandbox_id, path, remote, backend, read_only, mount_options, encrypted_config, last_error)- VALUES ($1, $2, $3, $4, $5, $6, $7, '')- ON CONFLICT (sandbox_id, path) DO UPDATE SET- remote = EXCLUDED.remote,- backend = EXCLUDED.backend,- read_only = EXCLUDED.read_only,- mount_options = EXCLUDED.mount_options,- encrypted_config = EXCLUDED.encrypted_config,- last_error = '',- updated_at = now()- `, m.SandboxID, m.Path, m.Remote, m.Backend, m.ReadOnly, opts, m.EncryptedConfig)- if err != nil {- return fmt.Errorf("upsert mount %s/%s: %w", m.SandboxID, m.Path, err)- }- return nil-}--// DeleteSandboxMount removes a single mount row by (sandbox_id, path). Returns-// nil even when no row matches — `mounts.remove()` is idempotent.-func (s *Store) DeleteSandboxMount(ctx context.Context, sandboxID, path string) error {- _, err := s.pool.Exec(ctx, `- DELETE FROM sandbox_mounts WHERE sandbox_id = $1 AND path = $2- `, sandboxID, path)- if err != nil {- return fmt.Errorf("delete mount %s/%s: %w", sandboxID, path, err)- }- return nil-}--// DeleteSandboxMounts wipes every mount row for a sandbox (used on sandbox kill).-func (s *Store) DeleteSandboxMounts(ctx context.Context, sandboxID string) error {- _, err := s.pool.Exec(ctx, `DELETE FROM sandbox_mounts WHERE sandbox_id = $1`, sandboxID)- if err != nil {- return fmt.Errorf("delete mounts for %s: %w", sandboxID, err)- }- return nil-}--// ListSandboxMounts returns all persistent mounts attached to a sandbox.-// Returns an empty slice (not nil) when the sandbox has no rows so callers can-// safely range without a nil check.-func (s *Store) ListSandboxMounts(ctx context.Context, sandboxID string) ([]PersistentMount, error) {- rows, err := s.pool.Query(ctx, `- SELECT sandbox_id, path, remote, backend, read_only, mount_options, encrypted_config, last_error- FROM sandbox_mounts- WHERE sandbox_id = $1- ORDER BY path- `, sandboxID)- if err != nil {- return nil, fmt.Errorf("list mounts for %s: %w", sandboxID, err)- }- defer rows.Close()-- out := []PersistentMount{}- for rows.Next() {- var m PersistentMount- var optsJSON []byte- if err := rows.Scan(&m.SandboxID, &m.Path, &m.Remote, &m.Backend, &m.ReadOnly, &optsJSON, &m.EncryptedConfig, &m.LastError); err != nil {- return nil, fmt.Errorf("scan mount row: %w", err)- }- if len(optsJSON) > 0 && string(optsJSON) != "null" {- if err := json.Unmarshal(optsJSON, &m.MountOptions); err != nil {- return nil, fmt.Errorf("unmarshal mount options for %s/%s: %w", m.SandboxID, m.Path, err)- }- }- out = append(out, m)- }- if err := rows.Err(); err != nil && err != pgx.ErrNoRows {- return nil, fmt.Errorf("iterate mount rows: %w", err)- }- return out, nil-}--// SetSandboxMountError records (or clears) the wake-time replay error for a-// mount. Passing an empty string clears the error, used after a successful-// replay or on a fresh upsert.-func (s *Store) SetSandboxMountError(ctx context.Context, sandboxID, path, errMsg string) error {- _, err := s.pool.Exec(ctx, `- UPDATE sandbox_mounts- SET last_error = $3, updated_at = now()- WHERE sandbox_id = $1 AND path = $2- `, sandboxID, path, errMsg)- if err != nil {- return fmt.Errorf("set mount error for %s/%s: %w", sandboxID, path, err)- }- return nil-}diff --git a/internal/db/sandbox_mounts_pgfixture_test.go b/internal/db/sandbox_mounts_pgfixture_test.godeleted file mode 100644index 23552d42..00000000--- a/internal/db/sandbox_mounts_pgfixture_test.go+++ /dev/null@@ -1,196 +0,0 @@-//go:build pgfixture--// Integration tests for the persistent-mount Store methods. Run only under-// `go test -tags=pgfixture` against a real Postgres pointed at by-// TEST_DATABASE_URL. The schema (UPSERT semantics, JSONB round-tripping,-// composite primary key) is what makes these worth running against actual PG-// rather than mocked.-//-// Run locally:-//-// TEST_DATABASE_URL=postgres://user:pass@localhost:5432/dbname?sslmode=disable \-// go test -tags=pgfixture ./internal/db/ -run Mount -v-package db--import (- "bytes"- "context"- "reflect"- "sort"- "testing"-)--func TestSandboxMounts_UpsertListDelete_pgfixture(t *testing.T) {- ctx := context.Background()- store := openPgStore(t)-- sb := "sb-mounts-test-1"- t.Cleanup(func() { _ = store.DeleteSandboxMounts(ctx, sb) })-- m1 := PersistentMount{- SandboxID: sb,- Path: "/mnt/data",- Remote: "s3:my-bucket",- Backend: "s3",- ReadOnly: true,- MountOptions: []string{"--vfs-cache-mode", "writes"},- EncryptedConfig: []byte{0x01, 0x02, 0x03},- }- m2 := PersistentMount{- SandboxID: sb,- Path: "/mnt/other",- Remote: "gcs:bucket-2",- Backend: "gcs",- ReadOnly: false,- MountOptions: nil,- EncryptedConfig: []byte{0xff, 0xfe},- }-- if err := store.UpsertSandboxMount(ctx, m1); err != nil {- t.Fatalf("upsert m1: %v", err)- }- if err := store.UpsertSandboxMount(ctx, m2); err != nil {- t.Fatalf("upsert m2: %v", err)- }-- got, err := store.ListSandboxMounts(ctx, sb)- if err != nil {- t.Fatalf("list: %v", err)- }- if len(got) != 2 {- t.Fatalf("expected 2 rows, got %d: %+v", len(got), got)- }- // Order by path so the assertion is stable.- sort.Slice(got, func(i, j int) bool { return got[i].Path < got[j].Path })-- // JSONB round-trip: nil MountOptions on insert should come back as nil OR- // empty slice — accept either, but both should be empty.- if len(got[1].MountOptions) != 0 {- t.Errorf("m2 expected empty MountOptions after round-trip, got %v", got[1].MountOptions)- }- if !reflect.DeepEqual(got[0].MountOptions, m1.MountOptions) {- t.Errorf("m1 MountOptions round-trip: got %v want %v", got[0].MountOptions, m1.MountOptions)- }- if !bytes.Equal(got[0].EncryptedConfig, m1.EncryptedConfig) {- t.Errorf("m1 encrypted blob round-trip differs")- }- if got[0].LastError != "" {- t.Errorf("m1 LastError should be empty after upsert, got %q", got[0].LastError)- }-- // UPSERT: re-insert m1 with different remote should overwrite, not duplicate.- m1b := m1- m1b.Remote = "s3:my-bucket-renamed"- m1b.EncryptedConfig = []byte{0xaa, 0xbb}- // Pre-poison last_error to confirm UPSERT clears it.- if err := store.SetSandboxMountError(ctx, sb, m1.Path, "stale error"); err != nil {- t.Fatalf("set error: %v", err)- }- if err := store.UpsertSandboxMount(ctx, m1b); err != nil {- t.Fatalf("re-upsert m1: %v", err)- }- got, err = store.ListSandboxMounts(ctx, sb)- if err != nil {- t.Fatalf("list 2: %v", err)- }- if len(got) != 2 {- t.Fatalf("UPSERT should not duplicate; got %d rows", len(got))- }- sort.Slice(got, func(i, j int) bool { return got[i].Path < got[j].Path })- if got[0].Remote != "s3:my-bucket-renamed" {- t.Errorf("re-upsert didn't update Remote: got %q", got[0].Remote)- }- if !bytes.Equal(got[0].EncryptedConfig, m1b.EncryptedConfig) {- t.Errorf("re-upsert didn't update EncryptedConfig")- }- if got[0].LastError != "" {- t.Errorf("UPSERT must clear last_error (incident-resilience); got %q", got[0].LastError)- }-- // Single delete.- if err := store.DeleteSandboxMount(ctx, sb, m1.Path); err != nil {- t.Fatalf("delete m1: %v", err)- }- got, err = store.ListSandboxMounts(ctx, sb)- if err != nil {- t.Fatalf("list 3: %v", err)- }- if len(got) != 1 || got[0].Path != m2.Path {- t.Errorf("after deleting m1, expected only m2; got %+v", got)- }-- // Idempotent delete on missing row.- if err := store.DeleteSandboxMount(ctx, sb, "/nope"); err != nil {- t.Errorf("delete of missing row should be idempotent; got %v", err)- }-- // Bulk delete.- if err := store.DeleteSandboxMounts(ctx, sb); err != nil {- t.Fatalf("bulk delete: %v", err)- }- got, err = store.ListSandboxMounts(ctx, sb)- if err != nil {- t.Fatalf("list 4: %v", err)- }- if len(got) != 0 {- t.Errorf("bulk delete left rows: %+v", got)- }-}--func TestSandboxMounts_SetSandboxMountError_pgfixture(t *testing.T) {- ctx := context.Background()- store := openPgStore(t)-- sb := "sb-mounts-test-2"- t.Cleanup(func() { _ = store.DeleteSandboxMounts(ctx, sb) })-- m := PersistentMount{- SandboxID: sb,- Path: "/mnt/data",- Remote: "s3:bucket",- Backend: "s3",- ReadOnly: true,- EncryptedConfig: []byte{0x01},- }- if err := store.UpsertSandboxMount(ctx, m); err != nil {- t.Fatalf("upsert: %v", err)- }-- if err := store.SetSandboxMountError(ctx, sb, m.Path, "AccessDenied"); err != nil {- t.Fatalf("set error: %v", err)- }- got, _ := store.ListSandboxMounts(ctx, sb)- if len(got) != 1 || got[0].LastError != "AccessDenied" {- t.Errorf("SetSandboxMountError didn't take effect: %+v", got)- }-- // Clearing the error (empty string) is the post-successful-replay path.- if err := store.SetSandboxMountError(ctx, sb, m.Path, ""); err != nil {- t.Fatalf("clear error: %v", err)- }- got, _ = store.ListSandboxMounts(ctx, sb)- if len(got) != 1 || got[0].LastError != "" {- t.Errorf("clearing error didn't take effect: %+v", got)- }-- // SetSandboxMountError on a missing (sandbox_id, path) is a no-op,- // not an error — keeps the wake-time replay path lock-free.- if err := store.SetSandboxMountError(ctx, sb, "/does-not-exist", "x"); err != nil {- t.Errorf("SetSandboxMountError on missing row should not error; got %v", err)- }-}--func TestSandboxMounts_ListEmptyReturnsEmptySlice_pgfixture(t *testing.T) {- ctx := context.Background()- store := openPgStore(t)- got, err := store.ListSandboxMounts(ctx, "sb-never-existed")- if err != nil {- t.Fatalf("list on unknown sandbox: %v", err)- }- if got == nil {- t.Errorf("ListSandboxMounts should return non-nil empty slice, got nil")- }- if len(got) != 0 {- t.Errorf("expected empty slice, got %+v", got)- }-}diff --git a/internal/mounts/render_test.go b/internal/mounts/render_test.goindex 5df9ac08..e099995f 100644--- a/internal/mounts/render_test.go+++ b/internal/mounts/render_test.go@@ -150,67 +150,6 @@ func TestMountConfPath_DeterministicAndSafe(t *testing.T) {}}-func TestRemoteFromConfig(t *testing.T) {- cases := []struct {- name string- conf string- want string- }{- {"single section", "[s3]\ntype = s3\n", "s3"},- {"leading whitespace", " [gcs] \ntype = google cloud storage\n", "gcs"},- {"comment first then section", "# header comment\n[box]\ntype = box\n", "box"},- {"empty config", "", ""},- {"no section header", "type = s3\naccess_key_id = x\n", ""},- {"first section wins", "[a]\ntype = s3\n[b]\ntype = sftp\n", "a"},- }- for _, tc := range cases {- t.Run(tc.name, func(t *testing.T) {- if got := remoteFromConfig(tc.conf); got != tc.want {- t.Errorf("remoteFromConfig(%q) = %q, want %q", tc.conf, got, tc.want)- }- })- }-}--func TestMountRegistry_ClearNonPersistent(t *testing.T) {- r := newRegistry()- // Mix of persistent + non-persistent for the same sandbox.- r.put("sb-1", MountRecord{Path: "/mnt/ephemeral", Remote: "s3:eph", Status: "active"})- r.put("sb-1", MountRecord{Path: "/mnt/durable", Remote: "s3:dur", Persistent: true, Status: "active"})- r.put("sb-1", MountRecord{Path: "/mnt/durable2", Remote: "s3:dur2", Persistent: true, Status: "active"})- r.put("sb-2", MountRecord{Path: "/mnt/x", Remote: "s3:x", Status: "active"})-- r.clearNonPersistent("sb-1")-- got := r.get("sb-1")- if len(got) != 2 {- t.Fatalf("expected 2 persistent entries to remain on sb-1, got %d: %v", len(got), got)- }- for _, rec := range got {- if !rec.Persistent {- t.Errorf("non-persistent record leaked through clearNonPersistent: %+v", rec)- }- if rec.Status != "replaying" {- t.Errorf("persistent record status after clearNonPersistent want %q got %q", "replaying", rec.Status)- }- }-- // Other sandboxes untouched.- if got := r.get("sb-2"); len(got) != 1 {- t.Errorf("clearNonPersistent leaked into other sandbox: %v", got)- }-}--func TestMountRegistry_ClearNonPersistent_AllNonPersistent(t *testing.T) {- r := newRegistry()- r.put("sb-1", MountRecord{Path: "/mnt/a", Status: "active"})- r.put("sb-1", MountRecord{Path: "/mnt/b", Status: "active"})- r.clearNonPersistent("sb-1")- if got := r.get("sb-1"); got != nil {- t.Errorf("clearNonPersistent with no persistent entries should drop the sandbox; got %v", got)- }-}-func TestMountRegistry_PutListRemove(t *testing.T) {r := newRegistry()r.put("sb-1", MountRecord{Path: "/mnt/a", Remote: "s3:a", Backend: "s3", ReadOnly: true})@@ -253,11 +192,4 @@ func TestMountRegistry_PutListRemove(t *testing.T) {if got := r.get("sb-1"); got != nil {t.Errorf("after removing last entry, expected nil, got %v", got)}-- // clearNonPersistent() drops all non-persistent entries (in this test, all- // of sb-2's entries are non-persistent).- r.clearNonPersistent("sb-2")- if got := r.get("sb-2"); got != nil {- t.Errorf("after clearNonPersistent, expected nil, got %v", got)- }}diff --git a/internal/mounts/service.go b/internal/mounts/service.goindex 32e745bf..325945c8 100644--- a/internal/mounts/service.go+++ b/internal/mounts/service.go@@ -1,13 +1,13 @@// Package mounts implements rclone-backed FUSE mounts inside a sandbox.//-// Two callers wire this into HTTP layers:+// Wired into two HTTP layers — internal/api (combined mode) and internal/worker+// (server mode) — both delegating to the same Service so behavior is identical+// regardless of which path reached the worker that owns the sandbox.//-// - internal/api — combined-mode CP, where the same process hosts sandboxes-// - internal/worker — the worker that owns the sandbox in server mode (the-// CP proxies /api/sandboxes/:id/mounts here)-//-// Both call the same Service so behavior is identical regardless of which-// route the request took to reach the worker that actually owns the sandbox.+// Lifecycle note: mounts survive hibernate/wake naturally because savevm+// captures the live FUSE kernel state AND the rclone daemon process; loadvm+// restores both. The platform does the work for us. Callers explicitly+// remove a mount via Service.Remove when they want it gone.package mountsimport (@@ -15,32 +15,22 @@ import ("crypto/sha1""encoding/hex""fmt"- "log""sort""strings""sync"- "github.com/opensandbox/opensandbox/internal/db""github.com/opensandbox/opensandbox/internal/sandbox""github.com/opensandbox/opensandbox/pkg/types")-// MountRecord describes one rclone-backed FUSE mount inside a sandbox. For-// non-persistent mounts, the in-memory Registry is the only place it lives;-// for persistent mounts, a parallel row exists in the sandbox_mounts PG table.-//-// Status is one of:-// - "active" — mounted and serving I/O-// - "replaying" — wake-time remount in progress (persistent only)-// - "failed" — wake-time remount failed; Error is set (persistent only)+// MountRecord describes one rclone-backed FUSE mount inside a sandbox.+// Process-local — tracks what was added via this worker. Credentials are+// not stored anywhere outside the in-VM tmpfs config file.type MountRecord struct {- Path string `json:"path"`- Remote string `json:"remote"`- Backend string `json:"backend,omitempty"`- ReadOnly bool `json:"readOnly"`- Persistent bool `json:"persistent,omitempty"`- Status string `json:"status,omitempty"`- Error string `json:"error,omitempty"`+ Path string `json:"path"`+ Remote string `json:"remote"`+ Backend string `json:"backend,omitempty"`+ ReadOnly bool `json:"readOnly"`}// AddRequest is the wire shape the HTTP layer parses and hands to Service.Add.@@ -51,39 +41,27 @@ type AddRequest struct {Creds map[string]string `json:"creds"` // backend-specific config keysRcloneConfig string `json:"rcloneConfig"` // raw config; overrides backend+credsReadOnly *bool `json:"readOnly"` // default true- Persistent bool `json:"persistent"` // encrypt + persist in PG; auto-restore on wakeMountOptions []string `json:"mountOptions"` // extra args appended to `rclone mount`}-// Service holds the cross-cutting state for the mounts feature.-//-// Registry is process-local and intentionally so: non-persistent mounts vanish-// on hibernate by design, and persistent mounts are rehydrated from PG on wake.-// Store is optional — when nil, persistent mounts are unavailable (Add returns-// a clear ErrPersistenceUnavailable).+// Service is the rclone-mount orchestrator. Process-local Registry tracks+// what we know about; no persistence, no encryption — savevm/loadvm captures+// and restores live mounts intrinsically.type Service struct {manager sandbox.Manager- store *db.Storeregistry *Registry}-// ErrPersistenceUnavailable is returned by Service.Add when the caller passes-// Persistent:true but the server has no Store / no encryption key.-var ErrPersistenceUnavailable = fmt.Errorf("persistent mounts require OPENSANDBOX_SECRET_ENCRYPTION_KEY to be configured")--// NewService wires a Service. Pass nil for store when persistent mounts aren't-// supported in this binary (e.g. local dev without PG).-func NewService(manager sandbox.Manager, store *db.Store) *Service {+// NewService wires a Service.+func NewService(manager sandbox.Manager) *Service {return &Service{manager: manager,- store: store,registry: newRegistry(),}}// List returns the current view of mounts the worker knows about for this-// sandbox. Non-nil empty slice when there are none, so HTTP handlers can-// marshal directly.+// sandbox. Non-nil empty slice when there are none.func (s *Service) List(sandboxID string) []MountRecord {recs := s.registry.get(sandboxID)if recs == nil {@@ -92,13 +70,8 @@ func (s *Service) List(sandboxID string) []MountRecord {return recs}-// Add validates the request, performs the live mount in the sandbox, records-// the in-memory entry, and (when Persistent) encrypts + persists the config so-// it survives hibernate.-//-// On rollback paths (persist failure after a successful live mount), Add tears-// down the live mount so the user view is consistent — no "persistent in name-// only" footgun.+// Add validates the request, performs the live mount in the sandbox, and+// records the in-memory entry.func (s *Service) Add(ctx context.Context, sandboxID string, req AddRequest) (MountRecord, error) {if req.Path == "" || req.Remote == "" {return MountRecord{}, fmt.Errorf("path and remote are required")@@ -106,11 +79,6 @@ func (s *Service) Add(ctx context.Context, sandboxID string, req AddRequest) (Moif !strings.HasPrefix(req.Path, "/") {return MountRecord{}, fmt.Errorf("path must be absolute")}- if req.Persistent {- if s.store == nil || s.store.Encryptor() == nil {- return MountRecord{}, ErrPersistenceUnavailable- }- }rcloneConf, err := renderRcloneConfig(req)if err != nil {@@ -126,133 +94,25 @@ func (s *Service) Add(ctx context.Context, sandboxID string, req AddRequest) (Mo}rec := MountRecord{- Path: req.Path,- Remote: req.Remote,- Backend: req.Backend,- ReadOnly: readOnly,- Persistent: req.Persistent,- Status: "active",+ Path: req.Path,+ Remote: req.Remote,+ Backend: req.Backend,+ ReadOnly: readOnly,}s.registry.put(sandboxID, rec)-- if req.Persistent {- ct, err := s.store.Encryptor().Encrypt([]byte(rcloneConf))- if err != nil {- s.rollbackLiveMount(ctx, sandboxID, req.Path)- return MountRecord{}, fmt.Errorf("encrypt mount config: %w", err)- }- if err := s.store.UpsertSandboxMount(ctx, db.PersistentMount{- SandboxID: sandboxID,- Path: req.Path,- Remote: req.Remote,- Backend: req.Backend,- ReadOnly: readOnly,- MountOptions: req.MountOptions,- EncryptedConfig: ct,- }); err != nil {- s.rollbackLiveMount(ctx, sandboxID, req.Path)- return MountRecord{}, fmt.Errorf("persist mount: %w", err)- }- }return rec, nil}// Remove unmounts and forgets the mount. Idempotent — no error when the path-// isn't mounted. Always best-effort PG delete (no error if the row never existed).+// isn't currently mounted.func (s *Service) Remove(ctx context.Context, sandboxID, path string) error {if err := s.unmountInVM(ctx, sandboxID, path); err != nil {return err}s.registry.remove(sandboxID, path)- if s.store != nil {- if err := s.store.DeleteSandboxMount(ctx, sandboxID, path); err != nil {- log.Printf("mounts: failed to delete persistent mount row %s/%s: %v", sandboxID, path, err)- }- }return nil}-// OnHibernate clears the non-persistent entries from the registry so list()-// reflects reality post-hibernate. Persistent entries stay (status flips to-// "replaying") so the UI shows the intent across the hibernate→wake gap.-//-// Call this from the same place that triggers `fusermount3 -u -a` in the VM-// (snapshot.go does the in-VM teardown; this is the registry-side complement).-func (s *Service) OnHibernate(sandboxID string) {- s.registry.clearNonPersistent(sandboxID)-}--// OnWake is the SandboxRouter post-wake hook. Reads persistent mounts from-// PG, pre-populates the registry with status="replaying", and replays each-// mount in its own goroutine.-//-// Wake completion is NOT blocked on replay; failures surface as-// status="failed" in list() and last_error in PG. The user can remove the-// broken mount or re-add with fresh creds.-func (s *Service) OnWake(ctx context.Context, sandboxID string) {- if s.store == nil || s.store.Encryptor() == nil {- return- }- mounts, err := s.store.ListSandboxMounts(ctx, sandboxID)- if err != nil {- log.Printf("mounts: list persistent mounts for %s: %v", sandboxID, err)- return- }- for _, m := range mounts {- s.registry.put(sandboxID, MountRecord{- Path: m.Path,- Remote: m.Remote,- Backend: m.Backend,- ReadOnly: m.ReadOnly,- Persistent: true,- Status: "replaying",- })- go s.replayOne(sandboxID, m)- }-}--func (s *Service) replayOne(sandboxID string, m db.PersistentMount) {- // Background context — wake replay must not be tied to whatever request- // originally triggered the wake (it may have ended already).- ctx := context.Background()- plaintext, err := s.store.Encryptor().Decrypt(m.EncryptedConfig)- if err != nil {- s.markFailed(ctx, sandboxID, m, fmt.Sprintf("decrypt config: %v", err))- return- }- if err := s.doMount(ctx, sandboxID, m.Path, m.Remote, string(plaintext), m.ReadOnly, m.MountOptions); err != nil {- s.markFailed(ctx, sandboxID, m, err.Error())- return- }- s.markActive(ctx, sandboxID, m)-}--func (s *Service) markActive(ctx context.Context, sandboxID string, m db.PersistentMount) {- s.registry.put(sandboxID, MountRecord{- Path: m.Path, Remote: m.Remote, Backend: m.Backend, ReadOnly: m.ReadOnly,- Persistent: true, Status: "active",- })- if s.store != nil {- _ = s.store.SetSandboxMountError(ctx, sandboxID, m.Path, "")- }-}--func (s *Service) markFailed(ctx context.Context, sandboxID string, m db.PersistentMount, msg string) {- log.Printf("mounts: persistent replay failed for %s/%s: %s", sandboxID, m.Path, msg)- s.registry.put(sandboxID, MountRecord{- Path: m.Path, Remote: m.Remote, Backend: m.Backend, ReadOnly: m.ReadOnly,- Persistent: true, Status: "failed", Error: msg,- })- if s.store != nil {- _ = s.store.SetSandboxMountError(ctx, sandboxID, m.Path, msg)- }-}--func (s *Service) rollbackLiveMount(ctx context.Context, sandboxID, path string) {- _ = s.unmountInVM(ctx, sandboxID, path)- s.registry.remove(sandboxID, path)-}-// doMount is the shared orchestration: probe rclone is present, write the// config to tmpfs, mkdir the target, exec `rclone mount --daemon`.//@@ -311,11 +171,8 @@ func (s *Service) doMount(ctx context.Context, sandboxID, target, remote, rclone"rclone", "mount", remote, target,"--config", confPath,"--daemon",- // --daemon waits for "mount ready" before forking; without a timeout, an- // unreachable remote makes the call hang indefinitely (rclone's default- // is "wait forever"). Cap at 30s so bad creds / network issues surface- // as a clear error in the API response instead of an HTTP 524 from the- // upstream proxy timeout.+ // Cap how long rclone waits for "mount ready" before forking; without+ // a timeout, an unreachable remote makes the call hang indefinitely."--daemon-timeout", "30s","--allow-other",}@@ -413,25 +270,7 @@ func (r *Registry) get(sandboxID string) []MountRecord {return out}-func (r *Registry) clearNonPersistent(sandboxID string) {- r.mu.Lock()- defer r.mu.Unlock()- cur := r.m[sandboxID]- out := cur[:0]- for _, rec := range cur {- if rec.Persistent {- rec.Status = "replaying"- out = append(out, rec)- }- }- if len(out) == 0 {- delete(r.m, sandboxID)- } else {- r.m[sandboxID] = out- }-}--// --- Helpers (exported because tests in other packages exercise them) ---+// --- Helpers ---// MountConfPath derives a deterministic tmpfs path for the mount's rclone// config. Hashing the target path means add→remove for the same mount path@@ -443,24 +282,8 @@ func mountConfPath(path string) string {return "/run/oc-agent/mounts/" + hex.EncodeToString(sum[:])[:16] + ".conf"}-// RemoteFromConfig extracts the first `[section]` name from a rclone config.-// rclone mount takes that name as the `<remote>:<path>` prefix on the command-// line, so we need it before invoking the mount.-func RemoteFromConfig(conf string) string { return remoteFromConfig(conf) }--func remoteFromConfig(conf string) string {- for _, line := range strings.Split(conf, "\n") {- line = strings.TrimSpace(line)- if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {- return strings.TrimSuffix(strings.TrimPrefix(line, "["), "]")- }- }- return ""-}-// RenderRcloneConfig builds a single-section rclone config from the typed// backend+creds shape, or returns the raw user-supplied config if present.-// Stable key order so config rendering is deterministic.func RenderRcloneConfig(req AddRequest) (string, error) { return renderRcloneConfig(req) }func renderRcloneConfig(req AddRequest) (string, error) {diff --git a/internal/qemu/snapshot.go b/internal/qemu/snapshot.goindex bb3c40de..57c9bd74 100644--- a/internal/qemu/snapshot.go+++ b/internal/qemu/snapshot.go@@ -76,20 +76,15 @@ func (m *Manager) doHibernate(ctx context.Context, vm *VMInstance, checkpointSto// failure → kernel panic loop). Bubble the error up so the API caller// gets a clear refusal instead of a silently-corrupted sandbox.if vm.agent != nil {- // Tear down any FUSE mounts before savevm so the snapshot doesn't- // capture broken file descriptors / hung kernel threads waiting on a- // FUSE daemon that won't exist on wake. Best-effort and idempotent:- // fusermount3 -u -a is a no-op when there are no FUSE mounts, and the- // `|| true` belt-and-braces means a partial failure can't block- // hibernate. v1 does not auto-restore mounts on wake; callers re-issue.- umountCtx, umountCancel := context.WithTimeout(ctx, 5*time.Second)- _, _ = vm.agent.Exec(umountCtx, &pb.ExecRequest{- Command: "/bin/sh",- Args: []string{"-c", "fusermount3 -u -a 2>/dev/null || true"},- RunAsRoot: true,- })- umountCancel()-+ // FUSE mounts intentionally are NOT torn down before savevm —+ // loadvm restores them along with the rest of VM memory (including+ // the rclone daemons), so mounts naturally survive hibernate/wake.+ // Two earlier attempts at pre-savevm teardown both wedged the wake+ // path: `pkill -KILL rclone` captured zombie state that loadvm+ // couldn't recover; `fusermount3 -u -z` alone left the in-VM agent+ // unreachable post-loadvm. The "mounts come back on wake" behavior+ // turned out to be the right product semantics anyway — callers can+ // explicitly `mounts.remove` when they want a mount gone.if err := quiesceAndCloseAgent(ctx, vm.agent); err != nil {log.Printf("qemu: hibernate %s: refusing savevm — %v", vm.ID, err)return nil, fmt.Errorf("hibernate %s: %w", vm.ID, err)diff --git a/internal/sandbox/router.go b/internal/sandbox/router.goindex 2839ce42..76b1aa8e 100644--- a/internal/sandbox/router.go+++ b/internal/sandbox/router.go@@ -63,14 +63,6 @@ type RouterConfig struct {DefaultTimeout time.DurationOnHibernate func(sandboxID string, result *HibernateResult)OnKill func(sandboxID string) // called when a sandbox is killed on timeout (hibernate failed or no checkpoint store)- // OnWake fires after an auto-wake completes successfully (state transitioned- // to StateRunning, rolling timer started). Runs in its own goroutine so a- // slow callback can't stall the routed operation that triggered the wake.- // Use SetOnWake to attach late if you can't supply it at construction time- // (e.g. circular dep between router and API server). Explicit-wake API- // callers do NOT flow through doWake, so they must invoke their own- // post-wake logic — see api.Server.wakeSandbox.- OnWake func(sandboxID string)}// SandboxRouter routes sandbox interactions through a state machine,@@ -86,7 +78,6 @@ type SandboxRouter struct {defaultTimeout time.DurationonHibernate func(sandboxID string, result *HibernateResult)onKill func(sandboxID string)- onWake func(sandboxID string)mu sync.RWMutexsandboxes map[string]*sandboxEntry@@ -106,21 +97,10 @@ func NewSandboxRouter(cfg RouterConfig) *SandboxRouter {defaultTimeout: dt,onHibernate: cfg.OnHibernate,onKill: cfg.OnKill,- onWake: cfg.OnWake,sandboxes: make(map[string]*sandboxEntry),}}-// SetOnWake attaches (or replaces) the post-auto-wake callback after-// construction. Useful when the consumer of the hook (e.g. the API server)-// can't be passed into RouterConfig because of a construction-order or-// circular-dependency issue.-func (r *SandboxRouter) SetOnWake(fn func(sandboxID string)) {- r.mu.Lock()- defer r.mu.Unlock()- r.onWake = fn-}-// Use registers middleware that wraps every routed operation.// Middleware is applied in the order registered (first registered = outermost).func (r *SandboxRouter) Use(mw Middleware) {@@ -507,17 +487,6 @@ func (r *SandboxRouter) doWake(ctx context.Context, sandboxID string, entry *san})}entry.mu.Unlock()-- // Fire post-wake hook in its own goroutine — a slow user-supplied callback- // (e.g. persistent mount replay that talks to S3) must not stall the- // routed operation that triggered the auto-wake. Read the field under the- // router mutex because SetOnWake can re-bind it.- r.mu.RLock()- hook := r.onWake- r.mu.RUnlock()- if hook != nil {- go hook(sandboxID)- }}// resetTimeout resets the rolling timeout for a sandbox.diff --git a/internal/worker/http_server.go b/internal/worker/http_server.goindex 30d36399..2d9d0eb2 100644--- a/internal/worker/http_server.go+++ b/internal/worker/http_server.go@@ -1,13 +1,11 @@package workerimport (- "context""net/http""github.com/labstack/echo/v4""github.com/labstack/echo/v4/middleware""github.com/opensandbox/opensandbox/internal/auth"- "github.com/opensandbox/opensandbox/internal/db""github.com/opensandbox/opensandbox/internal/mounts""github.com/opensandbox/opensandbox/internal/observability""github.com/opensandbox/opensandbox/internal/obslog"@@ -30,9 +28,7 @@ type HTTPServer struct {}// NewHTTPServer creates a new worker HTTP server for direct SDK access.-// Pass a non-nil store to enable the mounts API (and persistent mounts in-// particular — they need PG + encryptor for at-rest cred storage).-func NewHTTPServer(mgr sandbox.Manager, ptyMgr *sandbox.PTYManager, execMgr *sandbox.ExecSessionManager, jwtIssuer *auth.JWTIssuer, sandboxDBs *sandbox.SandboxDBManager, sbProxy *proxy.SandboxProxy, sbRouter *sandbox.SandboxRouter, sandboxDomain string, store *db.Store) *HTTPServer {+func NewHTTPServer(mgr sandbox.Manager, ptyMgr *sandbox.PTYManager, execMgr *sandbox.ExecSessionManager, jwtIssuer *auth.JWTIssuer, sandboxDBs *sandbox.SandboxDBManager, sbProxy *proxy.SandboxProxy, sbRouter *sandbox.SandboxRouter, sandboxDomain string) *HTTPServer {e := echo.New()e.HideBanner = truee.HidePort = true@@ -48,16 +44,7 @@ func NewHTTPServer(mgr sandbox.Manager, ptyMgr *sandbox.PTYManager, execMgr *sansandboxDomain: sandboxDomain,}if mgr != nil {- s.mountSvc = mounts.NewService(mgr, store)- // Wire post-auto-wake hook so persistent mounts replay when the worker's- // router auto-wakes a sandbox on incoming request. Without this, only- // CP-initiated explicit wakes trigger replay; auto-wake-on-request- // (the most common flow) would silently lose persistent mounts.- if sbRouter != nil {- sbRouter.SetOnWake(func(sandboxID string) {- s.mountSvc.OnWake(context.Background(), sandboxID)- })- }+ s.mountSvc = mounts.NewService(mgr)}// Global middleware. Sentry goes first so it can observe panics anddiff --git a/internal/worker/mounts.go b/internal/worker/mounts.goindex b57b9ccf..bea4edc3 100644--- a/internal/worker/mounts.go+++ b/internal/worker/mounts.go@@ -2,7 +2,6 @@ package workerimport ("context"- "errors""net/http""github.com/labstack/echo/v4"@@ -32,11 +31,7 @@ func (s *HTTPServer) addMount(c echo.Context) error {return err}if err := s.routeOrCall(c, id, "mountAdd", routeOp); err != nil {- status := http.StatusInternalServerError- if errors.Is(err, mounts.ErrPersistenceUnavailable) {- status = http.StatusServiceUnavailable- }- return c.JSON(status, map[string]string{"error": err.Error()})+ return c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})}return c.JSON(http.StatusCreated, rec)}diff --git a/sdks/python/opencomputer/mounts.py b/sdks/python/opencomputer/mounts.pyindex 9bb50dc1..cf6a936d 100644--- a/sdks/python/opencomputer/mounts.py+++ b/sdks/python/opencomputer/mounts.py@@ -19,21 +19,12 @@ MountBackend = Literal["s3", "gcs", "azureblob", "sftp", "webdav", "dropbox"]@dataclassclass MountInfo:- """An active mount as tracked by the worker.-- ``status`` is one of ``"active"``, ``"replaying"``, or ``"failed"`` for- persistent mounts. Empty for non-persistent ones. ``error`` is set when- ``status == "failed"`` (typically a wake-time remount failure — bad creds,- expired tokens, network).- """+ """An active mount as tracked by the worker."""path: strremote: strread_only: boolbackend: str = ""- persistent: bool = False- status: str = ""- error: str = ""@dataclass@@ -51,7 +42,6 @@ class Mounts:creds: dict[str, str] | None = None,rclone_config: str | None = None,read_only: bool = True,- persistent: bool = False,mount_options: list[str] | None = None,) -> MountInfo:"""Mount a remote filesystem at ``path`` inside the sandbox.@@ -69,12 +59,6 @@ class Mounts:advanced tuning.read_only: Default ``True``. Object-store FUSE mounts havewell-known write footguns; opt in to RW explicitly.- persistent: When ``True``, the encrypted rclone config is stored- server-side so the mount auto-restores on wake (both explicit- and idle-wake). Failed remounts surface in ``list()`` with- ``status="failed"`` instead of silently disappearing. Default- ``False``: non-persistent mounts vanish on hibernate and the- server never stores the credentials.mount_options: Extra args appended to ``rclone mount`` (e.g.``["--dir-cache-time", "1m"]``)."""@@ -82,7 +66,6 @@ class Mounts:"path": path,"remote": remote,"readOnly": read_only,- "persistent": persistent,}if backend is not None:body["backend"] = backend@@ -130,7 +113,4 @@ def _mount_from_dict(data: dict) -> MountInfo:remote=data["remote"],backend=data.get("backend", ""),read_only=data.get("readOnly", True),- persistent=data.get("persistent", False),- status=data.get("status", ""),- error=data.get("error", ""),)diff --git a/sdks/typescript/src/mounts.ts b/sdks/typescript/src/mounts.tsindex dd365a54..c4ad4db7 100644--- a/sdks/typescript/src/mounts.ts+++ b/sdks/typescript/src/mounts.ts@@ -37,16 +37,6 @@ export interface AddMountOpts {rcloneConfig?: string;/** Default `true`. Object-store FUSE mounts have well-known write footguns. */readOnly?: boolean;- /**- * When `true`, the encrypted rclone config is persisted server-side so the- * mount is automatically restored on wake (both explicit and idle-wake). If- * the post-wake remount fails, the mount appears in `list()` with- * `status: "failed"` and an `error` message instead of silently disappearing.- *- * Defaults to `false` — non-persistent mounts vanish on hibernate and the- * server never stores the credentials.- */- persistent?: boolean;/** Extra args appended to `rclone mount` (e.g. `["--dir-cache-time", "1m"]`). */mountOptions?: string[];}@@ -56,11 +46,6 @@ export interface MountInfo {remote: string;backend?: string;readOnly: boolean;- persistent?: boolean;- /** "active" | "replaying" | "failed". Empty/absent for non-persistent mounts. */- status?: string;- /** Set when `status === "failed"`. */- error?: string;}export class Mounts {