@remnic/plugin-openclaw 1.0.19 → 1.0.21

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
@@ -170,7 +170,8 @@ Reset handling is configurable:
170
170
  "openclaw-remnic": {
171
171
  "config": {
172
172
  "flushOnResetEnabled": true,
173
- "beforeResetTimeoutMs": 2000
173
+ "beforeResetTimeoutMs": 2000,
174
+ "initGateTimeoutMs": 30000
174
175
  }
175
176
  }
176
177
  }
@@ -182,6 +183,11 @@ The reset path clears per-session prompt caches and workspace override state.
182
183
  If `flushOnResetEnabled` is true, Remnic also attempts a bounded extraction
183
184
  flush before the reset completes.
184
185
 
186
+ `initGateTimeoutMs` controls Remnic's cold-start init wait during recall and is
187
+ registered as the `before_prompt_build` hook timeout on OpenClaw versions with
188
+ per-hook timeout support. Raise it if first-turn recall is timing out during
189
+ slow startup; older OpenClaw versions ignore the extra hook option safely.
190
+
185
191
  Session-scoped recall controls are exposed through OpenClaw's command
186
192
  discovery surface:
187
193
 
package/dist/index.js CHANGED
@@ -372,6 +372,12 @@ var DEFAULT_WORKSPACE_DIR = path2.join(
372
372
  ".openclaw",
373
373
  "workspace"
374
374
  );
375
+ var DEFAULT_INIT_GATE_TIMEOUT_MS = 3e4;
376
+ function parseBoundedIntegerMs(value, fallback, min, max) {
377
+ const coerced = coerceNumber(value);
378
+ if (coerced === void 0) return fallback;
379
+ return Math.min(max, Math.max(min, Math.floor(coerced)));
380
+ }
375
381
  function coerceBooleanLike(value) {
376
382
  if (typeof value === "boolean") return value;
377
383
  if (typeof value === "number") {
@@ -1217,6 +1223,12 @@ function parseConfig(raw) {
1217
1223
  // Compaction reset (opt-in, default: false)
1218
1224
  compactionResetEnabled: cfg.compactionResetEnabled === true,
1219
1225
  beforeResetTimeoutMs: typeof cfg.beforeResetTimeoutMs === "number" ? Math.min(3e4, Math.max(100, Math.floor(cfg.beforeResetTimeoutMs))) : 2e3,
1226
+ initGateTimeoutMs: parseBoundedIntegerMs(
1227
+ cfg.initGateTimeoutMs,
1228
+ DEFAULT_INIT_GATE_TIMEOUT_MS,
1229
+ 1e3,
1230
+ 12e4
1231
+ ),
1220
1232
  flushOnResetEnabled: cfg.flushOnResetEnabled !== false,
1221
1233
  commandsListEnabled: cfg.commandsListEnabled !== false,
1222
1234
  openclawToolsEnabled: cfg.openclawToolsEnabled !== false,
@@ -35251,7 +35263,10 @@ ${evidenceText}`
35251
35263
  await Promise.race([
35252
35264
  this.initPromise.catch(() => void 0),
35253
35265
  new Promise((resolve2) => {
35254
- initGateTimeoutHandle = setTimeout(resolve2, 15e3);
35266
+ initGateTimeoutHandle = setTimeout(
35267
+ resolve2,
35268
+ this.config.initGateTimeoutMs
35269
+ );
35255
35270
  })
35256
35271
  ]);
35257
35272
  } finally {
@@ -35886,13 +35901,12 @@ ${r.snippet.trim()}
35886
35901
  let initGateTimeoutHandle = null;
35887
35902
  let onInitGateAbort = null;
35888
35903
  if (this.initPromise) {
35889
- const INIT_GATE_TIMEOUT_MS = 15e3;
35890
35904
  const gateResult = await Promise.race([
35891
35905
  this.initPromise.then(() => "ok"),
35892
35906
  new Promise((resolve2) => {
35893
35907
  initGateTimeoutHandle = setTimeout(
35894
35908
  () => resolve2("timeout"),
35895
- INIT_GATE_TIMEOUT_MS
35909
+ this.config.initGateTimeoutMs
35896
35910
  );
35897
35911
  }),
35898
35912
  abortController.signal.aborted ? Promise.resolve("aborted") : new Promise((resolve2) => {
@@ -73710,7 +73724,8 @@ Keep the reflection grounded in the evidence below.
73710
73724
  return Object.keys(gatewayResult).length > 0 ? gatewayResult : void 0;
73711
73725
  }
73712
73726
  return result;
73713
- }
73727
+ },
73728
+ { timeoutMs: cfg.initGateTimeoutMs }
73714
73729
  );
73715
73730
  } else {
73716
73731
  api.on(
@@ -73747,7 +73762,8 @@ Keep the reflection grounded in the evidence below.
73747
73762
  return Object.keys(gatewayResult).length > 0 ? gatewayResult : void 0;
73748
73763
  }
73749
73764
  return result;
73750
- }
73765
+ },
73766
+ { timeoutMs: cfg.initGateTimeoutMs }
73751
73767
  );
73752
73768
  const memoryBuildFn = (params) => {
73753
73769
  const key = params?.sessionKey ?? "default";
@@ -1,9 +1,23 @@
1
1
  {
2
2
  "id": "openclaw-remnic",
3
3
  "name": "Remnic OpenClaw Plugin",
4
- "version": "1.0.19",
4
+ "version": "1.0.21",
5
5
  "kind": "memory",
6
6
  "description": "Local semantic memory for OpenClaw. Requires plugins.slots.memory set to this plugin id for hooks to fire.",
7
+ "setup": {
8
+ "providers": [
9
+ {
10
+ "id": "openai",
11
+ "authMethods": [
12
+ "api-key"
13
+ ],
14
+ "envVars": [
15
+ "OPENAI_API_KEY"
16
+ ]
17
+ }
18
+ ],
19
+ "requiresRuntime": false
20
+ },
7
21
  "providerAuthEnvVars": {
8
22
  "openai": [
9
23
  "OPENAI_API_KEY"
@@ -670,6 +684,13 @@
670
684
  "default": 2000,
671
685
  "description": "Maximum time to wait for a reset-triggered flush before returning control to OpenClaw."
672
686
  },
687
+ "initGateTimeoutMs": {
688
+ "type": "integer",
689
+ "minimum": 1000,
690
+ "maximum": 120000,
691
+ "default": 30000,
692
+ "description": "Maximum time Remnic waits for cold-start initialization during recall; also registered as the OpenClaw before_prompt_build hook timeout on SDKs that support per-hook options."
693
+ },
673
694
  "flushOnResetEnabled": {
674
695
  "type": "boolean",
675
696
  "default": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/plugin-openclaw",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "OpenClaw adapter for Remnic memory — thin wrapper delegating to @remnic/core",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "openai": "^6.0.0",
38
- "@remnic/core": "^1.1.7"
38
+ "@remnic/core": "^1.1.8"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "openclaw": ">=2026.4.8"