Releases: PsychQuant/che-msg
v0.5.0 — auth_run + coalesced auth (BREAKING)
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.authStatedirect property access removed. Waspublic private(set) var, nowprivate. Callers MUST usegetAuthState() -> AuthState(lock-protected). Internal API; all in-tree callers already updated.
Added
auth_runMCP tool — single state-machine driver. Optional argsphone/code/password; routes to the matching TDLib method based on currentauthState. WhenTELEGRAM_API_ID/HASH,TELEGRAM_PHONE, orTELEGRAM_2FA_PASSWORDare present in env, those steps auto-fire. The legacy per-step tools remain as escape hatches.auth_statusstructured response{state, next_step, last_error}—next_stepisnullat ready/closed, otherwise{tool, required_args, hint}.last_errorsurfaces 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).OSAllocatedUnfairLockprotectsauthState,cachedApiId,cachedApiHash,lastAutoFireError, and four task-coalescing slots. Critical sections forbidawait(non-reentrant lock).- Coalesced Task pattern —
TaskFieldHolder+coalesceTask(holder:body:)in newAuthCoalescing.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
- PsychQuant/che-telegram-all-mcp#2 (auto-set Task race fix)
- PsychQuant/che-telegram-all-mcp#4 (auto-flow trigger; merged into #2)
Out of scope
- PsychQuant/che-telegram-all-mcp#3 (cross-machine session sync) — separate SDD when needed.
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 installche-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/CheTelegramAllMCPv0.4.3 — che-telegram-all-mcp TDLib auth error handling
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
JSONDecoderlacked.convertFromSnakeCase, silently dropping every TDLibUpdatebroadcast.authStatefroze atwaitingForParametersregardless 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>}withisError: true. AI agents can parsecode: 420 FLOOD_WAIT_30etc. 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_markdownMCP tool (v0.4.0)get_chat_historyextended withsince_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_messagesboundaries (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
Taskrace: tracked at che-telegram-all-mcp#2. If you haveTELEGRAM_API_ID/TELEGRAM_API_HASHenv vars set AND immediately callauth_set_parametersMCP tool right after server start, two concurrentsetTdlibParametersmay race. Workaround: skip manualauth_set_parameterswhen 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/CheTelegramAllMCPMirror
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
🎯 Highlights
- Fix
get_chat_historyfirst-call returning only 1 message whenfrom_message_id=0(#3) - Feature
get_chat_historynow exposessince_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/CheTelegramAllMCPClaude Desktop (one-click)
Download .mcpb file below and double-click to install.
See CHANGELOG for detailed changes.