Merged
Size
M
Change Breakdown
Feature65%
Bug Fix25%
Docs10%
#66226[codex] Telegram: unblock status commands behind busy turns

Status commands unblocked in busy Telegram chats

Status commands unblocked in busy Telegram chats

Telegram status commands like /status, /help, and /commands now respond instantly even when a chat has an in-flight conversation turn—without breaking reply ordering for regular messages.

Telegram users who rely on slash commands for quick status checks hit a frustrating delay: when a bot was busy processing a long conversation turn, even simple commands like /help or /status had to wait in line behind it. Status commands were serialized onto the same lane as regular messages, so they got stuck waiting their turn like any ordinary message.

A change to the Telegram extension's sequentializer now routes read-only status commands onto a separate control lane. Commands categorized as "status" in the command registry—including /status, /help, /commands, and their aliases—now execute immediately on request, bypassing any active turn in that chat or topic. Regular messages still serialize correctly through the per-chat lane, maintaining conversation order.

One exception was made intentionally: the /export-session command stays on the normal lane because it writes session state to disk and could corrupt an in-flight turn if it interleaved. The change is limited to read-only status commands to avoid session-mutation races.

The fix applies to the Telegram extension in the extensions/telegram package, targeting users who run multi-turn conversations in group chats or threaded topics.

View Original GitHub Description

Summary

  • route Telegram status-category slash commands (/status, /help, /commands, and similar read-only status commands) onto the existing control sequentializer lane
  • keep ordinary Telegram messages on the existing per-chat/per-topic lane so streaming and reply ordering stay serialized
  • add regression coverage for a busy topic plus /status bypass, and for normal same-topic message serialization

Root cause

Telegram's inbound updates are sequentialized before native command dispatch. /status was using the same per-chat/per-topic lane as ordinary conversation messages, so a busy in-flight turn blocked the command until that lane drained.

Design

  • classify status-category slash commands in extensions/telegram/src/sequential-key.ts using the existing shared command registry
  • map only those status commands to telegram:<chatId>:control, reusing the same bypass pattern already used for fast control handling
  • leave ordinary messages, /btw, approval callbacks, and mutating slash commands on their existing lanes

Before

A /status command sent into a busy Telegram chat/topic waited behind the active conversation turn.

After

/status, /help, /commands, and other status-category slash commands respond immediately even when the current Telegram chat/topic already has an in-flight turn, while ordinary same-topic messages still serialize in order.

Risks

The bypassed commands can now interleave visibly with an in-flight topic turn. That is intentional, but the change stays limited to read-only/status commands to avoid broad session-mutation races.

Validation

  • pnpm test extensions/telegram/src/sequential-key.test.ts extensions/telegram/src/bot.create-telegram-bot.test.ts
  • pnpm build
© 2026 · via Gitpulse