OpenParable
Skip to content
← Back to skills

MTProto Client Behavior Matrix

Testing & Quality

MTProto Client Behavior Matrix is an Agent Skill for testing & quality published in the sleep3r/mtproto.zig repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Version-pinned Telegram client connection behavior notes for proxy compatibility debugging.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/sleep3r/mtproto.zig/blob/HEAD/.agent/skills/client-behavior/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/mtproto-client-behavior-matrix, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

MTProto Client Behavior Matrix

Use this skill when behavior differs by client platform (iOS/Android/Desktop) or when tuning relay/handshake timeouts.

Evidence Policy

  • Do not publish behavior claims without evidence.
  • Accept only:
    • reproducible local captures/logs, or
    • direct client source links pinned to a tag and commit.
  • Mark each claim as source-backed or field-capture.

iOS (Telegram iOS)

Version snapshot:

  • Repo/tag: TelegramMessenger/Telegram-iOS build-26855
  • Commit: b16d9acdffa9b3f88db68e26b77a3713e87a92e3

Source-backed behavior:

Field-capture behavior (proxy-side observations):

  • Pre-warms multiple idle sockets.
  • Can split 64-byte obfuscation handshake across TLS records.
  • May delay first payload after ServerHello.

Proxy implications:

  • Assemble handshake bytes until full 64-byte payload is complete.
  • Keep generous handshake stage timeout; tighten only after relay is active.
  • Do not treat short idle prewarmed sockets as protocol failure.

Android (Telegram Android)

Version snapshot:

  • Repo/ref: DrKLO/Telegram master (snapshot: 12.6.4 (6666))
  • Commit: 009e97356f966bb81eceba113d210230bf383122

Source-backed behavior:

Proxy implications:

  • Expect several concurrent connection attempts from one device/session.
  • Treat connect churn as normal; optimize for quick accept + cheap close path.

Desktop (Windows/Linux/macOS via Telegram Desktop)

Version snapshot:

  • Repo/tag: telegramdesktop/tdesktop v6.7.2
  • Commit: 085c4ba65d1f8aa13abf0fd7fc8489f094552542

Source-backed behavior:

Linux/macOS note:

  • In reviewed MTProto sources, timeout/retry logic is shared with Windows path (no observed OS-specific branching there).
  • Validate package/channel specifics separately (Snap/DEB/Flatpak/macOS build IDs) before asserting behavioral deltas.

Proxy implications:

  • Expect candidate racing and early cancellation patterns.
  • Keep reconnect path cheap and non-blocking.
  • Do not overfit timeout policy to a single desktop platform.

Practical Use Checklist

  • If one platform fails and others pass, first compare known timeout model for that client.
  • Verify whether failures happen pre-handshake, in 64-byte obfuscation phase, or after relay starts.
  • Inspect whether client behavior is expected parallel racing vs actual proxy regression.
  • Update this skill only with pinned sources or reproducible captures.