@alfe.ai/openclaw-telegram 0.0.1 → 0.0.2

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
@@ -8,7 +8,7 @@ The Telegram device session never leaves the agent machine. After enabling the
8
8
  Telegram Connection in Alfe, run:
9
9
 
10
10
  ```bash
11
- npx -y @alfe.ai/openclaw-telegram@0.0.1 login --agent-id <agent-id>
11
+ npx -y @alfe.ai/openclaw-telegram@0.0.2 login --agent-id <agent-id>
12
12
  ```
13
13
 
14
14
  If the package binary is already on `PATH`, `alfe-telegram login` is the
@@ -37,5 +37,5 @@ does not erase a logged-in device during an ordinary reinstall. Before retiring
37
37
  the machine, revoke the device session and remove its local state with:
38
38
 
39
39
  ```bash
40
- npx -y @alfe.ai/openclaw-telegram@0.0.1 logout --agent-id <agent-id>
40
+ npx -y @alfe.ai/openclaw-telegram@0.0.2 logout --agent-id <agent-id>
41
41
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/openclaw-telegram",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Local-custody Telegram MTProto user-session listener for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin.js",
package/python/bridge.py CHANGED
@@ -18,7 +18,7 @@ import sys
18
18
  import tempfile
19
19
  from datetime import datetime, timezone
20
20
  from pathlib import Path
21
- from typing import Any
21
+ from typing import Any, Optional
22
22
 
23
23
 
24
24
  STATE_VERSION = 1
@@ -202,7 +202,7 @@ class Bridge:
202
202
  self.client = client
203
203
  self.me = me
204
204
  self.shutting_down = False
205
- self.enqueue_lock = asyncio.Lock()
205
+ self._enqueue_lock: Optional[asyncio.Lock] = None
206
206
  self.queue_full_reported = False
207
207
 
208
208
  def save(self) -> None:
@@ -248,7 +248,12 @@ class Bridge:
248
248
  }
249
249
  if isinstance(sender_username, str) and sender_username:
250
250
  item["senderUsername"] = sender_username[:128]
251
- async with self.enqueue_lock:
251
+ # Python 3.9 binds asyncio primitives to the current loop when they are
252
+ # constructed. Bridge also serves synchronous state commands, so defer
253
+ # the lock until message handling guarantees that a loop is running.
254
+ if self._enqueue_lock is None:
255
+ self._enqueue_lock = asyncio.Lock()
256
+ async with self._enqueue_lock:
252
257
  pending = self.state["pending"]
253
258
  if len(pending) >= MAX_PENDING:
254
259
  if not self.queue_full_reported: