openclaw - ✅(Solved) Fix Telegram typingMode: 'never' not working - sendChatAction 401 errors persist [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#48943Fetched 2026-04-08 00:50:44
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
commented ×2cross-referenced ×1unsubscribed ×1

Error Message

Error Logs

  1. Error persistence: Despite config, the system continues to attempt calls

Root Cause

  1. Code duplication: logic appears in 7 different compiled JS files
  2. Config override not respected: should disable all typing indicators but doesn't
  3. Error persistence: Despite config, the system continues to attempt calls

Fix Action

Fix / Workaround

Workarounds Attempted

  1. Multiple config variations
  2. Code analysis shows the issue is in the compiled distribution files
  3. The bug appears to be in how the typing mode configuration is handled across multiple code paths

PR fix notes

PR #55886: fix(telegram): cool down transient sendChatAction failures

Description (problem / solution / changelog)

Summary

  • Problem: transient Telegram sendChatAction failures (network / 429 / temporary 5xx) can keep firing repeatedly, creating noisy retry loops and log spam.
  • Why it matters: typing indicators are best-effort, so repeated failures should not keep hammering Telegram or interfere with normal reply delivery.
  • What changed: kept the existing 401 suspend behavior, and added a separate transient cooldown path that temporarily suppresses repeated sendChatAction calls until a later recovery.
  • What did NOT change (scope boundary): this PR does not change typingMode config behavior, message delivery flow, or Telegram channel startup/runtime wiring outside the dedicated handler.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #55811
  • Related #48943
  • This PR fixes a bug or regression

Root Cause / Regression History (if applicable)

  • Root cause: the dedicated Telegram sendChatAction handler only had global backoff / suspension behavior for 401s, but transient failures still retried on every later call path.
  • Missing detection / guardrail: the handler had no cooldown state for transient network / rate-limit / temporary server failures, and the dedicated test file did not currently lock in that behavior.
  • Prior context (git blame, prior PR, issue, or refactor if known): the current per-account guard already existed for 401 token failures in sendchataction-401-backoff.ts.
  • Why this regressed now: as more users hit Telegram transient failures, the handler protected the invalid-token case but not the best-effort transient case.
  • If unknown, what was ruled out: this PR does not treat typingMode config propagation as the root cause for this specific issue.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: extensions/telegram/src/sendchataction-401-backoff.test.ts
  • Scenario the test should lock in: transient failures enter cooldown, repeated calls are suppressed during cooldown, recovery clears transient state, and 401 suspension semantics still work independently.
  • Why this is the smallest reliable guardrail: the bug lives in the dedicated per-account handler state machine, so direct unit coverage is the narrowest reliable test.
  • Existing test that already covers this (if any): extensions/telegram/src/send.test.ts -t "sends typing" still covers the normal typing send seam.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

  • Repeated transient sendChatAction failures no longer keep retrying on every call path.
  • 401 invalid-token behavior is unchanged.
  • No config or default changes.

Diagram (if applicable)

Before:
transient sendChatAction failure -> next typing call retries immediately -> repeated failures/log spam

After:
transient sendChatAction failure -> cooldown starts -> repeated typing calls skipped -> later success clears cooldown

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local pnpm workspace
  • Model/provider: N/A
  • Integration/channel (if any): Telegram
  • Relevant config (redacted): existing Telegram channel config

Steps

  1. Simulate repeated transient sendChatAction failures.
  2. Trigger repeated handler calls during the cooldown window.
  3. Verify repeated calls are suppressed and later recovery clears the transient state.

Expected

  • transient failures do not suspend the handler permanently
  • repeated calls during cooldown do not keep calling Telegram
  • later success restores normal behavior
  • 401 behavior still suspends as before

Actual

  • matches expected in targeted local verification

Evidence

  • Failing test/log before + passing after

Human Verification (required)

  • Verified scenarios:
    • transient network failure cooldown
    • transient recovery path
    • 429 transient handling
    • 5xx transient handling
    • unexpected non-transient error still throws
    • 401 semantics remain active
    • mixed 401 -> transient -> 401 sequence preserves 401 counter
  • Edge cases checked:
    • cooldown suppression is global per handler
    • Date.now-driven cooldown expiry path
  • What you did not verify:
    • live Telegram outage against the real API
    • broader typingMode configuration behavior

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No

Risks and Mitigations

  • Risk: treating some Telegram-side failures as transient could suppress useful signal for a short period.
    • Mitigation: only network / 429 / temporary 5xx go through cooldown; unexpected non-transient errors still throw, and 401 still suspends.

🤖 AI-assisted (Codex), tested with focused local verification

Changed files

  • extensions/telegram/src/network-errors.test.ts (modified, +16/-0)
  • extensions/telegram/src/network-errors.ts (modified, +5/-0)
  • extensions/telegram/src/sendchataction-401-backoff.test.ts (modified, +152/-30)
  • extensions/telegram/src/sendchataction-401-backoff.ts (modified, +62/-2)
RAW_BUFFERClick to expand / collapse

Bug Report

OpenClaw Version: Latest (installed via npm) Environment: Ubuntu Linux, Node v24.13.0 Channel: Telegram

Problem

The configuration for Telegram is not working. Despite setting this option, OpenClaw continues to send requests, resulting in persistent 401 errors in the logs.

Configuration

Error Logs

The system shows 266+ errors with 401 failures. The code appears to be duplicated across 7 different files in the dist/ directory, with 163 occurrences of in the codebase.

Analysis

  1. Code duplication: logic appears in 7 different compiled JS files
  2. Config override not respected: should disable all typing indicators but doesn't
  3. Error persistence: Despite config, the system continues to attempt calls

Impact

  • Harmless log spam (266+ errors and counting)
  • No functional impact - OpenClaw works normally otherwise
  • But configuration option is effectively broken

Expected Behavior

When is set, OpenClaw should NOT send any requests to Telegram API.

Workarounds Attempted

  1. Multiple config variations
  2. Code analysis shows the issue is in the compiled distribution files
  3. The bug appears to be in how the typing mode configuration is handled across multiple code paths

Additional Context

This appears to be a regression or configuration handling bug where the setting isn't properly propagated to all call sites.

extent analysis

Fix Plan

To address the issue with the Telegram configuration not being respected, we need to ensure the typing mode configuration is properly handled across all code paths.

Step-by-Step Solution:

  1. Identify and Refactor Duplicated Code: Locate the 7 different compiled JS files in the dist/ directory where the logic is duplicated. Refactor these to use a single, configurable function for sending requests.
  2. Implement Configurable Typing Indicator: Modify the code to respect the configuration option for disabling typing indicators. This can be achieved by adding a conditional check before sending requests.
  3. Update Configuration Handling: Ensure the configuration option is properly propagated to all parts of the codebase that interact with the Telegram API.

Example Code Snippet:

// Before (duplicated and non-configurable)
function sendRequest() {
  // Code to send request without checking config
}

// After (configurable and centralized)
const typingIndicatorEnabled = getConfig('typingIndicatorEnabled');

function sendRequest() {
  if (typingIndicatorEnabled) {
    // Code to send request
  }
}

function getConfig(key) {
  // Implementation to retrieve config value
  // For example, from a config file or environment variable
}

Verification

To verify the fix, check the logs for the absence of 401 errors related to typing indicators after setting the configuration option to disable them. Also, confirm that OpenClaw functions as expected without any log spam.

Extra Tips

  • Regularly review code for duplication and refactor as necessary to prevent similar issues.
  • Ensure configuration options are properly tested to catch regressions early.
  • Consider implementing automated tests for critical configuration paths to prevent future breakage.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING