clawgram 2.13.0 → 2.13.1

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/dist/channel.js CHANGED
@@ -1305,7 +1305,11 @@ const createChannelPlugin = (runtimes, pluginRuntime) => {
1305
1305
  };
1306
1306
  },
1307
1307
  extractToolSend: ({ args }) => (0, tool_send_1.extractToolSend)(args, "sendMessage"),
1308
- handleAction: async ({ action, params, cfg, accountId, dryRun, toolContext }) => {
1308
+ handleAction: async ({ action, params, cfg, accountId, dryRun: dryRunFlag, toolContext }) => {
1309
+ // Core passes the flag beside `params`; callers write it inside.
1310
+ // Both count, because a rehearsal flag that is silently ignored puts
1311
+ // a real message in a real chat — twice, so far (2.13.1).
1312
+ const dryRun = (0, helpers_1.resolveDryRun)(dryRunFlag, params);
1309
1313
  // `read` is what OpenClaw core dispatches (`openclaw message read`,
1310
1314
  // MCP `messages_read`). `list` is accepted as a synonym so a caller that
1311
1315
  // guessed the other obvious name is not silently refused.
package/dist/helpers.js CHANGED
@@ -38,6 +38,7 @@ exports.resolveSenderProfileWithTimeout = resolveSenderProfileWithTimeout;
38
38
  exports.normalizeParseMode = normalizeParseMode;
39
39
  exports.resolveReplyParseMode = resolveReplyParseMode;
40
40
  exports.resolveOutboundParseMode = resolveOutboundParseMode;
41
+ exports.resolveDryRun = resolveDryRun;
41
42
  const node_fs_1 = require("node:fs");
42
43
  const node_path_1 = __importDefault(require("node:path"));
43
44
  const core_1 = require("openclaw/plugin-sdk/core");
@@ -578,6 +579,25 @@ function resolveReplyParseMode(cfg, accountId) {
578
579
  const account = channel?.accounts?.[accountId] ?? channel;
579
580
  return normalizeParseMode(account?.replyParseMode);
580
581
  }
582
+ /**
583
+ * Whether this call is a rehearsal, from either position the flag can arrive.
584
+ *
585
+ * Core passes `dryRun` as a sibling of `params`. Callers put it inside
586
+ * `params`, next to `to` and `text`, because that is where every other
587
+ * parameter lives — and there it used to be read by nobody: the flag vanished
588
+ * and the send happened for real.
589
+ *
590
+ * That is the worst possible failure mode for a safety flag, and it has cost
591
+ * two irreversible messages in a work chat (2026-08-08, note 0066; and
592
+ * 2026-08-10 at 02:49 UTC, a bare "ping" the agent then could not delete,
593
+ * because this channel has no delete action). Either position now counts, and
594
+ * a disagreement resolves toward **not** sending: a caller who wrote
595
+ * "dry run" anywhere meant it somewhere.
596
+ */
597
+ function resolveDryRun(dryRun, params) {
598
+ const fromParams = params?.dryRun;
599
+ return dryRun === true || dryRun === "true" || fromParams === true || fromParams === "true";
600
+ }
581
601
  /**
582
602
  * Parse mode for the `send` action (2.13.0).
583
603
  *
@@ -2,7 +2,7 @@
2
2
  "id": "clawgram",
3
3
  "name": "Clawgram",
4
4
  "description": "Clawgram — personal Telegram (MTProto userbot) channel for OpenClaw. Your AI assistant reads and responds as you.",
5
- "version": "2.13.0",
5
+ "version": "2.13.1",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawgram",
3
- "version": "2.13.0",
3
+ "version": "2.13.1",
4
4
  "description": "Clawgram — personal Telegram (MTProto userbot) channel for OpenClaw. Your AI assistant reads and responds as you.",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {