Skip to content

Private bot topics: editForumTopic saves title/icon but existing clients keep old values #915

Open

Description

@artdaal

Summary

In a private chat with a bot in threaded mode, editForumTopic succeeds and saves the new title/icon, but existing Telegram clients keep displaying the original title/icon. A newly authorized Telegram Web K session displays the updated values.

I have not established whether the fault is missing server updates or client cache invalidation. I am reporting it here because it reproduces through the public Bot API and also through a direct MTProto bot request.

Reproduction

  1. Enable threaded mode for a bot and open its private chat in a Telegram client.

  2. Call createForumTopic with a name such as Topic A. The client displays the new topic with that name.

  3. Rename that topic through the public cloud Bot API:

    curl -sS -X POST "https://api.telegram.org/bot${BOT_TOKEN}/editForumTopic" \
      --data-urlencode "chat_id=${USER_ID}" \
      --data-urlencode "message_thread_id=${TOPIC_ID}" \
      --data-urlencode "name=Topic B"
  4. The API returns {"ok":true,"result":true}, but the client still displays Topic A. Fully closing and reopening the existing clients did not help in our tests.

  5. From an authorized session of the same user, read that bot's topics through messages.getForumTopics and messages.getForumTopicsByID. Both return Topic B for the exact topic ID.

  6. Open the same bot in a newly authorized Telegram Web K session. The new session displays Topic B.

Additional checks

  • Topic creation reaches the existing client. Subsequent renames of that same bot-created topic do not appear there.
  • The problem also affects user-created topics and native icon changes using IDs from getForumTopicIconStickers.
  • Sending only name, without icon_custom_emoji_id, produces the same visible failure.
  • It reproduces for both title_missing=true and title_missing=false, so that flag alone does not explain it.
  • The bot identity, user identity, topic root message and current messages' reply_to_top_id were checked against the reported conversation.
  • A direct messages.editForumTopic request from a separately authenticated, memory-only session of the same bot changes the diagnostic topic's title, but returns Updates(updates=[], seq=0).
  • No topic-edit service update was observed in bounded user-session observation windows of 18 and 22 seconds. This is a limited observation, not proof that no other connection received an update.
  • As a control, pinning and unpinning the same topic from the user session returned UpdatePinnedForumTopic. The original pin state was restored.

Expected behavior

Existing clients should receive or fetch the changed title/icon after a successful edit, without requiring a new account session. The forum documentation describes topic modifications as generating messageActionTopicEdit service messages.

Environment

  • Observed on November 1 and 2, 2026.
  • Public cloud Bot API at api.telegram.org, not a self-hosted server.
  • Private bot chat with threaded mode enabled, not a supergroup forum.
  • The user reports the stale values across their existing clients, including iOS. Exact client build numbers have not yet been collected.
  • Independently verified in a newly authorized Telegram Web K session: updated names and icons are visible there.
  • Integration: OpenClaw. The user reports that automatic renaming and native icons worked consistently within seconds of the first topic message before an OpenClaw update roughly 2 to 3 days before November 1. The failure appeared after that update. Exact last-good/first-bad versions have not yet been isolated. An integration regression remains a possibility; no client-side or server-side root cause is claimed.

Is this a known limitation or a missing update on the private bot topic edit path? If this belongs in another Telegram tracker, please point me to the right place.

Activity

  1. artdaal commented on Nov 1, 2026

    @artdaal
    Author

    Additional checks against older OpenClaw code:

    • The topic rename helper and native auto-label functions are unchanged across the inspected 2026.10.7, 2026.10.8 and 2026.10.9 packages.
    • Running the exported send helpers from 2026.10.7 and 2026.10.9 with their respective Grammy dependencies and an intercepted HTTP transport produces identical editForumTopic JSON payloads.
    • A live call using the 2026.10.7 send helper in a separate process, outside the active Gateway send path, successfully changed the diagnostic topic title on the server. An independent user-session readback confirmed the changed title. The already-open Web K session continued displaying the previous title.

    This reproduces the stale display using older sending code as well. It is not a full environment rollback test: the host, Node runtime and account were unchanged. I am not treating the timing of the integration update as proof of the cause.

  2. Ambboy commented on Nov 2, 2026

    @Ambboy

    Additional reproduction: Hermes

    We have observed a closely matching failure in a different integration (Hermes with a custom topic-styling plugin).

    Observations from our own tests

    • The affected conversation is a private chat with bot topics, not a supergroup forum.
    • The earliest retained owner complaint is October 31, 2026. We cannot establish the exact last-good operation.
    • On November 1, direct HTTP editForumTopic requests through both the configured self-hosted Bot API and api.telegram.org returned HTTP200 / ok=true / result=true. These requests bypassed our plugin's model/worker and python-telegram-bot. The owner reported no visible name/icon change after these calls.
    • Subsequent read-only messages.getForumTopicsByID calls authenticated as the same bot returned the requested title and custom emoji ID for the addressed topic. A second newly created topic on November 2 showed the same pattern: desired values in the bot-authorized server response; the owner reported New Thread still visible.
    • The owner reported the latest diagnostic edit missing on both iOS and desktop. Older topics were reported as already styled. We have not obtained a user-authorized server readback or raw user-side TopicEdit update, so we cannot independently confirm the fresh-Web-session result in the original issue.
    • Bot/chat identity and native incoming message_thread_id were checked. The Bot API root service-message ID differs from message_thread_id in this private-topic path; we did not substitute one for the other.
    • Both affected and previously styled control topics had title_missing=true in the bot readback; this flag alone did not distinguish them.
    • No exact TopicEdit event was available in the retained bot update queue. That observation does not prove that Telegram emitted no update or that another connection received none. No second getUpdates consumer was started.

    We have not established whether the failure is in server-side update generation, delivery, or client application of an update. We are not treating the timing of integration changes as proof of causation. Rewriting the local name/icon selection logic did not establish a repair for this visible symptom.

    Is there a supported read-only observation that would distinguish missing private-topic update generation from incorrect client-side topic-key handling? Are there any additional diagnostics that would help without replaying edits or requiring a new user login?

  3. levlam commented on Nov 2, 2026

    @levlam
    Contributor

    This will be fixed after updates of user apps. There is no way to fix this from the bot's side.

  4. aspalagin commented on Nov 4, 2026

    @aspalagin

    Independent reproduction from another OpenClaw installation (public cloud Bot API, private bot chat with topics enabled), with two additions: the same thing happens when the user renames the topic from their own account, and an explanation of why Telegram for Android specifically never catches up.

    1. The server stores the new title but creates no service message and no update for it

    Timeline, 2026-11-04 (UTC):

    • 18:35:37 — the bot calls createForumTopic with name … · A. A second MTProto session of the same user account, running as a passive observer, receives updateNewMessage with messageActionTopicCreate (title A).
    • between 18:35:37 and 18:37:06 — the bot calls editForumTopic (A → B) through api.telegram.org, response {"ok":true,"result":true}.
    • 18:37:06 — the user's own account (not the bot) calls MTProto messages.editForumTopic(peer=<bot>, topic_id=…, title="… · C"). The server answers Updates(updates=[], seq=0). An immediate messages.getForumTopicsByID from the same session returns … · C.
    • 18:39:01 — the topic's history, read from the user session, contains only the messageActionTopicCreate service message with title A. No messageActionTopicEdit exists for either rename, so there is nothing for any client to receive; this is not a delivery problem of a single connection.
    • The observer session saw no topic-related update for either rename. Caveat: it received a steady stream of unrelated updates (userStatus / userTyping / editMessage, roughly one per second) until 18:36:52 and nothing at all after that until it exited at 18:40:11, so it is only meaningful for events before 18:36:52.

    For supergroup forums the same edit produces messageActionTopicEdit (https://core.telegram.org/api/forum#managing-topics); the private bot topic path does not.

    2. Why Telegram for Android keeps the old title (13.1.1, build 7237, direct APK from telegram.org)

    The phone still showed … · A after both renames (screenshot at 18:40 UTC). From the source of that exact build (TelegramMessenger/Telegram-Android@3de37c8, "update to 13.1.1 (7237)"):

    • The title of an already known topic is updated only from a messageActionTopicEdit service message: MessagesStorage.java#L13330-L13350 → updateTopicData(TOPIC_FLAG_TITLE) → TopicsController.updateTopicInUi.
    • When topics are (re)loaded from the server (messages.getForumTopics / getForumTopicsByID), TopicsController.processTopics merges only closed into a topic that is already in topicsMap (the else if (!newTopic.isShort) branch); title and icon_emoji_id from the server response are ignored. A topic takes the server title only when it is not yet known locally.
    • Topics are persisted in the local topics table and loaded from it on start, so restarting the app replays the stale title. They are dropped only by clearLocalDatabase() (Settings → Data and Storage → Storage Usage → Clear Local Database), logout or reinstall. This matches the "a new session sees the new title" observation above.

    So with (1) + (2) there is no sequence of Bot API calls that makes an existing Android client display a new title for a topic it already has. Only the name passed to createForumTopic is reliably visible, because messageActionTopicCreate is delivered.

    3. Desktop / iOS (from source only, not tested live)

    Question

    Is the absence of messageActionTopicEdit / any update for private bot topic edits intended server behaviour, so that clients are expected to re-read title / icon_emoji_id from getForumTopics? If so, the Android fix is in TopicsController.processTopics (merge title / icon_emoji_id for known topics, not only closed). If the server will also start emitting the service message, Android would be fixed without a client change. Knowing which it is would help bot developers decide whether editForumTopic on existing private topics is usable at all until users update.

    Workaround until then: set the final name in createForumTopic, and treat editForumTopic on an existing private topic as invisible to Android users who already have the topic cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions