Skip to content

fix(telegram): clear stale localized command menus - #120885

Merged
steipete merged 2 commits into
mainfrom
steipete/nervous-elbakyan-2bb960
Aug 9, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/nervous-elbakyan-2bb960

Conversation

@steipete

@steipete steipete commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

AI-assisted: yes. I understand the command-menu reconciliation, durable locale state, and failure behavior in this change.

What Problem This Solves

Fixes an issue where users whose configured Telegram command localization was removed could keep seeing that stale localized menu. Telegram's neutral command deletion is not a wildcard for dedicated language variants, and gateway reloads could also overlap independent command-menu generations.

Why This Change Was Made

Telegram command-menu mutation now has one bot-owned serialized reconciliation path. A durable locale-only SQLite ledger keyed by Telegram bot ID records which exact locale pairs require cleanup, while the process-local command hash remains a non-authoritative rate-limit optimization. Reconciliation clears every known scope/language pair before publication, records locale intent before localized writes, retries incomplete cleanup without caching success, and removes the duplicate explicit-disable writer.

User Impact

Removed locales are explicitly cleared on future synchronized generations and restarts once they are known to the ledger, and menu updates for one bot can no longer overlap. No operator action or configuration change is required.

Release-note context: Telegram no longer leaves ledger-known localized command menus stale after their localization is removed, and reload-driven menu updates are serialized per bot.

Evidence

  • Focused final proof on the frozen implementation: 3 files, 169 tests passed. After rebasing onto current main and preserving its newly landed menu-pressure coverage: 3 files, 170 tests passed with node scripts/run-vitest.mjs extensions/telegram/src/bot-native-command-menu.test.ts extensions/telegram/src/bot-native-command-menu-sync.test.ts extensions/telegram/src/bot.create-telegram-bot.test.ts. The same 170-test proof passed again after the lint-only follow-up.
  • Lifecycle regressions cover publishing fr + ko then removing fr, queued generations, failed localized cleanup retry/no success hash, bot-ID ledger continuity across token rotation, and the empty-setMyCommands deletion fallback.
  • Blacksmith Testbox lease tbx_01kzjaaea11kw1z1q5fa5qsnc4 passed changed-surface checks for the original 10-file implementation, including extension/test typechecks, lint, plugin boundaries, dead exports, database-first storage, and import cycles.
  • Autoreview was clean before the implementation commit (patch correct 0.98) and after the lint-only follow-up (patch correct 1.0), with no accepted/actionable findings.
  • Exact-head CI succeeded for c815c6f5aa6dcd305c5254174df0f20f93c03b92: CI run 31295259045 and CodeQL Critical Quality run 31295259019. Targeted oxlint, formatting, and git diff --check passed.
  • ClawSweeper's exact-head artifact review completed with high confidence, no findings, and no risks in run 31295307677. Its public comment update was delayed by an installation rate limit.
  • Telegram's official deleteMyCommands contract states that an empty or omitted language_code is the neutral fallback for users without dedicated commands, not a wildcard: https://core.telegram.org/bots/api#deletemycommands

Known limitation: Telegram cannot enumerate locale variants published before this ledger existed. Unknown pre-ledger variants therefore cannot be discovered automatically; once a locale is ledger-known, later synchronized generations and restarts can clear it exactly.

Proof gap: no authenticated Telegram Desktop before/after recording was run. The exact Bot API contract, deterministic lifecycle regressions, Testbox checks, and exact-head hosted CI cover the repair; a redacted live recording would be stronger optional visible confirmation.

@openclaw-barnacle openclaw-barnacle Bot added the channel: telegram Channel integration: telegram label Aug 9, 2026
@steipete steipete self-assigned this Aug 9, 2026
@steipete
steipete marked this pull request as ready for review August 9, 2026 04:35
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 9, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 9, 2026
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label Aug 9, 2026
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

ClawSweeper follow-up on exact head c815c6f5aa6dcd305c5254174df0f20f93c03b92:

  • The immutable review artifact completed with high confidence, no findings, no risks, and recommended merging after exact-head checks.
  • The exact-head CI and CodeQL workflows are now successful.
  • The optional rank-up suggestion for a redacted Telegram Desktop before/after recording is not included: no authenticated live probe was available in this verified landing scope. The PR body now states that proof gap explicitly; the official Bot API contract, focused lifecycle regressions, Testbox checks, and exact-head CI provide the bounded proof used here.
  • The ClawSweeper public placeholder was not updated because its publication step hit a GitHub App rate limit; the completed artifact is retained in run 31295307677.

No re-review is requested: the review is under 12 hours old, covers the current head, has no actionable finding, and there has been no post-review behavior change.

@steipete
steipete merged commit ec866d8 into main Aug 9, 2026
118 of 119 checks passed
@steipete
steipete deleted the steipete/nervous-elbakyan-2bb960 branch August 9, 2026 05:15
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
* fix(telegram): clear stale localized command menus

* test(telegram): satisfy command menu lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant