Skip to content

fix(telegram): minimal threaded fallback when formatted text is empty#25096

Merged
obviyus merged 4 commits into
openclaw:mainfrom
Glucksberg:fix/25091-telegram-minimal
Feb 24, 2026
Merged

fix(telegram): minimal threaded fallback when formatted text is empty#25096
obviyus merged 4 commits into
openclaw:mainfrom
Glucksberg:fix/25091-telegram-minimal

Conversation

@Glucksberg

@Glucksberg Glucksberg commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #25091
Fixes #6652

Context

There are currently two valid fix strategies for the same Telegram empty-text bug class:

  1. Comprehensive path: fix(telegram): fall back to plain text when HTML formatter produces empty output #17629 (formatter + delivery safeguards) — now closed as stale
  2. Minimal path (this PR): fix(telegram): minimal threaded fallback when formatted text is empty #25096 (delivery fallback only)

This PR intentionally keeps scope small to speed review/merge if maintainers prefer the narrowest safe patch first.

What this PR changes (minimal)

  • src/telegram/bot/delivery.ts
    • If formatted htmlText is empty, send plain fallback text instead
    • On formatted send failure for parse/empty-text errors, retry with plain fallback text
  • src/telegram/bot/delivery.test.ts
    • Adds focused regression test for threaded-mode markdown that renders to empty HTML (> case)

Why this minimal option exists

Related history

Merge decision / cleanup

Either path is acceptable. When one fix path is selected for merge, the other PR can be closed.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (1)

src/telegram/bot/delivery.ts
shouldLog should also suppress EMPTY_TEXT_ERR_RE errors since they're now handled and retried (similar to parse errors)

      shouldLog: (err) => !PARSE_ERR_RE.test(formatErrorMessage(err)) && !EMPTY_TEXT_ERR_RE.test(formatErrorMessage(err)),
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/telegram/bot/delivery.ts
Line: 585

Comment:
`shouldLog` should also suppress `EMPTY_TEXT_ERR_RE` errors since they're now handled and retried (similar to parse errors)

```suggestion
      shouldLog: (err) => !PARSE_ERR_RE.test(formatErrorMessage(err)) && !EMPTY_TEXT_ERR_RE.test(formatErrorMessage(err)),
```

How can I resolve this? If you propose a fix, please make it concise.

@SamuelHinestrosa SamuelHinestrosa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revisión automática: Revisión completada. Verificar tests y compatibilidad.

@Glucksberg
Glucksberg force-pushed the fix/25091-telegram-minimal branch from f5d75c5 to 1b65161 Compare February 24, 2026 10:34
@Glucksberg

Copy link
Copy Markdown
Contributor Author

Linking original issue for fast re-triage as requested by @steipete in #17629:

Related: Fixes #6652 ("Telegram: empty message sent when reply contains markdown tables")

This PR (#25096) is the minimal delivery-layer fix for the same bug class. Fresh repro confirmed in #25091 on current main.

@obviyus obviyus self-assigned this Feb 24, 2026
Glucksberg and others added 4 commits February 24, 2026 22:25
…empty

Minimal fix path for Telegram empty-text failures in threaded replies.

- fallback to plain text when formatted htmlText is empty
- retry plain text on parse/empty-text API errors
- add focused regression test for threaded mode case

Related: openclaw#25091
Supersedes alternative fix path in openclaw#17629 if maintainers prefer minimal scope.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: slack Channel integration: slack app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime security Security documentation scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL and removed size: S labels Feb 24, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime security Security documentation scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL labels Feb 24, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
Jackson3195 pushed a commit to Jackson3195/openclaw-with-a-personal-touch that referenced this pull request Feb 25, 2026
kevinWangSheng pushed a commit to kevinWangSheng/openclaw that referenced this pull request Feb 26, 2026
kevinWangSheng pushed a commit to kevinWangSheng/openclaw that referenced this pull request Feb 26, 2026
@Glucksberg
Glucksberg deleted the fix/25091-telegram-minimal branch February 27, 2026 12:23
oskarfreye pushed a commit to oskarfreye/openclaw that referenced this pull request Feb 27, 2026
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…anks @Glucksberg)

(cherry picked from commit f154926)

# Conflicts:
#	CHANGELOG.md
#	src/telegram/bot/delivery.test.ts
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…anks @Glucksberg)

(cherry picked from commit f154926)

# Conflicts:
#	CHANGELOG.md
#	src/telegram/bot/delivery.test.ts
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram size: S

Projects

None yet

3 participants