Skip to content

fix(telegram): preserve inline buttons for empty capabilities#96468

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/issue-96098
Jun 24, 2026
Merged

fix(telegram): preserve inline buttons for empty capabilities#96468
vincentkoc merged 3 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/issue-96098

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #96098.

Telegram configs with the legacy array shape channels.telegram.capabilities: [] were treated as an explicit inline-buttons opt-out. That made the Telegram agent prompt omit inlineButtons, so button choices could degrade into plain text even though the documented default scope is allowlist.

Note: the inlineQueries=false capability probe shown by openclaw channels capabilities --channel telegram is Telegram Bot API supportsInlineQueries, not OpenClaw's message-tool inlineButtons capability. The broken path here is the prompt capability resolver.

Why This Change Was Made

The fix only changes the empty legacy array case to use the default inline-buttons scope. It intentionally preserves existing semantics for non-empty legacy arrays:

  • capabilities: ["inlineButtons"] still maps to all.
  • Non-empty arrays without inlineButtons still map to off.
  • Object config such as capabilities: { inlineButtons: "off" } still explicitly disables buttons.

This keeps the fix narrow and preserves explicit opt-out behavior.

User Impact

Users with existing Telegram config that contains an empty legacy capabilities array get the default allowlist inline-button prompt capability again. Explicit Telegram inline-button opt-outs remain respected.

Evidence

Before fix on main source repro:

resolver=off
messageToolCapabilities=[]

After fix source/runtime repro:

resolver=allowlist
messageToolCapabilities=["inlineButtons"]

Live Telegram/OpenClaw proof with channels.telegram.capabilities: [] and a real bot send; private chat identifiers redacted:

agentPrompt.capabilities=["inlineButtons"]
agentPrompt.hasInlineButtons=true
telegram.sent=true
telegram.inlineKeyboardRows=1
telegram.firstButton={"text":"Issue 96098 proof","callback_data":"oc96098"}

Local checks after rebasing on origin/main:

pnpm test extensions/telegram/src/inline-buttons.test.ts extensions/telegram/src/channel-actions.contract.test.ts
Test Files 2 passed (2)
Tests 27 passed (27)

npx oxlint --deny=warn --ignore-path=.oxlintignore extensions/telegram/src/inline-buttons.ts extensions/telegram/src/inline-buttons.test.ts extensions/telegram/src/channel-actions.contract.test.ts
passed

npx oxfmt --check extensions/telegram/src/inline-buttons.ts extensions/telegram/src/inline-buttons.test.ts extensions/telegram/src/channel-actions.contract.test.ts
All matched files use the correct format.

Independent review:

No Critical or Important findings. Minor request to cover non-empty legacy arrays without inlineButtons was addressed with a prompt-capability negative test.

Additional local sweep:

pnpm test extensions/telegram
Test Files 1 failed | 123 passed (124)
Tests 1 failed | 2208 passed (2209)

The failing test is outside this diff: extensions/telegram/src/setup-surface.test.ts expects Telegram allowFrom (numeric sender id) but current output is Telegram allowFrom(数字发送者 ID).

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS labels Jun 24, 2026
@vincentkoc vincentkoc self-assigned this Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 11:38 AM ET / 15:38 UTC.

Summary
The PR makes empty Telegram legacy capabilities arrays resolve to default inline-button behavior, makes empty per-account arrays inherit channel capabilities, and adds resolver, prompt-capability, and action-runtime regression tests.

PR surface: Source +7, Tests +82. Total +89 across 5 files.

Reproducibility: yes. from source: current main and v2026.6.10 route an empty Telegram legacy capabilities array to off, and the prompt/action callers use that result to omit or reject inline buttons. I did not run a live Telegram repro in this read-only review, but the PR body includes redacted after-fix live output.

Review metrics: 1 noteworthy metric.

  • Telegram config fallback changed: 1 fallback changed, 0 config keys added. The diff changes how an existing Telegram config value is interpreted during upgrade, which is the main maintainer decision before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #96098
Summary: The linked issue is the canonical current-release Telegram inline-button regression; this PR is a candidate fix, and the older open PR is a same-root-cause candidate with weaker proof and less coverage.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Mantis proof suggestion
Native Telegram Desktop proof would directly show clickable inline buttons instead of plain-text choices for the empty-capabilities config. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify that channels.telegram.capabilities: [] restores clickable Telegram inline buttons instead of plain text.

Risk before merge

  • [P1] Merging changes the shipped interpretation of channels.telegram.capabilities: [] from disabling inline buttons to using the documented default, so maintainers should accept that empty arrays were not an intended opt-out signal.

Maintainer options:

  1. Accept the documented empty-array default (recommended)
    Merge with maintainer acknowledgement that capabilities: [] now behaves like no explicit inline-button setting and explicit disablement remains capabilities.inlineButtons: "off".
  2. Require an upgrade note first
    Ask for a short PR-body or docs note if maintainers believe some users intentionally used an empty legacy array as an inline-button opt-out.

Next step before merge

  • [P2] No automated code repair is needed; maintainers should accept the compatibility fallback semantics and choose this PR or the older candidate as the landing path.

Security
Cleared: The diff only changes Telegram config normalization and colocated tests; it does not touch secrets, dependencies, CI, package metadata, or code-execution surfaces.

Review details

Best possible solution:

Merge this narrow fix after maintainer acknowledgement that empty legacy arrays mean no explicit inline-button setting, while object-form inlineButtons: "off" remains the supported opt-out; close or retire the older same-root-cause candidate after one fix lands.

Do we have a high-confidence way to reproduce the issue?

Yes from source: current main and v2026.6.10 route an empty Telegram legacy capabilities array to off, and the prompt/action callers use that result to omit or reject inline buttons. I did not run a live Telegram repro in this read-only review, but the PR body includes redacted after-fix live output.

Is this the best way to solve the issue?

Yes. The resolver plus account-merge fallback is the narrowest maintainable layer because prompt capabilities, explicit sends, and callback handling all consume the same inline-button scope, and the PR preserves explicit opt-out behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fa2379dbc883.

Label changes

Label changes:

  • add P1: This PR targets a fresh Telegram regression that breaks an interactive channel workflow for a linked user report.
  • add merge-risk: 🚨 compatibility: The patch changes the runtime meaning of an existing Telegram capabilities value during upgrade.

Label justifications:

  • P1: This PR targets a fresh Telegram regression that breaks an interactive channel workflow for a linked user report.
  • merge-risk: 🚨 compatibility: The patch changes the runtime meaning of an existing Telegram capabilities value during upgrade.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted live Telegram/OpenClaw output showing capabilities: [] results in agentPrompt.hasInlineButtons=true and one inline keyboard row after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted live Telegram/OpenClaw output showing capabilities: [] results in agentPrompt.hasInlineButtons=true and one inline keyboard row after the fix.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram inline-button rendering, which can be demonstrated in a short Telegram Desktop proof.
Evidence reviewed

PR surface:

Source +7, Tests +82. Total +89 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 8 1 +7
Tests 3 82 0 +82
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 90 1 +89

What I checked:

Likely related people:

  • steipete: The documented allowlist default and scoped Telegram inline-buttons helper trace to the original inline-buttons feature history. (role: introduced behavior and adjacent owner; confidence: high; commits: 69761e8a51f9, f3f80509e329, d63cc1e8a711; files: src/telegram/inline-buttons.ts, docs/channels/telegram.md, extensions/telegram/src/inline-buttons.ts)
  • Ayaan Zaidi: Recent Telegram work unified inline-button capability parsing in the helper that contains the legacy array branch. (role: recent helper refactor author; confidence: high; commits: 39829b5dc6dc; files: extensions/telegram/src/inline-buttons.ts, extensions/telegram/src/exec-approvals.ts)
  • scoootscooob: The Telegram implementation, including the inline-buttons helper, moved from src/telegram into extensions/telegram in this migration. (role: migration owner; confidence: medium; commits: e5bca0832fbd; files: extensions/telegram/src/inline-buttons.ts, src/telegram/inline-buttons.ts)
  • vincentkoc: Live PR timeline shows this person assigned to this PR, and the current PR head includes their account-fallback regression test commit. (role: likely follow-up reviewer; confidence: medium; commits: 5e55b5dd308c; files: extensions/telegram/src/account-config.ts, extensions/telegram/src/inline-buttons.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels Jun 24, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 24, 2026
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Desktop Proof

Summary: Mantis captured native Telegram Desktop before/after GIF evidence for legacy Telegram inline-button rendering.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-96468/run-28109548031-1/index.json

@vincentkoc
vincentkoc merged commit 3217165 into openclaw:main Jun 24, 2026
102 of 104 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

Thanks @zhangguiping-xydt!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 25, 2026
…aw#96468)

Merged via squash.

Prepared head SHA: 5e55b5d
Co-authored-by: zhangguiping-xydt <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Reviewed-by: @vincentkoc
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
…aw#96468)

Merged via squash.

Prepared head SHA: 5e55b5d
Co-authored-by: zhangguiping-xydt <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Reviewed-by: @vincentkoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

[Bug]: Telegram inline buttons stopped working after update to 2026.6.9

2 participants