@totalreclaw/totalreclaw 3.3.9-rc.2 → 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,36 @@ 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
+
23
+ ## [3.3.9-rc.3] — 2026-05-05
24
+
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).
26
+
27
+ ### Fixed
28
+
29
+ - **Telegram chat noise during agent runs:** OpenClaw 2026.5.x defaults `channels.telegram.streaming.mode` to a verbose preview mode that prints every mid-task tool-progress chunk into chat. The plugin's `patchOpenClawConfig()` now adds a third idempotent fix: when `channels.telegram.enabled === true` and `streaming.mode` is unset, default it to `"off"`. Existing explicit values (`"partial"`, `"block"`, `"progress"`) are preserved — only first-run defaults are touched. Restart required for the new key to take effect (logged via `api.logger.warn`).
30
+
31
+ ### Implementation notes
32
+
33
+ - `patchOpenClawConfig()` extended in `fs-helpers.ts` with Fix #3. Fully namespaced to Telegram — does not touch Discord, Slack, or other channels' streaming defaults.
34
+ - New tests in `fs-helpers.test.ts` cover: telegram enabled+streaming-unset (patched), streaming-exists-but-mode-missing (patched), explicit mode preserved (unchanged), telegram disabled (unchanged), telegram absent entirely (unchanged). 71/71 green.
35
+ - The same warn message that fired for slot/hooks now also covers streaming.mode in the `'patched'` path, so users see one restart prompt per first install.
36
+
7
37
  ## [3.3.9-rc.2] — 2026-05-02
8
38
 
9
39
  Patch release fixing the two OpenClaw 2026.5.x compatibility blockers discovered during 3.3.9-rc.1 auto-QA ([umbrella #224](https://github.com/p-diogo/totalreclaw-internal/issues/224)).
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.2
4
+ version: 3.3.9-rc.4
5
5
  author: TotalReclaw Team
6
6
  license: MIT
7
7
  homepage: https://totalreclaw.xyz
@@ -930,12 +930,17 @@ export function resolveOnboardingState(credentialsPath, statePath) {
930
930
  return next;
931
931
  }
932
932
  /**
933
- * Auto-patch `~/.openclaw/openclaw.json` with the two entries required by
934
- * OpenClaw 2026.5.x for `kind: memory` plugins (issues #225 + #226):
933
+ * Auto-patch `~/.openclaw/openclaw.json` with the entries required by
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`
@@ -943,6 +948,12 @@ export function resolveOnboardingState(credentialsPath, statePath) {
943
948
  * hooks for non-bundled plugins, disabling auto-extraction and
944
949
  * recall injection.
945
950
  *
951
+ * 3. `channels.telegram.streaming.mode = "off"` (only if unset)
952
+ * OpenClaw 2026.5.x defaults to a verbose streaming mode that prints
953
+ * every mid-task tool-progress preview into Telegram chat. Default
954
+ * this to "off" on first run for a clean UX. Existing explicit values
955
+ * ("partial", "block", "progress") are preserved.
956
+ *
946
957
  * Design constraints
947
958
  * ------------------
948
959
  * - SYNCHRONOUS — called during register() which must be sync.
@@ -979,13 +990,49 @@ export function patchOpenClawConfig(configPath) {
979
990
  cfg.plugins = {};
980
991
  }
981
992
  let mutated = false;
982
- // --- Fix #1: plugins.slots.memory = "totalreclaw" ---
983
- if (typeof cfg.plugins.slots !== 'object' || cfg.plugins.slots === null) {
984
- cfg.plugins.slots = {};
985
- }
986
- if (cfg.plugins.slots.memory !== 'totalreclaw') {
987
- cfg.plugins.slots.memory = 'totalreclaw';
988
- 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
+ }
989
1036
  }
990
1037
  // --- Fix #2: plugins.entries.totalreclaw.hooks.allowConversationAccess = true ---
991
1038
  if (typeof cfg.plugins.entries !== 'object' || cfg.plugins.entries === null) {
@@ -1001,6 +1048,34 @@ export function patchOpenClawConfig(configPath) {
1001
1048
  cfg.plugins.entries.totalreclaw.hooks.allowConversationAccess = true;
1002
1049
  mutated = true;
1003
1050
  }
1051
+ // --- Fix #3: channels.telegram.streaming.mode = "off" (3.3.10-rc.1) ---
1052
+ //
1053
+ // OpenClaw 2026.5.x defaults to a verbose streaming mode that prints every
1054
+ // mid-task tool-progress preview into Telegram chat ("Krilling... 🔧 Exec:
1055
+ // run openclaw skills" repeated 3-4× per command). Pedro reported this on
1056
+ // 2026-05-05 with screenshots showing extreme noise during agent install.
1057
+ //
1058
+ // Fix: when the key is COMPLETELY UNSET, default it to "off". Power users
1059
+ // who explicitly chose "partial" / "progress" / "block" keep their setting
1060
+ // — we only intervene on first-run defaults.
1061
+ //
1062
+ // This is namespaced to telegram only; other channels (Discord, Slack)
1063
+ // keep their own defaults. We touch the Telegram subtree only if it's
1064
+ // already enabled (so we don't accidentally configure a channel the user
1065
+ // never set up).
1066
+ if (typeof cfg.channels === 'object' && cfg.channels !== null) {
1067
+ const tg = cfg.channels.telegram;
1068
+ if (typeof tg === 'object' && tg !== null && tg.enabled === true) {
1069
+ if (typeof tg.streaming !== 'object' || tg.streaming === null) {
1070
+ tg.streaming = { mode: 'off' };
1071
+ mutated = true;
1072
+ }
1073
+ else if (tg.streaming.mode === undefined) {
1074
+ tg.streaming.mode = 'off';
1075
+ mutated = true;
1076
+ }
1077
+ }
1078
+ }
1004
1079
  if (!mutated)
1005
1080
  return 'unchanged';
1006
1081
  // Write back with 2-space indent to match OpenClaw's own write style.
package/dist/index.js CHANGED
@@ -2546,7 +2546,13 @@ const plugin = {
2546
2546
  // agent_end and before_agent_start hooks. Without it, auto-
2547
2547
  // extraction and recall injection are silently disabled. #226.
2548
2548
  //
2549
- // The patch is idempotent if both keys are already correct the
2549
+ // 3. channels.telegram.streaming.mode = "off" (only if unset)
2550
+ // OpenClaw 2026.5.x defaults Telegram to a verbose streaming
2551
+ // mode that prints every mid-task tool-progress preview into
2552
+ // chat. Default this to "off" on first run for a clean UX.
2553
+ // Existing explicit values are preserved (3.3.10-rc.1).
2554
+ //
2555
+ // The patch is idempotent — if all keys are already correct the
2550
2556
  // file is not touched. When the file IS mutated a restart is
2551
2557
  // required for the new keys to take effect (OpenClaw reads
2552
2558
  // openclaw.json at startup, not dynamically). We emit a warn so
@@ -2555,7 +2561,8 @@ const plugin = {
2555
2561
  const patchResult = patchOpenClawConfig();
2556
2562
  if (patchResult === 'patched') {
2557
2563
  api.logger.warn('TotalReclaw: updated openclaw.json with required 2026.5.x keys ' +
2558
- '(plugins.slots.memory + hooks.allowConversationAccess). ' +
2564
+ '(plugins.slots.memory + hooks.allowConversationAccess + ' +
2565
+ 'channels.telegram.streaming.mode). ' +
2559
2566
  'Gateway restart required for the changes to take effect. ' +
2560
2567
  'Run `/totalreclaw-restart` or restart the gateway manually.');
2561
2568
  }
package/fs-helpers.ts CHANGED
@@ -1146,12 +1146,17 @@ export function resolveOnboardingState(
1146
1146
  export type OpenClawConfigPatchResult = 'patched' | 'unchanged' | 'skipped' | 'error';
1147
1147
 
1148
1148
  /**
1149
- * Auto-patch `~/.openclaw/openclaw.json` with the two entries required by
1150
- * OpenClaw 2026.5.x for `kind: memory` plugins (issues #225 + #226):
1149
+ * Auto-patch `~/.openclaw/openclaw.json` with the entries required by
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`
@@ -1159,6 +1164,12 @@ export type OpenClawConfigPatchResult = 'patched' | 'unchanged' | 'skipped' | 'e
1159
1164
  * hooks for non-bundled plugins, disabling auto-extraction and
1160
1165
  * recall injection.
1161
1166
  *
1167
+ * 3. `channels.telegram.streaming.mode = "off"` (only if unset)
1168
+ * OpenClaw 2026.5.x defaults to a verbose streaming mode that prints
1169
+ * every mid-task tool-progress preview into Telegram chat. Default
1170
+ * this to "off" on first run for a clean UX. Existing explicit values
1171
+ * ("partial", "block", "progress") are preserved.
1172
+ *
1162
1173
  * Design constraints
1163
1174
  * ------------------
1164
1175
  * - SYNCHRONOUS — called during register() which must be sync.
@@ -1201,13 +1212,50 @@ export function patchOpenClawConfig(
1201
1212
 
1202
1213
  let mutated = false;
1203
1214
 
1204
- // --- Fix #1: plugins.slots.memory = "totalreclaw" ---
1205
- if (typeof cfg.plugins.slots !== 'object' || cfg.plugins.slots === null) {
1206
- cfg.plugins.slots = {};
1207
- }
1208
- if (cfg.plugins.slots.memory !== 'totalreclaw') {
1209
- cfg.plugins.slots.memory = 'totalreclaw';
1210
- 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
+ }
1211
1259
  }
1212
1260
 
1213
1261
  // --- Fix #2: plugins.entries.totalreclaw.hooks.allowConversationAccess = true ---
@@ -1225,6 +1273,34 @@ export function patchOpenClawConfig(
1225
1273
  mutated = true;
1226
1274
  }
1227
1275
 
1276
+ // --- Fix #3: channels.telegram.streaming.mode = "off" (3.3.10-rc.1) ---
1277
+ //
1278
+ // OpenClaw 2026.5.x defaults to a verbose streaming mode that prints every
1279
+ // mid-task tool-progress preview into Telegram chat ("Krilling... 🔧 Exec:
1280
+ // run openclaw skills" repeated 3-4× per command). Pedro reported this on
1281
+ // 2026-05-05 with screenshots showing extreme noise during agent install.
1282
+ //
1283
+ // Fix: when the key is COMPLETELY UNSET, default it to "off". Power users
1284
+ // who explicitly chose "partial" / "progress" / "block" keep their setting
1285
+ // — we only intervene on first-run defaults.
1286
+ //
1287
+ // This is namespaced to telegram only; other channels (Discord, Slack)
1288
+ // keep their own defaults. We touch the Telegram subtree only if it's
1289
+ // already enabled (so we don't accidentally configure a channel the user
1290
+ // never set up).
1291
+ if (typeof cfg.channels === 'object' && cfg.channels !== null) {
1292
+ const tg = cfg.channels.telegram;
1293
+ if (typeof tg === 'object' && tg !== null && tg.enabled === true) {
1294
+ if (typeof tg.streaming !== 'object' || tg.streaming === null) {
1295
+ tg.streaming = { mode: 'off' };
1296
+ mutated = true;
1297
+ } else if (tg.streaming.mode === undefined) {
1298
+ tg.streaming.mode = 'off';
1299
+ mutated = true;
1300
+ }
1301
+ }
1302
+ }
1303
+
1228
1304
  if (!mutated) return 'unchanged';
1229
1305
 
1230
1306
  // Write back with 2-space indent to match OpenClaw's own write style.
package/index.ts CHANGED
@@ -3125,7 +3125,13 @@ const plugin = {
3125
3125
  // agent_end and before_agent_start hooks. Without it, auto-
3126
3126
  // extraction and recall injection are silently disabled. #226.
3127
3127
  //
3128
- // The patch is idempotent if both keys are already correct the
3128
+ // 3. channels.telegram.streaming.mode = "off" (only if unset)
3129
+ // OpenClaw 2026.5.x defaults Telegram to a verbose streaming
3130
+ // mode that prints every mid-task tool-progress preview into
3131
+ // chat. Default this to "off" on first run for a clean UX.
3132
+ // Existing explicit values are preserved (3.3.10-rc.1).
3133
+ //
3134
+ // The patch is idempotent — if all keys are already correct the
3129
3135
  // file is not touched. When the file IS mutated a restart is
3130
3136
  // required for the new keys to take effect (OpenClaw reads
3131
3137
  // openclaw.json at startup, not dynamically). We emit a warn so
@@ -3135,7 +3141,8 @@ const plugin = {
3135
3141
  if (patchResult === 'patched') {
3136
3142
  api.logger.warn(
3137
3143
  'TotalReclaw: updated openclaw.json with required 2026.5.x keys ' +
3138
- '(plugins.slots.memory + hooks.allowConversationAccess). ' +
3144
+ '(plugins.slots.memory + hooks.allowConversationAccess + ' +
3145
+ 'channels.telegram.streaming.mode). ' +
3139
3146
  'Gateway restart required for the changes to take effect. ' +
3140
3147
  'Run `/totalreclaw-restart` or restart the gateway manually.',
3141
3148
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@totalreclaw/totalreclaw",
3
- "version": "3.3.9-rc.2",
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.2",
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",