Skip to content

Releases: PsychQuant/che-msg

v0.5.0 — auth_run + coalesced auth (BREAKING)

26 Apr 01:41

Choose a tag to compare

che-telegram-all-mcp v0.5.0 — coalesced auth + auto-fire chain + auth_run

Highlight: a single MCP tool (auth_run) drives the entire authentication state machine, env vars cover 3 of 4 auth steps automatically, and concurrent auth calls no longer race against TDLib.

⚠️ Breaking change

  • TDLibClient.authState direct property access removed. Was public private(set) var, now private. Callers MUST use getAuthState() -> AuthState (lock-protected). Internal API; all in-tree callers already updated.

Added

  • auth_run MCP tool — single state-machine driver. Optional args phone / code / password; routes to the matching TDLib method based on current authState. When TELEGRAM_API_ID/HASH, TELEGRAM_PHONE, or TELEGRAM_2FA_PASSWORD are present in env, those steps auto-fire. The legacy per-step tools remain as escape hatches.
  • auth_status structured response {state, next_step, last_error}next_step is null at ready/closed, otherwise {tool, required_args, hint}. last_error surfaces auto-fire failures (e.g., FLOOD_WAIT_30) as {type, code, message} so AI agents can recover programmatically.
  • autoSendPhoneIfAvailable() — third step of the auto-fire chain. SMS verification code remains caller-only (one-shot delivery rule, never auto-fired from env).
  • OSAllocatedUnfairLock protects authState, cachedApiId, cachedApiHash, lastAutoFireError, and four task-coalescing slots. Critical sections forbid await (non-reentrant lock).
  • Coalesced Task patternTaskFieldHolder + coalesceTask(holder:body:) in new AuthCoalescing.swift. Concurrent callers of the four auth methods share a single in-flight TDLib request and observe the same outcome.
  • Pure decision helpers in new files: AutoFire.swift (decideAutoFire), AuthResponses.swift (decideAuthRunAction, authStatusResult).
  • 5 new test files / 46 cases. Total: 137 tests / 0 failures.
  • New capability spec: telegram-auth-coordination. Modified: telegram-auth-error-reporting (auto-fire failure surfacing).

Recommended auth flow

auth_run                 →  fires auto-set params (if env present)
auth_run                 →  fires auto-send phone (if env present)
auth_run(code: "12345")  →  caller MUST supply SMS code
auth_run                 →  fires auto-send 2FA password (if env present)
auth_run                 →  state == "ready"

Each call returns {state, next_step, last_error}. next_step.required_args tells you exactly which arg the next call needs.

Closes

Out of scope

Assets

  • CheTelegramAllMCP — Mach-O universal binary (arm64 + x86_64), macOS 13+
  • CheTelegramBotMCP — unchanged from v0.4.3 (no source change in bot package)
  • che-telegram-all-mcp.mcpb — packed bundle for one-click MCP install
  • che-telegram-bot-mcp.mcpb — unchanged from v0.4.3

Install / upgrade

curl -L https://github.com/PsychQuant/che-msg/releases/download/v0.5.0/CheTelegramAllMCP \
  -o ~/bin/CheTelegramAllMCP
chmod +x ~/bin/CheTelegramAllMCP
xattr -dr com.apple.quarantine ~/bin/CheTelegramAllMCP

v0.4.3 — che-telegram-all-mcp TDLib auth error handling

25 Apr 16:05

Choose a tag to compare

v0.4.3 — che-telegram-all-mcp TDLib auth error handling

Closes the v0.2.0 prebuilt auth flow regression (che-telegram-all-mcp#1).

Highlights

Authentication flow (rolled up from v0.3.0+)

  • JSON decoder snake_case bug fixed (was v0.3.0 source-only). The v0.2.0 prebuilt's JSONDecoder lacked .convertFromSnakeCase, silently dropping every TDLib Update broadcast. authState froze at waitingForParameters regardless of TDLib's real state machine. v0.4.3 ships the fix and adds a regression test (JSONDecoderRegressionTests) so this can never silently regress again.
  • Structured TDLib errors (new in v0.4.3). Auth tool failures now return JSON {"type":"tdlib_error","code":<int>,"message":<string>} with isError: true. AI agents can parse code: 420 FLOOD_WAIT_30 etc. without regex on free-text. Replaces the opaque "TDLibKit.Error error 1" masking.
  • TDLib code 406 silent-ignore per protocol contract — auth methods no longer surface code-406 errors to callers, matching TDLib's own "must not be processed" requirement.

Other features (v0.3.0–v0.4.2 rollup)

  • dump_chat_to_markdown MCP tool (v0.4.0)
  • get_chat_history extended with since_date, until_date, max_messages (v0.4.1)
  • DST fall-back fix in date parsing (v0.4.2)
  • Hard-fail validation for date format + max_messages boundaries (v0.4.2)

See che-telegram-all-mcp/CHANGELOG.md for the full v0.2.0 → v0.4.3 walk.

Universal binary

Both CheTelegramAllMCP and CheTelegramBotMCP are now Mach-O universal binaries (arm64 + x86_64). Apple Silicon and Intel Mac users get the same artifact — no separate Intel build needed.

$ file CheTelegramAllMCP
CheTelegramAllMCP: Mach-O universal binary with 2 architectures: [x86_64] [arm64]

Known limitations / follow-ups

  • Auto-set Task race: tracked at che-telegram-all-mcp#2. If you have TELEGRAM_API_ID/TELEGRAM_API_HASH env vars set AND immediately call auth_set_parameters MCP tool right after server start, two concurrent setTdlibParameters may race. Workaround: skip manual auth_set_parameters when env vars are set (the auto-set Task handles it).

Install

The che-telegram-mcp plugin's wrapper auto-downloads the latest release. If you have the plugin installed:

/plugin update che-telegram-mcp@psychquant-claude-plugins

Or manual install:

curl -L https://github.com/PsychQuant/che-msg/releases/download/v0.4.3/CheTelegramAllMCP -o ~/bin/CheTelegramAllMCP
chmod +x ~/bin/CheTelegramAllMCP
xattr -dr com.apple.quarantine ~/bin/CheTelegramAllMCP

Mirror

Source code mirror at PsychQuant/che-telegram-all-mcp@v0.4.3 — same binary, same notes.

v0.4.1 — get_chat_history fixes + auto-download wrappers

16 Apr 07:29

Choose a tag to compare

🎯 Highlights

  • Fix get_chat_history first-call returning only 1 message when from_message_id=0 (#3)
  • Feature get_chat_history now exposes since_date, until_date, max_messages (#4)
  • Release infrastructure — first official release with universal binaries + .mcpb packages
  • Wrapper auto-download — che-telegram-all-mcp wrapper now auto-downloads from GitHub Release

📦 Assets

File Platform Size Use
CheTelegramBotMCP macOS universal (arm64 + x86_64) ~17MB Bot API binary (direct install to ~/bin/)
CheTelegramAllMCP macOS universal (arm64 + x86_64) ~226MB TDLib personal binary (direct install to ~/bin/)
che-telegram-bot-mcp.mcpb Claude Desktop ~4MB Double-click to install
che-telegram-all-mcp.mcpb Claude Desktop ~54MB Double-click to install

🚀 Install

Claude Code (plugin, auto-download)

Already using che-telegram-mcp plugin? The wrapper will auto-download these binaries on next use.

Claude Code (manual CLI)

curl -L https://github.com/PsychQuant/che-msg/releases/download/v0.4.1/CheTelegramBotMCP -o ~/bin/CheTelegramBotMCP
curl -L https://github.com/PsychQuant/che-msg/releases/download/v0.4.1/CheTelegramAllMCP -o ~/bin/CheTelegramAllMCP
chmod +x ~/bin/CheTelegramBotMCP ~/bin/CheTelegramAllMCP

Claude Desktop (one-click)

Download .mcpb file below and double-click to install.


See CHANGELOG for detailed changes.