Skip to content

[Data loss] 2026.5.19 update/backup flow removed ~/.openclaw/workspace and left plugin/npm state inconsistent #84809

Closed as not planned

Description

@Niriakot

Summary

During the OpenClaw 2026.5.19 update/backup procedure started around 2026-05-21 11:30 JST, the local user workspace directory was removed:

~/.openclaw/workspace

This directory contained active user-owned operational data and local customizations, including:

  • memory files
  • workspace scripts
  • local skills
  • local plugins
  • a configured plugin path referenced by ~/.openclaw/openclaw.json

The workspace was restored manually from Time Machine. After that, the Gateway became usable again, but the system was left with plugin/npm registry inconsistencies.

This should be treated as a data-loss class bug. The update/backup/rollback flow should never delete ~/.openclaw/workspace.

Environment

  • OS: macOS 26.5 arm64
  • Node: 25.8.1
  • OpenClaw channel: stable
  • Version before/after manual rollback: OpenClaw 2026.5.12 (f066dd2)
  • Update target shown as available: 2026.5.19
  • Gateway: LaunchAgent, port 18789
  • Config path: ~/.openclaw/openclaw.json
  • Workspace path: ~/.openclaw/workspace
  • Managed npm plugin path: ~/.openclaw/npm/node_modules

Timeline

  • Around 2026-05-21 11:30 JST: started the 2026.5.19 update/backup flow.
  • After the update/backup process, ~/.openclaw/workspace was missing.
  • Because the config referenced a local plugin under ~/.openclaw/workspace/plugins/..., Gateway config validation failed.
  • The workspace was manually restored from Time Machine.
  • After restoration and rollback to 2026.5.12, Gateway and Nextcloud Talk became usable again.
  • Remaining inconsistency: openclaw doctor still reports missing managed npm host peer links.

Expected behavior

The update/backup/rollback flow must not remove the active user workspace.

Expected safeguards:

  • Never delete ~/.openclaw/workspace during update, backup, restore, rollback, cleanup, or uninstall-adjacent flows unless the user explicitly confirms deletion.
  • If any code path might affect workspace data, create a full backup first.
  • Validate configured plugins.load.paths before and after update.
  • Abort safely if a configured local plugin path would become missing.
  • Keep managed npm plugin install records, installed package versions, and peer links consistent after update/rollback.
  • If peer links are broken, doctor or update logic should repair them deterministically.

Actual behavior

The workspace disappeared and Gateway startup/config validation failed because a configured plugin path no longer existed.

Observed error:

Invalid config at /Users/shoichi/.openclaw/openclaw.json:
- plugins.load.paths: plugin: plugin path not found:
/Users/shoichi/.openclaw/workspace/plugins/ai03-nextcloud-talk-router

Gateway aborted: config is invalid.
plugins.load.paths: plugin: plugin path not found:
/Users/shoichi/.openclaw/workspace/plugins/ai03-nextcloud-talk-router

After restoring ~/.openclaw/workspace from Time Machine and rolling back to 2026.5.12, openclaw doctor --non-interactive still reports:

Managed npm OpenClaw host peer links need repair:
- @openclaw/codex: missing
  /Users/shoichi/.openclaw/npm/node_modules/@openclaw/codex/node_modules/openclaw
- @openclaw/nextcloud-talk: missing
  /Users/shoichi/.openclaw/npm/node_modules/@openclaw/nextcloud-talk/node_modules/openclaw

Repair with openclaw doctor --fix to relink managed npm plugin packages.

Runtime/plugin mismatch symptoms were also observed:

[plugins] nextcloud-talk failed to load setup entry ...
TypeError: (0 , _setupRuntime.createSetupTranslator) is not a function

Cannot find package 'openclaw' imported from
/Users/shoichi/.openclaw/npm/node_modules/@openclaw/codex/dist/client-iRf11BEu.js

Current state after manual recovery

After Time Machine restore and rollback:

  • Gateway is running again on 2026.5.12
  • openclaw health: OK
  • openclaw channels status --probe: Nextcloud Talk works
  • ~/.openclaw/workspace has been restored
  • SQLite integrity checks for local OpenClaw sqlite files passed
  • Remaining issue: managed npm plugin peer links / plugin registry consistency still need repair

Duplicate / related issue check

I searched existing GitHub issues and did not find an exact duplicate for:

  • 2026.5.19
  • ~/.openclaw/workspace
  • workspace deletion during update/backup
  • Time Machine restore after workspace deletion

However, several related issues appear to describe adjacent failure modes:

This issue appears distinct because it involves actual deletion of the active ~/.openclaw/workspace directory during the 2026.5.19 update/backup flow, not only plugin path drift or npm peer-link drift.

Why this is severe

~/.openclaw/workspace is not disposable runtime cache. It can contain user-authored operational files, memory, skills, scripts, local plugins, and business-specific automation.

Deleting it can cause:

  • user data loss
  • Gateway startup failure
  • plugin path failure
  • local automation loss
  • assistant memory/personality loss
  • local recovery requiring Time Machine or external backup

Request

Please investigate the 2026.5.19 update/backup/rollback implementation for any code path that can delete, replace, clean, or move ~/.openclaw/workspace.

Please also consider adding regression coverage for:

  1. Update from 2026.5.12 to 2026.5.19 with existing ~/.openclaw/workspace
  2. Config containing plugins.load.paths pointing into ~/.openclaw/workspace/plugins/...
  3. Managed npm plugins installed under ~/.openclaw/npm/node_modules
  4. Rollback from 2026.5.19 to 2026.5.12
  5. Verification that:
    • workspace still exists,
    • configured local plugin paths still exist,
    • openclaw doctor --non-interactive does not report missing peer links,
    • Gateway can start without config validation errors.

Additional note

The exact internal code path that deleted ~/.openclaw/workspace has not yet been isolated. The user-visible fact is that the workspace disappeared during the 2026.5.19 update/backup flow and had to be restored from Time Machine.

Activity

  1. clawsweeper commented on May 21, 2026

    @clawsweeper
    Contributor

    Thanks for the report. I checked current main, but this shell is missing enough reproduction detail to verify a current bug.

    The reported May 2026 failure cannot be traced to a current update path or reproduced from the supplied command sequence, and both the updater and backup/restore implementations have changed substantially since then. The managed-plugin peer-link portion is now explicitly repaired; the remaining workspace-deletion claim needs a current reproduction with the exact command and logs.

    Review details

    Best possible solution:

    Keep the current update, archive, restore, and peer-link safeguards; reopen with a current-release reproduction that identifies the invoked command, state/workspace layout, and redacted updater logs if workspace removal still occurs.

    Do we have a high-confidence way to reproduce the issue?

    No. The report identifies an old version and an observed aftermath but not the exact updater command or a current-release path; current source confines update cleanup to dedicated temporary handoff directories.

    Is this the best way to solve the issue?

    Not applicable for a new patch. Current source already has a non-destructive update/restore boundary and managed peer-link convergence, while the historical deletion mechanism is not identifiable from this report.

    Security review:

    Security review: No pull-request patch or standalone security report is under review.

    AGENTS.md: found and applied where relevant.

    What I checked:

    Likely related people:

    • Peter Steinberger: Current-main blame attributes the examined backup implementation to the current shallow baseline, and recent history includes update and backup repairs. (role: recent update and backup area contributor; confidence: medium; commits: 3645cde84baa, 2f17d11e9018; files: src/infra/backup-create.ts, src/cli/update-cli/post-core-plugin-convergence.ts)
    • FullerStackDev: Commit history identifies the repair for managed npm peer links reported as the issue's secondary symptom. (role: introduced managed-plugin peer recovery; confidence: high; commits: 571f364cd7b8; files: src/cli/update-cli/post-core-plugin-convergence.ts, src/plugins/plugin-peer-link.ts)
    • Jason: History identifies the state-only uninstall workspace-preservation repair, a related but distinct destructive-flow safeguard. (role: adjacent cleanup-safety contributor; confidence: medium; commits: e74931778c69; files: src/commands/uninstall.ts, src/commands/cleanup-plan.ts)

    Codex review notes: model internal, reasoning high; reviewed against f804cdf44055.

  2. added
    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.
    impact:data-lossCan lose, corrupt, or silently drop user/session/config data.
    impact:crash-loopCrash, hang, restart loop, or process-level availability failure.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on May 21, 2026
  3. xieetudousi commented on May 21, 2026

    @xieetudousi

    This is a nasty one. I had a similar scare on my macOS setup. Here's what I'd recommend doing right now for damage control and prevention:

    Immediate steps:

    1. Set up automated backup of ~/.openclaw/workspace before any future updates. This cron job works well:
      �ash 0 */6 * * * tar czf ~/.openclaw/backups/workspace-.tgz -C ~/.openclaw workspace && find ~/.openclaw/backups -name '*.tgz' -mtime +7 -delete

    2. Consider symlinking your workspace outside of /.openclaw/ to insulate it from the update/cleanup paths:
      �ash mv ~/.openclaw/workspace ~/my-openclaw-workspace ln -s ~/my-openclaw-workspace ~/.openclaw/workspace
      Then set OPENCLAW_WORKSPACE_DIR=
      /my-openclaw-workspace in your environment.

    3. The npm peer-link issue (openclaw doctor --fix) should resolve the remaining plugin state inconsistency. Run:
      �ash openclaw doctor --fix

    The workspace-nested-under-state-dir design is indeed fragile - the cleanup code in cleanup-utils.ts can recursively remove the state dir, and since workspace is nested under ~/.openclaw/, it's vulnerable to the same path. Hopefully the maintainers add a safeguard against this in the update/rollback flow.

    If you want a fully configured backup + recovery solution (automated workspace backup, off-workspace symlink setup, and update-safe configuration), I offer deployment services that cover all of this. Let me know if you're interested.

  4. self-assigned this
    on Jun 2, 2026
  5. added
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    and removed
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    on Jun 15, 2026
  6. 19 remaining items

  7. added
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    P2Normal backlog priority with limited blast radius.
    and removed
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    impact:crash-loopCrash, hang, restart loop, or process-level availability failure.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions