Skip to content

fix(telegram): fall back for web apps outside DMs - #111116

Merged
fuller-stack-dev merged 1 commit into
mainfrom
codex/telegram-web-app-dm-fallback
Jul 19, 2026
Merged

fuller-stack-dev merged 1 commit into
mainfrom
codex/telegram-web-app-dm-fallback

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where Telegram group, channel, or unconfirmed targets could receive a native Web App inline button that Telegram only accepts in private chats, causing delivery to be rejected.

Why This Change Was Made

Telegram now emits native Web App buttons only after the delivery target is confirmed as a direct chat. Group and unknown targets keep the original message and receive the portable HTTPS link as text; the low-level encoder also fails closed when chat context is absent.

User Impact

Direct-message Web Apps continue to open natively. Group, channel, and unresolved targets receive an understandable link fallback instead of a Telegram API error.

Evidence

AI-assisted: yes. I understand and reviewed the complete change.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S maintainer Maintainer-authored PR labels Jul 19, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 9:48 PM ET / July 19, 2026, 01:48 UTC.

Summary
The PR permits Telegram native Web App buttons only for confirmed direct chats and renders their HTTPS links as portable text for group, channel, and unresolved targets.

PR surface: Source +31, Tests +86. Total +117 across 10 files.

Reproducibility: yes. source-reproducible at medium confidence: the reported path is a native Telegram Web App button rendered for a non-direct target, which the patch routes to a link fallback. It was not independently exercised against the checked-out current main during this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • Verify the final merge result preserves native Web App buttons for every confirmed direct-message production funnel.

Mantis proof suggestion
A short Telegram Desktop recording can directly demonstrate both the retained direct-message Web App button and the group/channel link fallback. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify a Web App action stays native in a direct chat and falls back to an HTTPS link in a group chat; return redacted evidence.

Risk before merge

  • [P1] The default-deny encoder change can downgrade a direct-message Web App to a text link if any canonical presentation caller lacks confirmed target context; verify every production canonicalization funnel against the merge result.

Maintainer options:

  1. Verify all target-aware render callers (recommended)
    Confirm the merged code classifies direct chats consistently in each production presentation path, so valid DMs retain native Web App buttons.
  2. Accept safe link-only fallback
    Accept that targets lacking confirmed context render a portable HTTPS link, prioritizing delivery over native Web App presentation.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Recheck every production canonicalizeTelegramPresentationPayload and renderPresentation caller for confirmed target context; add focused coverage for any missing direct-message funnel.

Next step before merge

  • This protected, MEMBER-authored PR needs normal maintainer review and final target-context verification rather than an automated repair lane.

Security
Cleared: The submitted diff changes Telegram presentation selection and tests only; it adds no dependency, permission, credential, workflow, or code-execution surface.

Review details

Best possible solution:

Land only after confirming that every production Telegram send and render path supplies a correctly classified target, while retaining the safe link fallback for group, channel, and genuinely unresolved destinations.

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

Yes, source-reproducible at medium confidence: the reported path is a native Telegram Web App button rendered for a non-direct target, which the patch routes to a link fallback. It was not independently exercised against the checked-out current main during this read-only review.

Is this the best way to solve the issue?

Unclear pending full caller verification: passing explicit target capability into the shared canonicalizer is the right bounded design, provided all real send funnels can supply a reliably classified direct-chat target.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P1: The reported behavior can cause Telegram group or channel message delivery to be rejected for real users.
  • add merge-risk: 🚨 compatibility: The new default-deny Web App encoding changes existing Telegram presentation output when target context is absent or misclassified.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is authored by a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused and changed-gate CI evidence.
  • add mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes an observable Telegram outcome: native Web App buttons in direct chats versus link fallback in non-direct targets.

Label justifications:

  • P1: The reported behavior can cause Telegram group or channel message delivery to be rejected for real users.
  • merge-risk: 🚨 compatibility: The new default-deny Web App encoding changes existing Telegram presentation output when target context is absent or misclassified.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is authored by a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused and changed-gate CI evidence.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes an observable Telegram outcome: native Web App buttons in direct chats versus link fallback in non-direct targets.
Evidence reviewed

PR surface:

Source +31, Tests +86. Total +117 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 6 47 16 +31
Tests 4 103 17 +86
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 150 33 +117

What I checked:

  • Target-aware rendering across send funnels: The patch passes an explicit direct-chat capability into canonical presentation rendering in the delivery controller, reply delivery, and outbound adapter, rather than relying on one call site. (extensions/telegram/src/outbound-adapter.ts:145, 0ef738bfbfef)
  • Fallback behavior is covered in the submitted patch: The added outbound test expects negative-ID and username targets to receive a plain HTTPS-link fallback instead of a native Web App button. (extensions/telegram/src/outbound-adapter.web-app.test.ts:19, 0ef738bfbfef)
  • Maintainer handling signal: GitHub context identifies the author association as MEMBER and the PR carries the protected maintainer label; the review policy requires keeping such items open for explicit maintainer handling. (0ef738bfbfef)

Likely related people:

  • fuller-stack-dev: The supplied PR context identifies this MEMBER account as author of the sole commit implementing the Telegram target-aware fallback; no independent current-main history trail was available in the review context. (role: current implementation contributor; confidence: low; commits: 0ef738bfbfef; files: extensions/telegram/src/outbound-adapter.ts, extensions/telegram/src/interactive-fallback.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.

@fuller-stack-dev
fuller-stack-dev merged commit 047232b into main Jul 19, 2026
166 of 177 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the codex/telegram-web-app-dm-fallback branch July 19, 2026 01:52
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

1 participant