Skip to content

fix(telegram): cool down transient sendChatAction failures#93020

Merged
vincentkoc merged 2 commits into
mainfrom
clownfish/ghcrawl-156876-autonomous-smoke
Jun 14, 2026
Merged

fix(telegram): cool down transient sendChatAction failures#93020
vincentkoc merged 2 commits into
mainfrom
clownfish/ghcrawl-156876-autonomous-smoke

Conversation

@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Summary

  • Add a focused transient cooldown/backoff path to the Telegram sendChatAction handler for recoverable network failures, structured 429 rate limits, and temporary 5xx Telegram errors.
  • Keep the existing 401 suspension path intact.
  • During cooldown, avoid hammering Telegram while still rejecting typing starts so the shared typing circuit breaker can count failures and stop the keepalive loop.
  • Reset transient counters on success, 401 transitions, and non-transient errors so stale transient state does not leak across unrelated failures.

Credit

This replacement carries forward work and review context from @Boulea7 in #55886, @sumaiazaman in #55838, and @Pick-cat in #56153.

Validation

  • pnpm test:serial extensions/telegram/src/sendchataction-401-backoff.test.ts extensions/telegram/src/network-errors.test.ts extensions/telegram/src/send.test.ts
  • pnpm check:changed

Closes #56096. Related #55811 and #48943.

Clownfish 🐠 replacement reef notes:

fish notes: model gpt-5.5, reasoning xhigh; reviewed against 5b4b09f.

openclaw-clownfish Bot and others added 2 commits June 14, 2026 16:19
Co-authored-by: Langning Zhang <[email protected]>

Co-authored-by: Sumaia Zaman <[email protected]>

Co-authored-by: pick-cat <[email protected]>
Co-authored-by: Langning Zhang <[email protected]>

Co-authored-by: Sumaia Zaman <[email protected]>

Co-authored-by: pick-cat <[email protected]>
@openclaw-clownfish openclaw-clownfish Bot added the clownfish Tracked by Clownfish automation label Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 14, 2026, 12:30 PM ET / 16:30 UTC.

Summary
The PR adds transient cooldown state and regression tests to Telegram sendChatAction handling for recoverable network, 429, and 5xx failures while preserving the existing 401 suspension path.

PR surface: Source +61, Tests +97. Total +158 across 3 files.

Reproducibility: yes. at source level: current main rethrows transient/non-401 sendChatAction failures without a cooldown, while the linked issue provides repeated-failure logs. I did not run a live Telegram outage reproduction in 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:

  • Consider a live Telegram transient-failure probe before landing if maintainers want transport-level proof beyond unit coverage.

Risk before merge

  • [P0] No live Telegram outage or rate-limit proof was inspected in this read-only pass; the verdict rests on source inspection, focused tests, CI context, and grammY contract evidence.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused Telegram handler cooldown with its regression coverage after maintainer review and any required live transport proof.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair lane is needed because no concrete code defect was found; maintainers should review/land the replacement or request live transport proof.

Security
Cleared: No concrete security or supply-chain concern found; the diff changes Telegram runtime error handling/tests only and adds no dependencies, permissions, secrets handling, workflows, or code execution paths.

Review details

Best possible solution:

Land the focused Telegram handler cooldown with its regression coverage after maintainer review and any required live transport proof.

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

Yes at source level: current main rethrows transient/non-401 sendChatAction failures without a cooldown, while the linked issue provides repeated-failure logs. I did not run a live Telegram outage reproduction in this read-only review.

Is this the best way to solve the issue?

Yes: a narrow Telegram-owned cooldown inside the per-account sendChatAction handler is the best layer because it avoids broad core typing-loop changes and preserves the existing 401 suspension behavior.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P1: The PR targets a linked Telegram workflow bug where repeated sendChatAction failures can make the channel unresponsive and suppress replies for real users.
  • 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: This is a bot-authored replacement PR, so the external-contributor proof gate does not apply; it reports focused local validation but no live Telegram outage proof.

Label justifications:

  • P1: The PR targets a linked Telegram workflow bug where repeated sendChatAction failures can make the channel unresponsive and suppress replies for real users.
  • 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: This is a bot-authored replacement PR, so the external-contributor proof gate does not apply; it reports focused local validation but no live Telegram outage proof.
Evidence reviewed

PR surface:

Source +61, Tests +97. Total +158 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 68 7 +61
Tests 1 98 1 +97
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 166 8 +158

What I checked:

Likely related people:

  • steipete: GitHub file history shows repeated current-main work on the shared typing lifecycle and channel helper contracts that the Telegram sendChatAction path relies on. (role: adjacent owner; confidence: high; commits: 273973d374c2, d42ef2ac6216, ca9249e35729; files: src/channels/typing.ts, src/channels/typing-start-guard.ts, src/channels/typing-lifecycle.ts)
  • obviyus: Recent current-main history touches Telegram chat-action coalescing, sendChatAction typings, and network-error classification used by this patch. (role: recent area contributor; confidence: high; commits: 760160c64145, efef31949611, a956ab848146; files: extensions/telegram/src/sendchataction-401-backoff.ts, extensions/telegram/src/network-errors.ts)
  • vincentkoc: The related source PR discussion records a narrow repair pushed by this person to keep the contributor path canonical, and the replacement PR carries that review context forward. (role: linked branch repair owner; confidence: medium; commits: c4fe168624fc; files: extensions/telegram/src/sendchataction-401-backoff.ts, extensions/telegram/src/network-errors.ts)
  • chinar-amrutkar: Current-main history for Telegram network error helpers includes retry_after and wrapped send-failure work that this PR depends on for 429 handling. (role: adjacent rate-limit contract contributor; confidence: medium; commits: 3f67581e50a3; files: extensions/telegram/src/network-errors.ts, extensions/telegram/src/network-errors.test.ts, extensions/telegram/src/send.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 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. P1 High-priority user-facing bug, regression, or broken workflow. labels Jun 14, 2026
@vincentkoc
vincentkoc merged commit 6134c00 into main Jun 14, 2026
199 of 208 checks passed
@vincentkoc
vincentkoc deleted the clownfish/ghcrawl-156876-autonomous-smoke branch June 14, 2026 17:07
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 15, 2026
…93020)

* fix(telegram): cool down transient sendChatAction failures

Co-authored-by: Langning Zhang <[email protected]>

Co-authored-by: Sumaia Zaman <[email protected]>

Co-authored-by: pick-cat <[email protected]>

* fix(clownfish): address review for ghcrawl-156876-autonomous-smoke (1)

Co-authored-by: Langning Zhang <[email protected]>

Co-authored-by: Sumaia Zaman <[email protected]>

Co-authored-by: pick-cat <[email protected]>

---------

Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>
Co-authored-by: pick-cat <[email protected]>
wangmiao0668000666 pushed a commit to wangmiao0668000666/openclaw that referenced this pull request Jun 17, 2026
…93020)

* fix(telegram): cool down transient sendChatAction failures

Co-authored-by: Langning Zhang <[email protected]>

Co-authored-by: Sumaia Zaman <[email protected]>

Co-authored-by: pick-cat <[email protected]>

* fix(clownfish): address review for ghcrawl-156876-autonomous-smoke (1)

Co-authored-by: Langning Zhang <[email protected]>

Co-authored-by: Sumaia Zaman <[email protected]>

Co-authored-by: pick-cat <[email protected]>

---------

Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>
Co-authored-by: pick-cat <[email protected]>
teknium1 added a commit to NousResearch/hermes-agent that referenced this pull request Jul 6, 2026
Port from openclaw/openclaw#93020: add per-chat cooldown for transient sendChatAction failures so keep-typing refreshes do not hammer Telegram during network blips or rate limits.
teknium1 added a commit to NousResearch/hermes-agent that referenced this pull request Jul 7, 2026
Port from openclaw/openclaw#93020: add per-chat cooldown for transient sendChatAction failures so keep-typing refreshes do not hammer Telegram during network blips or rate limits.
teknium1 added a commit to NousResearch/hermes-agent that referenced this pull request Jul 7, 2026
* fix: cool down transient Telegram typing failures

Port from openclaw/openclaw#93020: add per-chat cooldown for transient sendChatAction failures so keep-typing refreshes do not hammer Telegram during network blips or rate limits.

* fix: support bare Telegram adapters in typing cooldown

* test: update typing backoff imports for relocated Telegram adapter

The Telegram adapter moved from gateway/platforms/telegram.py to
plugins/platforms/telegram/adapter.py since this branch was created;
point the test imports and monkeypatch targets at the new module.
badgerbees pushed a commit to badgerbees/openclaw that referenced this pull request Jul 8, 2026
…93020)

* fix(telegram): cool down transient sendChatAction failures

Co-authored-by: Langning Zhang <[email protected]>

Co-authored-by: Sumaia Zaman <[email protected]>

Co-authored-by: pick-cat <[email protected]>

* fix(clownfish): address review for ghcrawl-156876-autonomous-smoke (1)

Co-authored-by: Langning Zhang <[email protected]>

Co-authored-by: Sumaia Zaman <[email protected]>

Co-authored-by: pick-cat <[email protected]>

---------

Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>
Co-authored-by: pick-cat <[email protected]>
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
* fix: cool down transient Telegram typing failures

Port from openclaw/openclaw#93020: add per-chat cooldown for transient sendChatAction failures so keep-typing refreshes do not hammer Telegram during network blips or rate limits.

* fix: support bare Telegram adapters in typing cooldown

* test: update typing backoff imports for relocated Telegram adapter

The Telegram adapter moved from gateway/platforms/telegram.py to
plugins/platforms/telegram/adapter.py since this branch was created;
point the test imports and monkeypatch targets at the new module.
justemu pushed a commit to justemu/hermes-agent that referenced this pull request Jul 18, 2026
* fix: cool down transient Telegram typing failures

Port from openclaw/openclaw#93020: add per-chat cooldown for transient sendChatAction failures so keep-typing refreshes do not hammer Telegram during network blips or rate limits.

* fix: support bare Telegram adapters in typing cooldown

* test: update typing backoff imports for relocated Telegram adapter

The Telegram adapter moved from gateway/platforms/telegram.py to
plugins/platforms/telegram/adapter.py since this branch was created;
point the test imports and monkeypatch targets at the new module.
tangdaibin pushed a commit to tangdaibin/hermes-agent that referenced this pull request Jul 20, 2026
* fix: cool down transient Telegram typing failures

Port from openclaw/openclaw#93020: add per-chat cooldown for transient sendChatAction failures so keep-typing refreshes do not hammer Telegram during network blips or rate limits.

* fix: support bare Telegram adapters in typing cooldown

* test: update typing backoff imports for relocated Telegram adapter

The Telegram adapter moved from gateway/platforms/telegram.py to
plugins/platforms/telegram/adapter.py since this branch was created;
point the test imports and monkeypatch targets at the new module.
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
* fix: cool down transient Telegram typing failures

Port from openclaw/openclaw#93020: add per-chat cooldown for transient sendChatAction failures so keep-typing refreshes do not hammer Telegram during network blips or rate limits.

* fix: support bare Telegram adapters in typing cooldown

* test: update typing backoff imports for relocated Telegram adapter

The Telegram adapter moved from gateway/platforms/telegram.py to
plugins/platforms/telegram/adapter.py since this branch was created;
point the test imports and monkeypatch targets at the new module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram clownfish Tracked by Clownfish automation 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.

Bug: Telegram sendChatAction infinite retry loop with no backoff

1 participant