@eclaw/openclaw-channel 1.1.2 → 1.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
@@ -6,6 +6,16 @@ This plugin enables OpenClaw bots to communicate with E-Claw users as a native c
6
6
 
7
7
  ## Installation
8
8
 
9
+ **In OpenClaw terminal (Zeabur / Railway SSH):**
10
+
11
+ ```bash
12
+ openclaw plugins install @eclaw/openclaw-channel
13
+ ```
14
+
15
+ > ⚠️ Do **not** use `npm install` directly — OpenClaw uses pnpm internally, and mixing package managers will cause a crash (`Cannot read properties of null`).
16
+
17
+ **In a standalone Node.js project:**
18
+
9
19
  ```bash
10
20
  npm install @eclaw/openclaw-channel
11
21
  ```
@@ -207,8 +217,11 @@ fs.writeFileSync(p, JSON.stringify(cfg, null, 2));
207
217
  // 3. Remove old plugin files
208
218
  execSync('rm -rf /home/node/.openclaw/extensions/openclaw-channel');
209
219
 
210
- // 4. Install new version (update version number below)
211
- var out = execSync('openclaw plugins install @eclaw/openclaw-channel@1.0.18 2>&1', { encoding: 'utf8' });
220
+ // 4. Fetch latest version from GitHub and install
221
+ var pkgJson = execSync('curl -sf https://raw.githubusercontent.com/HankHuang0516/openclaw-channel-eclaw/main/package.json', { encoding: 'utf8' });
222
+ var latestVersion = JSON.parse(pkgJson).version;
223
+ console.log('Installing @eclaw/openclaw-channel@' + latestVersion + ' ...');
224
+ var out = execSync('openclaw plugins install @eclaw/openclaw-channel@' + latestVersion + ' 2>&1', { encoding: 'utf8' });
212
225
  console.log(out);
213
226
 
214
227
  // 5. Restore channel config
@@ -239,6 +252,28 @@ In-process restart validates the config before loading plugins, so `channels.ecl
239
252
  3. In E-Claw Portal, confirm the entity shows as channel-bound (green dot)
240
253
  4. Check server logs: `curl "https://eclawbot.com/api/logs?deviceId=...&deviceSecret=...&limit=20"`
241
254
 
255
+ ## Major Fix History
256
+
257
+ A record of critical bug fixes, when they occurred, the problem, and the countermeasure.
258
+
259
+ ---
260
+
261
+ ### 2026-03-08 — v1.1.2: Callback URL overwritten after server restart
262
+
263
+ **Problem:**
264
+ When the E-Claw backend restarted (triggered by PostgreSQL DNS failure or Railway redeploy), the OpenClaw channel plugin re-registered its callback URL on reconnect. If `ECLAW_WEBHOOK_URL` or `account.webhookUrl` was misconfigured (e.g. `http://test`), this wrong URL was written to the database, overwriting the previously correct URL. The bot then stopped receiving messages silently — no error, no alert.
265
+
266
+ **Root cause:**
267
+ - `POST /api/channel/register` in the backend had no URL validation (no format check, no localhost rejection, no placeholder detection, no handshake test)
268
+ - The plugin re-registers unconditionally on every startup with whatever URL it has configured
269
+
270
+ **Countermeasure:**
271
+ - Validate `ECLAW_WEBHOOK_URL` / `webhookUrl` before starting: ensure it is a reachable HTTPS URL (not `localhost`, not `http://test`, not empty)
272
+ - If URL is invalid, log a clear error and refuse to register rather than writing a broken URL to the database
273
+ - Users should verify `ECLAW_WEBHOOK_URL` is set to their OpenClaw's public URL in Zeabur environment variables
274
+
275
+ ---
276
+
242
277
  ## License
243
278
 
244
279
  MIT
@@ -33,15 +33,6 @@ export const eclawOnboardingAdapter = {
33
33
  initialValue: resolved.apiKey || '',
34
34
  validate: (v) => (String(v ?? '').trim() ? undefined : 'Required'),
35
35
  });
36
- const entityIdStr = await prompter.text({
37
- message: 'Entity ID (0–3)',
38
- placeholder: '0',
39
- initialValue: String(resolved.entityId ?? 0),
40
- validate: (v) => {
41
- const n = Number(v);
42
- return Number.isInteger(n) && n >= 0 && n <= 3 ? undefined : 'Must be 0–3';
43
- },
44
- });
45
36
  const botName = await prompter.text({
46
37
  message: 'Bot display name (optional)',
47
38
  placeholder: 'My Bot',
@@ -63,7 +54,7 @@ export const eclawOnboardingAdapter = {
63
54
  [accountId]: {
64
55
  apiKey: String(apiKey).trim(),
65
56
  apiBase: resolved.apiBase || 'https://eclawbot.com',
66
- entityId: Number(entityIdStr),
57
+ entityId: resolved.entityId, // keep existing if re-configuring, else undefined = auto-assign
67
58
  botName: String(botName).trim() || undefined,
68
59
  webhookUrl: String(webhookUrl).trim() || undefined,
69
60
  enabled: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclaw/openclaw-channel",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "E-Claw channel plugin for OpenClaw — AI chat platform for live wallpaper entities",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",