openclaw-workspace-sync 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -110,6 +110,46 @@ Use this only if you understand the trade-offs:
110
110
 
111
111
  If you are running on a container platform, `mailbox` mode is strongly recommended.
112
112
 
113
+ ## Before your first sync
114
+
115
+ Getting the initial state right prevents data loss. Each mode has different requirements:
116
+
117
+ ### `mailbox` mode — starting state
118
+
119
+ The first sync **pushes** your local workspace to the cloud. This means rclone makes cloud match local exactly — any files on cloud that don't exist locally will be **deleted**.
120
+
121
+ **Recommended starting state:** Local workspace is the source of truth (the agent has been writing here), or local and remote are already identical.
122
+
123
+ **If remote is the source of truth** (e.g. you've been syncing manually or switching from another mode), pull first:
124
+
125
+ ```bash
126
+ rclone sync <remote>:<path> /data/workspace/ --config <config-path> \
127
+ --exclude '**/.DS_Store' --exclude '**/.git/**' \
128
+ --exclude '**/__pycache__/**' --exclude '**/node_modules/**' \
129
+ --verbose
130
+ ```
131
+
132
+ Then verify local matches remote before enabling the plugin.
133
+
134
+ ### `mirror` mode — starting state
135
+
136
+ The first sync **pulls** from cloud to local. Local can be empty, stale, or corrupted — the pull simply overwrites it. **No preparation needed.**
137
+
138
+ ### `bisync` mode — starting state
139
+
140
+ The first sync requires `--resync`, which copies everything from both sides to the other. Any stale or unwanted files on either side will propagate.
141
+
142
+ **Recommended starting state:** Both sides are identical, or one side is empty and the other has the data you want. Verify both before running `--resync`.
143
+
144
+ ### General first-sync checklist
145
+
146
+ 1. Run a `--dry-run` first to see what would happen: `openclaw workspace-sync sync --dry-run`
147
+ 2. Check the output for unexpected deletions
148
+ 3. If everything looks right, run the actual sync
149
+ 4. Only then enable periodic sync (`interval` in config)
150
+
151
+ > For maintenance, recovery, and common problems, see [TROUBLESHOOTING.md](./TROUBLESHOOTING.md).
152
+
113
153
  ## Setup sequence
114
154
 
115
155
  Getting sync right depends on doing things in the right order. Follow these steps:
@@ -425,6 +465,8 @@ Cloud sync involves two copies of your data. When things go wrong, one side can
425
465
 
426
466
  **If in doubt, use `mailbox` mode.** It gives you a live local mirror of the workspace and a clean way to send files to the agent, with no risk of data loss.
427
467
 
468
+ > For recovery procedures, mode switching, and maintenance tips, see [TROUBLESHOOTING.md](./TROUBLESHOOTING.md).
469
+
428
470
  ## Important: `--resync` is destructive (bisync only)
429
471
 
430
472
  **Never use `--resync` unless you know exactly what it does.** The `--resync` flag tells rclone to throw away its knowledge of what has changed and do a full reconciliation — it copies every file that exists on either side to the other side. This means:
package/README.src.md CHANGED
@@ -151,6 +151,46 @@ Use this only if you understand the trade-offs:
151
151
 
152
152
  If you are running on a container platform, `mailbox` mode is strongly recommended.
153
153
 
154
+ ## Before your first sync
155
+
156
+ Getting the initial state right prevents data loss. Each mode has different requirements:
157
+
158
+ ### `mailbox` mode — starting state
159
+
160
+ The first sync **pushes** your local workspace to the cloud. This means rclone makes cloud match local exactly — any files on cloud that don't exist locally will be **deleted**.
161
+
162
+ **Recommended starting state:** Local workspace is the source of truth (the agent has been writing here), or local and remote are already identical.
163
+
164
+ **If remote is the source of truth** (e.g. you've been syncing manually or switching from another mode), pull first:
165
+
166
+ ```bash
167
+ rclone sync <remote>:<path> /data/workspace/ --config <config-path> \
168
+ --exclude '**/.DS_Store' --exclude '**/.git/**' \
169
+ --exclude '**/__pycache__/**' --exclude '**/node_modules/**' \
170
+ --verbose
171
+ ```
172
+
173
+ Then verify local matches remote before enabling the plugin.
174
+
175
+ ### `mirror` mode — starting state
176
+
177
+ The first sync **pulls** from cloud to local. Local can be empty, stale, or corrupted — the pull simply overwrites it. **No preparation needed.**
178
+
179
+ ### `bisync` mode — starting state
180
+
181
+ The first sync requires `--resync`, which copies everything from both sides to the other. Any stale or unwanted files on either side will propagate.
182
+
183
+ **Recommended starting state:** Both sides are identical, or one side is empty and the other has the data you want. Verify both before running `--resync`.
184
+
185
+ ### General first-sync checklist
186
+
187
+ 1. Run a `--dry-run` first to see what would happen: `openclaw workspace-sync sync --dry-run`
188
+ 2. Check the output for unexpected deletions
189
+ 3. If everything looks right, run the actual sync
190
+ 4. Only then enable periodic sync (`interval` in config)
191
+
192
+ > For maintenance, recovery, and common problems, see [TROUBLESHOOTING.md](./TROUBLESHOOTING.md).
193
+
154
194
  ## Setup sequence
155
195
 
156
196
  Getting sync right depends on doing things in the right order. Follow these steps:
@@ -466,6 +506,8 @@ Cloud sync involves two copies of your data. When things go wrong, one side can
466
506
 
467
507
  **If in doubt, use `mailbox` mode.** It gives you a live local mirror of the workspace and a clean way to send files to the agent, with no risk of data loss.
468
508
 
509
+ > For recovery procedures, mode switching, and maintenance tips, see [TROUBLESHOOTING.md](./TROUBLESHOOTING.md).
510
+
469
511
  ## Important: `--resync` is destructive (bisync only)
470
512
 
471
513
  **Never use `--resync` unless you know exactly what it does.** The `--resync` flag tells rclone to throw away its knowledge of what has changed and do a full reconciliation — it copies every file that exists on either side to the other side. This means:
@@ -0,0 +1,203 @@
1
+ # Troubleshooting & Maintenance
2
+
3
+ Common problems, recovery procedures, and maintenance tips for `openclaw-workspace-sync`.
4
+
5
+ ## Quick diagnostics
6
+
7
+ ```bash
8
+ # Check plugin status and remote connectivity
9
+ openclaw workspace-sync status
10
+
11
+ # See what a sync would do without changing anything
12
+ openclaw workspace-sync sync --dry-run
13
+
14
+ # Compare local and remote without making changes
15
+ rclone check <remote>:<path> /data/workspace/ --config <config-path>
16
+
17
+ # List remote contents
18
+ rclone ls <remote>:<path> --config <config-path> --max-depth 1
19
+ ```
20
+
21
+ ## Common problems
22
+
23
+ ### Files deleted unexpectedly after enabling mailbox mode
24
+
25
+ **Cause:** Mailbox mode pushes local → cloud on every sync cycle. If local was empty or stale when you enabled it, the push made cloud match local — deleting cloud files that weren't present locally.
26
+
27
+ **Prevention:** Always align local with remote before enabling mailbox mode. See [Before your first sync](./README.md#before-your-first-sync).
28
+
29
+ **Recovery:**
30
+ 1. Disable the plugin immediately (`"enabled": false` in `openclaw.json`, restart gateway)
31
+ 2. Check your cloud provider's trash/version history (Dropbox keeps deleted files for 30 days)
32
+ 3. Restore from cloud trash or a backup
33
+ 4. Re-pull from cloud to align local:
34
+ ```bash
35
+ rclone sync <remote>:<path> /data/workspace/ --config <config-path> --verbose
36
+ ```
37
+ 5. Verify local matches remote, then re-enable the plugin
38
+
39
+ ### Duplicate folders from case-sensitivity mismatch
40
+
41
+ **Cause:** macOS and Dropbox are case-insensitive (`code` = `CODE`), but Linux is case-sensitive. Renaming a folder on your Mac (e.g. `code` → `CODE`) propagates to Dropbox, but when rclone pulls to Linux, it may create both `code` and `CODE` as separate directories.
42
+
43
+ **Symptoms:** You see `code`, `CODE`, and/or intermediate names like `code1` on the server.
44
+
45
+ **Fix:**
46
+ 1. Check which folder has the most complete contents:
47
+ ```bash
48
+ ls /data/workspace/code/ | wc -l
49
+ ls /data/workspace/CODE/ | wc -l
50
+ ```
51
+ 2. Keep the most complete one, delete the others:
52
+ ```bash
53
+ rm -rf /data/workspace/CODE /data/workspace/code1
54
+ ```
55
+ 3. Re-pull from cloud to fill in anything missing:
56
+ ```bash
57
+ rclone sync <remote>:<path> /data/workspace/ --config <config-path> --verbose
58
+ ```
59
+
60
+ **Prevention:** Avoid renaming top-level folders on macOS when syncing to a Linux server via Dropbox. If you need uppercase names, rename on the server side and let it sync down.
61
+
62
+ ### "directory not found" errors during sync
63
+
64
+ **Cause:** Ghost directory entries on the cloud provider — the directory name exists but the contents are gone. Common after case-sensitivity renames or interrupted uploads.
65
+
66
+ **Impact:** Harmless. rclone skips these entries and continues. Your sync still works.
67
+
68
+ **Fix:** If the errors bother you, clean up the ghost entries via your cloud provider's web UI (e.g. dropbox.com). You can also run `rclone check` to confirm actual files are in sync despite the errors.
69
+
70
+ ### Sync interrupted / incomplete
71
+
72
+ **Cause:** Network timeout, process killed, SSH disconnection, container restart.
73
+
74
+ **Impact:** The sync was partial — some files were transferred, others weren't. No data corruption, but local and remote may be out of sync.
75
+
76
+ **Fix:** Re-run the sync. rclone is idempotent — it only transfers files that differ:
77
+ ```bash
78
+ rclone sync <remote>:<path> /data/workspace/ --config <config-path> --verbose
79
+ ```
80
+
81
+ **Tip:** For long syncs over SSH, use `tmux` or `screen` so the sync survives disconnections:
82
+ ```bash
83
+ tmux new -s sync
84
+ rclone sync <remote>:<path> /data/workspace/ --config <config-path> --verbose
85
+ # Ctrl+B, D to detach; tmux attach -t sync to reconnect
86
+ ```
87
+
88
+ ### "directory not found" with Dropbox app folder
89
+
90
+ **Cause:** Your `remotePath` is set to the app folder name (e.g. `"openclaw-sync"`) instead of `""`. With Dropbox app folders, the app folder IS the root — rclone sees it as `/`.
91
+
92
+ **Fix:** Set `"remotePath": ""` in your config.
93
+
94
+ ### OAuth token expired
95
+
96
+ **Cause:** Dropbox tokens expire if unused for 90+ days or if the app's permissions change.
97
+
98
+ **Symptoms:** Sync fails with 401/403 errors or "token expired" messages.
99
+
100
+ **Fix:**
101
+ ```bash
102
+ openclaw workspace-sync setup
103
+ # Re-run OAuth authorization step
104
+ ```
105
+
106
+ Or manually re-authorize rclone:
107
+ ```bash
108
+ rclone config reconnect <remote>: --config <config-path>
109
+ ```
110
+
111
+ ## Switching modes
112
+
113
+ Changing sync mode requires care. Follow this procedure:
114
+
115
+ 1. **Disable periodic sync** — set `"enabled": false` or remove `interval` from config, restart gateway
116
+ 2. **Align local and remote** — run `rclone check` to verify, or pull/push to align
117
+ 3. **Change the mode** in `openclaw.json`
118
+ 4. **Run a dry-run** — `openclaw workspace-sync sync --dry-run` to verify behavior
119
+ 5. **Run the first sync** under the new mode
120
+ 6. **Re-enable periodic sync**
121
+
122
+ ### Switching to `mailbox` from `mirror` or `bisync`
123
+
124
+ Mirror pulls from cloud; mailbox pushes to cloud. Before switching:
125
+ - Ensure local is up to date (run one last mirror pull)
126
+ - Then switch to mailbox — the first push should be a no-op if both sides match
127
+
128
+ ### Switching to `mirror` from `mailbox` or `bisync`
129
+
130
+ Safe — mirror only pulls. Just switch the mode. The first sync downloads the workspace.
131
+
132
+ ### Switching to `bisync` from another mode
133
+
134
+ Requires `--resync` to establish the baseline. Verify both sides are aligned first.
135
+
136
+ ## Maintenance
137
+
138
+ ### Periodic health checks
139
+
140
+ ```bash
141
+ # Compare local and remote (no changes)
142
+ rclone check <remote>:<path> /data/workspace/ --config <config-path>
143
+
144
+ # Check disk usage
145
+ du -sh /data/workspace/
146
+
147
+ # Check rclone version
148
+ rclone version
149
+ ```
150
+
151
+ ### Backup recommendations
152
+
153
+ - **Container platforms (Fly.io, Railway):** Use a separate persistent volume for the workspace. Volumes can be snapshotted for backup.
154
+ - **VPS:** Schedule daily backups of the workspace directory (cron + tar, or your provider's snapshot feature).
155
+ - **Cloud provider:** Most providers (Dropbox, Google Drive, OneDrive) have built-in version history and trash. Verify these are enabled.
156
+
157
+ ### Keeping excludes clean
158
+
159
+ Large or frequently-changing directories waste sync bandwidth. Review your `exclude` patterns periodically:
160
+
161
+ ```json
162
+ "exclude": [
163
+ "**/.DS_Store",
164
+ "**/.git/**",
165
+ "**/__pycache__/**",
166
+ "**/.venv/**",
167
+ "**/venv/**",
168
+ "**/node_modules/**",
169
+ "*.log",
170
+ "DUPLICATES/**"
171
+ ]
172
+ ```
173
+
174
+ Common additions:
175
+ - `"**/dist/**"` — build output
176
+ - `"**/.cache/**"` — tool caches
177
+ - `"**/tmp/**"` — temporary files
178
+ - `"**/*.pyc"` — compiled Python
179
+
180
+ ### Updating the plugin
181
+
182
+ ```bash
183
+ openclaw plugins install openclaw-workspace-sync
184
+ # or
185
+ cd ~/.openclaw/extensions/workspace-sync && git pull && npm install --omit=dev
186
+ ```
187
+
188
+ After updating, restart the gateway to pick up the new version.
189
+
190
+ ## Emergency: stop all syncing
191
+
192
+ If something is going wrong and you need to stop immediately:
193
+
194
+ 1. **Disable the plugin:**
195
+ ```json
196
+ "openclaw-workspace-sync": {
197
+ "enabled": false
198
+ }
199
+ ```
200
+ 2. **Restart the gateway**
201
+ 3. **Assess the damage** — compare local and remote with `rclone check`
202
+ 4. **Recover** — use cloud provider trash/version history if needed
203
+ 5. **Fix the root cause** before re-enabling
@@ -5,6 +5,20 @@
5
5
  "label": "Cloud Provider",
6
6
  "help": "Cloud storage provider for workspace sync"
7
7
  },
8
+ "mode": {
9
+ "label": "Sync Mode",
10
+ "help": "mailbox (safest, inbox/outbox), mirror (remote→local), or bisync (bidirectional)"
11
+ },
12
+ "ingest": {
13
+ "label": "Enable Ingest",
14
+ "help": "Create a local inbox folder that syncs one-way up to the workspace (mirror mode only)"
15
+ },
16
+ "ingestPath": {
17
+ "label": "Ingest Path",
18
+ "placeholder": "inbox",
19
+ "help": "Local subfolder name for ingestion (default: inbox). Mirror mode only.",
20
+ "advanced": true
21
+ },
8
22
  "remotePath": {
9
23
  "label": "Remote Path",
10
24
  "placeholder": "openclaw-share",
@@ -122,6 +136,16 @@
122
136
  "custom"
123
137
  ]
124
138
  },
139
+ "mode": {
140
+ "type": "string",
141
+ "enum": ["mirror", "mailbox", "bisync"]
142
+ },
143
+ "ingest": {
144
+ "type": "boolean"
145
+ },
146
+ "ingestPath": {
147
+ "type": "string"
148
+ },
125
149
  "remotePath": {
126
150
  "type": "string"
127
151
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-workspace-sync",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Workspace cloud sync via rclone — mailbox (inbox/outbox), mirror, or bisync (Dropbox, Google Drive, S3, OneDrive, 70+ providers)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,6 +29,7 @@
29
29
  "skills",
30
30
  "openclaw.plugin.json",
31
31
  "README.md",
32
+ "TROUBLESHOOTING.md",
32
33
  "LICENSE"
33
34
  ],
34
35
  "dependencies": {