openclaw - ✅(Solved) Fix [Bug]: Telegram polling self-conflicts on macOS 2026.4.29 even with a single local gateway process [1 pull requests, 1 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#75852Fetched 2026-05-02 05:28:59
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
2
Author
Timeline (top)
referenced ×3commented ×1cross-referenced ×1

On macOS with OpenClaw 2026.4.29, the Telegram provider enters repeated 409 Conflict: terminated by other getUpdates request loops even though only one local openclaw gateway process exists.

Direct Bot API getUpdates works normally when the local OpenClaw gateway is stopped, then starts conflicting again only after OpenClaw restarts. This strongly suggests an internal Telegram polling lifecycle overlap / self-conflict inside OpenClaw rather than an external duplicate poller.

This may be related to or a duplicate of #49822, but this report adds a confirmed macOS reproduction and direct stop/start verification against the Telegram Bot API.

Error Message

[telegram] [diag] polling cycle error reason=getUpdates conflict ... 2026-05-02T01:15:55.934+02:00 [telegram] [diag] polling cycle error reason=getUpdates conflict inFlight=0 outcome=ok startedAt=1777677349054 finishedAt=1777677355933 durationMs=6879 offset=1 err=Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running) Another OpenClaw gateway, script, or Telegram poller may be using this bot token; stop the duplicate poller or switch this account to webhook mode. 2026-05-02T01:16:22.969+02:00 [telegram] [diag] polling cycle error reason=getUpdates conflict inFlight=0 outcome=ok startedAt=1777677359413 finishedAt=1777677382968 durationMs=23555 offset=1 err=Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running) Another OpenClaw gateway, script, or Telegram poller may be using this bot token; stop the duplicate poller or switch this account to webhook mode.

Root Cause

So this does not appear to be caused by the health monitor repeatedly restarting the channel.

PR fix notes

PR #75908: fix: inject user's last message as system-level anchor to survive compaction

Description (problem / solution / changelog)

Problem

After context compaction (triggered by gateway restart or normal history summarization), the model can fixate on a stale compacted summary and completely ignore the user's actual message. This causes loops where the agent repeats outdated context instead of answering the current question.

This was observed in a production configuration where:

  • A gateway restart triggered context compaction
  • The agent fixated on the compacted "gateway's back up" summary
  • User messages after that point were ignored until the session was inspected manually

Related upstream reports:

  • #75841: production agent entered 103-tool-call polling loop after compaction
  • #75852: Telegram self-conflict after gateway restart
  • The fixation-on-compacted-summary pattern has been independently reported by multiple users

Solution

Inject the user's most recent message as a system-level anchor in the non-compactable extraSystemPrompt field. The anchor sits outside the conversation history and survives all summarization:

## User's Last Message
<the user's actual input>

Key design decisions:

  1. Uses extraSystemPrompt — no changes needed to the context engine, prompt builder, or compaction logic. The anchor piggybacks on the existing system prompt injection point that already survives compaction.
  2. Skipped for silent replies & model-only runs — no noise for heartbeat polls or sub-50ms internal dispatches.
  3. 2000-char truncation — prevents any single anchor from consuming excessive context.
  4. Appends to existing extraSystemPrompt — preserves group-chat or subagent context that may already be in the field.

Testing

Verified in production by inspecting prompt.submitted trace events — the anchor text [USER'S LAST MESSAGE: ...] appears in context.compiled and prompt.submitted events, confirming it's part of the system prompt that the model sees on every turn.

P.S. Malaysia's national flower is the hibiscus (bunga raya) — its five petals symbolise the five principles of Rukun Negara. 🇲🇾

Changed files

  • src/agents/pi-embedded-runner/run.ts (modified, +27/-0)
  • src/plugins/contracts/loader.contract.test.ts (modified, +1/-1)
  • src/plugins/contracts/registry.contract.test.ts (modified, +2/-2)

Code Example

[telegram] [diag] polling cycle error reason=getUpdates conflict ...
[telegram] getUpdates conflict: Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running) ...
[telegram] [diag] closing stale transport before rebuild
[telegram] [diag] rebuilding transport for next polling cycle

---

{"ok":true,"result":[]}

---

{
  gateway: {
    channelHealthCheckMinutes: 0,
  },
  channels: {
    telegram: {
      enabled: true,
      healthMonitor: {
        enabled: false,
      },
    },
  },
}

---

2026-05-02T01:15:55.934+02:00 [telegram] [diag] polling cycle error reason=getUpdates conflict inFlight=0 outcome=ok startedAt=1777677349054 finishedAt=1777677355933 durationMs=6879 offset=1 err=Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running) Another OpenClaw gateway, script, or Telegram poller may be using this bot token; stop the duplicate poller or switch this account to webhook mode.
2026-05-02T01:15:55.934+02:00 [telegram] getUpdates conflict: Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running); Another OpenClaw gateway, script, or Telegram poller may be using this bot token; stop the duplicate poller or switch this account to webhook mode. retrying in 2.06s.
2026-05-02T01:15:59.164+02:00 [telegram] [diag] closing stale transport before rebuild
2026-05-02T01:15:59.164+02:00 [telegram] [diag] rebuilding transport for next polling cycle
2026-05-02T01:16:22.969+02:00 [telegram] [diag] polling cycle error reason=getUpdates conflict inFlight=0 outcome=ok startedAt=1777677359413 finishedAt=1777677382968 durationMs=23555 offset=1 err=Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running) Another OpenClaw gateway, script, or Telegram poller may be using this bot token; stop the duplicate poller or switch this account to webhook mode.
RAW_BUFFERClick to expand / collapse

Description

Bug type

Behavior bug (incorrect output/state without crash)

Summary

On macOS with OpenClaw 2026.4.29, the Telegram provider enters repeated 409 Conflict: terminated by other getUpdates request loops even though only one local openclaw gateway process exists.

Direct Bot API getUpdates works normally when the local OpenClaw gateway is stopped, then starts conflicting again only after OpenClaw restarts. This strongly suggests an internal Telegram polling lifecycle overlap / self-conflict inside OpenClaw rather than an external duplicate poller.

This may be related to or a duplicate of #49822, but this report adds a confirmed macOS reproduction and direct stop/start verification against the Telegram Bot API.

OpenClaw version

OpenClaw 2026.4.29 (a448042)

Operating system

macOS

Environment

  • launchd service: ai.openclaw.gateway
  • gateway mode: local
  • bind mode: lan
  • Telegram configured in local config, polling mode, no webhook configured

Steps to reproduce

  1. Configure Telegram in OpenClaw with a valid bot token.
  2. Start the gateway on macOS via the local launchd service or normal gateway startup.
  3. Confirm the provider starts successfully.
  4. Wait a few minutes.
  5. Observe that Telegram begins returning 409 Conflict: terminated by other getUpdates request.
  6. Stop the local OpenClaw gateway.
  7. Call the Bot API directly with the same token: curl "https://api.telegram.org/bot<TOKEN>/getUpdates?timeout=1&limit=1"
  8. Observe that direct getUpdates works normally while OpenClaw is stopped.
  9. Restart only OpenClaw.
  10. After a short period, the conflict returns.

Expected behavior

A single local OpenClaw gateway process should maintain exactly one active Telegram long-poll and should not self-conflict with getUpdates.

Actual behavior

OpenClaw starts successfully, then later falls into a repeating conflict/rebuild loop:

[telegram] [diag] polling cycle error reason=getUpdates conflict ...
[telegram] getUpdates conflict: Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running) ...
[telegram] [diag] closing stale transport before rebuild
[telegram] [diag] rebuilding transport for next polling cycle

What I verified

  1. Only one local openclaw gateway process exists.
  2. Hermes is not the cause; it uses a different Telegram bot token.
  3. getWebhookInfo returns an empty webhook URL, so webhook mode is not blocking polling.
  4. When the local OpenClaw gateway is stopped, direct Bot API getUpdates immediately works normally.
  5. After restarting only OpenClaw, Telegram works briefly and then starts returning 409 Conflict: terminated by other getUpdates request again.
  6. This reproduces even after disabling health-monitor restarts.

Direct API evidence

While OpenClaw was stopped, the same token returned:

{"ok":true,"result":[]}

That means the conflict disappears when OpenClaw is not running.

Relevant config facts

I tested with:

{
  gateway: {
    channelHealthCheckMinutes: 0,
  },
  channels: {
    telegram: {
      enabled: true,
      healthMonitor: {
        enabled: false,
      },
    },
  },
}

So this does not appear to be caused by the health monitor repeatedly restarting the channel.

Representative logs

2026-05-02T01:15:55.934+02:00 [telegram] [diag] polling cycle error reason=getUpdates conflict inFlight=0 outcome=ok startedAt=1777677349054 finishedAt=1777677355933 durationMs=6879 offset=1 err=Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running) Another OpenClaw gateway, script, or Telegram poller may be using this bot token; stop the duplicate poller or switch this account to webhook mode.
2026-05-02T01:15:55.934+02:00 [telegram] getUpdates conflict: Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running); Another OpenClaw gateway, script, or Telegram poller may be using this bot token; stop the duplicate poller or switch this account to webhook mode. retrying in 2.06s.
2026-05-02T01:15:59.164+02:00 [telegram] [diag] closing stale transport before rebuild
2026-05-02T01:15:59.164+02:00 [telegram] [diag] rebuilding transport for next polling cycle
2026-05-02T01:16:22.969+02:00 [telegram] [diag] polling cycle error reason=getUpdates conflict inFlight=0 outcome=ok startedAt=1777677359413 finishedAt=1777677382968 durationMs=23555 offset=1 err=Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running) Another OpenClaw gateway, script, or Telegram poller may be using this bot token; stop the duplicate poller or switch this account to webhook mode.

Why this looks internal to OpenClaw

  • No second local process was visible in ps aux.
  • Direct API polling succeeds with the same token while OpenClaw is stopped.
  • The conflict reappears only after OpenClaw restarts.
  • The provider repeatedly rebuilds transport after conflict, but the conflict still comes back.

This pattern is consistent with an internal overlapping long-poll lifecycle / leaked poller rather than user misconfiguration.

Impact

High. Telegram becomes unreliable or unusable on macOS in polling mode, even with a single local gateway service.

extent analysis

TL;DR

The most likely fix or workaround is to investigate and resolve the internal overlapping long-poll lifecycle issue within OpenClaw, potentially by reviewing the polling mechanism and transport rebuild logic.

Guidance

  • Investigate the OpenClaw polling mechanism to identify potential causes of the internal overlapping long-poll lifecycle issue.
  • Review the transport rebuild logic to ensure it properly closes and restarts the polling cycle without conflicts.
  • Consider temporarily switching to webhook mode to bypass the polling issue, if possible.
  • Verify that the issue is not related to the health monitor or other external factors by testing with different configurations.

Example

No code snippet is provided as the issue seems to be related to the internal workings of OpenClaw, and without more information, it's difficult to provide a specific code example.

Notes

The issue appears to be specific to OpenClaw version 2026.4.29 on macOS, and the provided logs and configuration suggest an internal issue rather than a user misconfiguration. However, without access to the OpenClaw codebase or more detailed debugging information, it's challenging to provide a definitive solution.

Recommendation

Apply a workaround by switching to webhook mode, if possible, to bypass the polling issue until the internal overlapping long-poll lifecycle issue is resolved. This is because the direct API evidence suggests that the conflict disappears when OpenClaw is not running, indicating a potential issue with the polling mechanism.

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…

FAQ

Expected behavior

A single local OpenClaw gateway process should maintain exactly one active Telegram long-poll and should not self-conflict with getUpdates.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Telegram polling self-conflicts on macOS 2026.4.29 even with a single local gateway process [1 pull requests, 1 comments, 2 participants]