You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address review on #176 — edit parse_mode regression, feed file mode and location
- edit_message: only forward parse_mode when the caller set it. Telethon
treats an explicit None as "disable parsing" while an omitted argument
uses its default parser, so passing None unconditionally turned
previously formatted edits (**bold**) into literal text.
- Feed file is now opened via os.open(O_CREAT|O_APPEND, 0o600) with an
fchmod fallback, so an existing or externally rotated 0644 file is
tightened too — Path.touch(mode=...) only applies its mode on creation.
- Feed default path no longer derives from __file__ (unwritable under a
read-only site-packages or container layer): it follows XDG state
(${XDG_STATE_HOME:-~/.local/state}/telegram-mcp/incoming_feed.jsonl) and
creates that directory. An explicit TELEGRAM_EVENT_FEED_FILE still must
point at an existing directory so typos fail loudly.
Tests: 6 new (default location, dir creation, 0600 on create/existing/
rotated, parse_mode forwarding); suite 200 passed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ By default, an agent waits for replies by calling `wait_for_settled_message`, wh
60
60
61
61
Clients that can wake an agent on external output (Claude Code's persistent `Monitor` on `tail -f`) can switch to callback mode instead:
62
62
63
-
1. The agent calls `enable_incoming_feed` (or set `TELEGRAM_EVENT_FEED=1` in the environment to auto-enable). Each settled incoming burst is appended as one JSON line to `incoming_feed.jsonl` (path configurable via `TELEGRAM_EVENT_FEED_FILE`).
63
+
1. The agent calls `enable_incoming_feed` (or set `TELEGRAM_EVENT_FEED=1` in the environment to auto-enable). Each settled incoming burst is appended as one JSON line to `${XDG_STATE_HOME:-~/.local/state}/telegram-mcp/incoming_feed.jsonl`, created owner-only (0600). Override the path with `TELEGRAM_EVENT_FEED_FILE` — an explicit path's directory must already exist. `incoming_feed_status` reports the effective path and a ready-to-use watch command.
64
64
2. The agent arms a persistent Monitor with the `watch_command` returned by the tool. Every new line re-invokes the agent with the burst summary; no blocking tool call is held open, and the chat stays free.
65
65
66
66
`disable_incoming_feed` switches back; `incoming_feed_status` reports the current mode. While the feed is enabled it consumes settled bursts, so don't combine it with `wait_for_settled_message`. Feed lines contain user-generated `name` fields — treat them as untrusted data.
0 commit comments