@totalreclaw/totalreclaw 3.3.9-rc.3 → 3.3.9-rc.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/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@ All notable changes to `@totalreclaw/totalreclaw` (the OpenClaw plugin) are docu
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [3.3.9-rc.4] — 2026-05-05
8
+
9
+ Defensive patch hardening `patchOpenClawConfig()` Fix #1 against a startup crash loop observed on Pedro's pop-os QA host on 2026-05-05.
10
+
11
+ ### Fixed
12
+
13
+ - **Slot patch crash-loop guard:** `patchOpenClawConfig()` previously wrote `plugins.slots.memory = "totalreclaw"` whenever the slot was unset. On 2026-05-05 pop-os crashed in a restart loop (~13 attempts, 12:10–12:23 UTC) with `Gateway failed to start: Error: Invalid config at openclaw.json. plugins.slots.memory: plugin not found: totalreclaw. Run "openclaw doctor --fix" to repair, then retry.` Root cause: a previous register() invocation had written the slot, but a later config reset / migration wiped `plugins.installs.totalreclaw` while leaving `plugins.slots.memory` behind. OpenClaw's startup validator hard-fails when `slots.memory` points to a name with no install record. The crash self-resolved at 12:24 once the user re-ran `openclaw plugins install`.
14
+
15
+ **Fix:** Slot patch is now gated on `cfg.plugins.installs?.totalreclaw?.version` being a non-empty string. Without an install record we leave `slots.memory` alone — neither writing it (preventing future crash loops) nor cleaning it up (not our responsibility). The hooks (Fix #2) and Telegram streaming (Fix #3) patches are unchanged — they write under `plugins.entries` and `channels` which are inert without an install record and cannot trip the validator.
16
+
17
+ ### Implementation notes
18
+
19
+ - `cfg.plugins.installs.totalreclaw.version` is the install pipeline's authoritative signal that the plugin is on disk and registered with the gateway. It's populated by `openclaw plugins install` and survives gateway restarts; a config reset that drops it indicates the plugin install record is no longer valid and slot should not point to it.
20
+ - 7 new tests in `fs-helpers.test.ts`: empty-config-no-installs (slot NOT written), empty-config-with-installs (slot WRITTEN), installs-without-version (slot still gated), stale-slot-no-install (we don't auto-clean), plus updated fixtures across the existing 4 cases. 81/81 green.
21
+ - Pre-existing tests for the hooks and Telegram streaming patches continue to pass unchanged — those code paths are not gated.
22
+
7
23
  ## [3.3.9-rc.3] — 2026-05-05
8
24
 
9
25
  Patch release silencing the verbose Telegram streaming output Pedro reported during 3.3.9-rc.2 manual QA ("Krilling… 🔧 Exec: run openclaw skills" repeated 3-4× per shell command in the same chat bubble).
package/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: totalreclaw
3
3
  description: "Install + set up TotalReclaw encrypted memory for OpenClaw, then use tr CLI for remember / recall. Trigger on 'install TotalReclaw', 'set up TotalReclaw', 'restore my recovery phrase', or any remember / recall request."
4
- version: 3.3.9-rc.3
4
+ version: 3.3.9-rc.4
5
5
  author: TotalReclaw Team
6
6
  license: MIT
7
7
  homepage: https://totalreclaw.xyz
@@ -933,9 +933,14 @@ export function resolveOnboardingState(credentialsPath, statePath) {
933
933
  * Auto-patch `~/.openclaw/openclaw.json` with the entries required by
934
934
  * OpenClaw 2026.5.x for clean operation (issues #225 + #226 + verbosity):
935
935
  *
936
- * 1. `plugins.slots.memory = "totalreclaw"`
936
+ * 1. `plugins.slots.memory = "totalreclaw"` (gated on install record)
937
937
  * Claim the memory slot so the plugin loads instead of deferring to
938
- * the built-in `memory-core` tenant.
938
+ * the built-in `memory-core` tenant. As of 3.3.9-rc.4 this fix is
939
+ * gated on `plugins.installs.totalreclaw.version` being present —
940
+ * writing the slot without an install record produces a startup
941
+ * crash loop ("plugins.slots.memory: plugin not found: totalreclaw")
942
+ * that survives container restarts until `openclaw plugins install`
943
+ * repopulates the install record.
939
944
  *
940
945
  * 2. `plugins.entries.totalreclaw.hooks.allowConversationAccess = true`
941
946
  * Grant the plugin access to `agent_end` and `before_agent_start`
@@ -985,13 +990,49 @@ export function patchOpenClawConfig(configPath) {
985
990
  cfg.plugins = {};
986
991
  }
987
992
  let mutated = false;
988
- // --- Fix #1: plugins.slots.memory = "totalreclaw" ---
989
- if (typeof cfg.plugins.slots !== 'object' || cfg.plugins.slots === null) {
990
- cfg.plugins.slots = {};
991
- }
992
- if (cfg.plugins.slots.memory !== 'totalreclaw') {
993
- cfg.plugins.slots.memory = 'totalreclaw';
994
- mutated = true;
993
+ // --- Fix #1: plugins.slots.memory = "totalreclaw" (gated on install) ---
994
+ //
995
+ // DEFENSIVE GATE (3.3.9-rc.4 2026-05-05): only write the slot when
996
+ // the plugin is genuinely INSTALLED (`plugins.installs.totalreclaw`
997
+ // present with a `version`). Writing the slot unconditionally
998
+ // produced a startup crash loop on Pedro's pop-os QA host on
999
+ // 2026-05-05 — after a config reset, `plugins.installs.totalreclaw`
1000
+ // was missing but a previously-written `slots.memory = "totalreclaw"`
1001
+ // had survived. OpenClaw's startup validator refuses to start with
1002
+ //
1003
+ // Gateway failed to start: Error: Invalid config at openclaw.json.
1004
+ // plugins.slots.memory: plugin not found: totalreclaw
1005
+ // Run "openclaw doctor --fix" to repair, then retry.
1006
+ //
1007
+ // The container restart-loop drained ~13 attempts (12:10-12:23 UTC)
1008
+ // until `openclaw plugins install` was re-run and re-populated
1009
+ // `plugins.installs.totalreclaw`. With this gate, future installs
1010
+ // that wipe `plugins.installs` (config reset, `doctor --fix`,
1011
+ // migration tools) cannot regress into the same boot loop — slot is
1012
+ // only ever written when the install record exists, and the install
1013
+ // record is the install pipeline's authoritative signal that the
1014
+ // plugin is on disk and registered with the gateway.
1015
+ //
1016
+ // The hooks patch (Fix #2) and Telegram streaming patch (Fix #3) are
1017
+ // not gated this way — they write under `plugins.entries` and
1018
+ // `channels` which are inert without an install record, so they can
1019
+ // never trip the validator.
1020
+ const installsRoot = cfg.plugins.installs;
1021
+ const installEntry = typeof installsRoot === 'object' && installsRoot !== null
1022
+ ? installsRoot.totalreclaw
1023
+ : undefined;
1024
+ const pluginIsInstalled = typeof installEntry === 'object'
1025
+ && installEntry !== null
1026
+ && typeof installEntry.version === 'string'
1027
+ && installEntry.version.length > 0;
1028
+ if (pluginIsInstalled) {
1029
+ if (typeof cfg.plugins.slots !== 'object' || cfg.plugins.slots === null) {
1030
+ cfg.plugins.slots = {};
1031
+ }
1032
+ if (cfg.plugins.slots.memory !== 'totalreclaw') {
1033
+ cfg.plugins.slots.memory = 'totalreclaw';
1034
+ mutated = true;
1035
+ }
995
1036
  }
996
1037
  // --- Fix #2: plugins.entries.totalreclaw.hooks.allowConversationAccess = true ---
997
1038
  if (typeof cfg.plugins.entries !== 'object' || cfg.plugins.entries === null) {
package/fs-helpers.ts CHANGED
@@ -1149,9 +1149,14 @@ export type OpenClawConfigPatchResult = 'patched' | 'unchanged' | 'skipped' | 'e
1149
1149
  * Auto-patch `~/.openclaw/openclaw.json` with the entries required by
1150
1150
  * OpenClaw 2026.5.x for clean operation (issues #225 + #226 + verbosity):
1151
1151
  *
1152
- * 1. `plugins.slots.memory = "totalreclaw"`
1152
+ * 1. `plugins.slots.memory = "totalreclaw"` (gated on install record)
1153
1153
  * Claim the memory slot so the plugin loads instead of deferring to
1154
- * the built-in `memory-core` tenant.
1154
+ * the built-in `memory-core` tenant. As of 3.3.9-rc.4 this fix is
1155
+ * gated on `plugins.installs.totalreclaw.version` being present —
1156
+ * writing the slot without an install record produces a startup
1157
+ * crash loop ("plugins.slots.memory: plugin not found: totalreclaw")
1158
+ * that survives container restarts until `openclaw plugins install`
1159
+ * repopulates the install record.
1155
1160
  *
1156
1161
  * 2. `plugins.entries.totalreclaw.hooks.allowConversationAccess = true`
1157
1162
  * Grant the plugin access to `agent_end` and `before_agent_start`
@@ -1207,13 +1212,50 @@ export function patchOpenClawConfig(
1207
1212
 
1208
1213
  let mutated = false;
1209
1214
 
1210
- // --- Fix #1: plugins.slots.memory = "totalreclaw" ---
1211
- if (typeof cfg.plugins.slots !== 'object' || cfg.plugins.slots === null) {
1212
- cfg.plugins.slots = {};
1213
- }
1214
- if (cfg.plugins.slots.memory !== 'totalreclaw') {
1215
- cfg.plugins.slots.memory = 'totalreclaw';
1216
- mutated = true;
1215
+ // --- Fix #1: plugins.slots.memory = "totalreclaw" (gated on install) ---
1216
+ //
1217
+ // DEFENSIVE GATE (3.3.9-rc.4 2026-05-05): only write the slot when
1218
+ // the plugin is genuinely INSTALLED (`plugins.installs.totalreclaw`
1219
+ // present with a `version`). Writing the slot unconditionally
1220
+ // produced a startup crash loop on Pedro's pop-os QA host on
1221
+ // 2026-05-05 — after a config reset, `plugins.installs.totalreclaw`
1222
+ // was missing but a previously-written `slots.memory = "totalreclaw"`
1223
+ // had survived. OpenClaw's startup validator refuses to start with
1224
+ //
1225
+ // Gateway failed to start: Error: Invalid config at openclaw.json.
1226
+ // plugins.slots.memory: plugin not found: totalreclaw
1227
+ // Run "openclaw doctor --fix" to repair, then retry.
1228
+ //
1229
+ // The container restart-loop drained ~13 attempts (12:10-12:23 UTC)
1230
+ // until `openclaw plugins install` was re-run and re-populated
1231
+ // `plugins.installs.totalreclaw`. With this gate, future installs
1232
+ // that wipe `plugins.installs` (config reset, `doctor --fix`,
1233
+ // migration tools) cannot regress into the same boot loop — slot is
1234
+ // only ever written when the install record exists, and the install
1235
+ // record is the install pipeline's authoritative signal that the
1236
+ // plugin is on disk and registered with the gateway.
1237
+ //
1238
+ // The hooks patch (Fix #2) and Telegram streaming patch (Fix #3) are
1239
+ // not gated this way — they write under `plugins.entries` and
1240
+ // `channels` which are inert without an install record, so they can
1241
+ // never trip the validator.
1242
+ const installsRoot = cfg.plugins.installs;
1243
+ const installEntry = typeof installsRoot === 'object' && installsRoot !== null
1244
+ ? installsRoot.totalreclaw
1245
+ : undefined;
1246
+ const pluginIsInstalled = typeof installEntry === 'object'
1247
+ && installEntry !== null
1248
+ && typeof installEntry.version === 'string'
1249
+ && installEntry.version.length > 0;
1250
+
1251
+ if (pluginIsInstalled) {
1252
+ if (typeof cfg.plugins.slots !== 'object' || cfg.plugins.slots === null) {
1253
+ cfg.plugins.slots = {};
1254
+ }
1255
+ if (cfg.plugins.slots.memory !== 'totalreclaw') {
1256
+ cfg.plugins.slots.memory = 'totalreclaw';
1257
+ mutated = true;
1258
+ }
1217
1259
  }
1218
1260
 
1219
1261
  // --- Fix #2: plugins.entries.totalreclaw.hooks.allowConversationAccess = true ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@totalreclaw/totalreclaw",
3
- "version": "3.3.9-rc.3",
3
+ "version": "3.3.9-rc.4",
4
4
  "description": "End-to-end encrypted, agent-portable memory for OpenClaw and any LLM-agent runtime. XChaCha20-Poly1305 with protobuf v4 + on-chain Memory Taxonomy v1 (claim / preference / directive / commitment / episode / summary).",
5
5
  "type": "module",
6
6
  "keywords": [
package/skill.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "totalreclaw",
3
- "version": "3.3.9-rc.3",
3
+ "version": "3.3.9-rc.4",
4
4
  "description": "End-to-end encrypted memory for AI agents — portable, yours forever. XChaCha20-Poly1305 E2EE: server never sees plaintext.",
5
5
  "author": "TotalReclaw Team",
6
6
  "license": "MIT",