How I Proved My Own Bug Report Wrong: OpenClaw Telegram Debugging via apiRoot Proxy

✍️ OpenClawRadar📅 Published: September 8, 2026🔗 Source
Ad

OpenClaw's Telegram apiRoot config per account can be pointed at a local proxy to capture the actual wire payloads, letting you distinguish between real reinsertion bugs and client-side rendering artifacts. One developer used this to prove his own bug report wrong — and retract it.

The bug report saga

Last week, a main agent started refusing instructions, claiming messages contained an injected system block. The user filed issue #137927. It turned out OpenClaw's internal runtime context was leaking into visible message text, reading like an injection. The issue was closed after three fixes were merged, but the maintainers noted the fixes did not resolve the "complete block reinserted into clean text" symptom the user reported. Six sibling issues remained open.

Why the evidence was weak

When the user retested by stripping HTML and copying the clean text, the delimiters reappeared. A commenter pointed out that this could be four different things: model echoing, replay contamination, client rendering, or actual channel reinsertion. The user's evidence — text pasted from a chat client — could not distinguish these. Nobody in eleven threads had captured the actual transmitted payload.

Capturing the wire payload

OpenClaw's Telegram config has a per-account apiRoot. Pointing it at a local logging proxy causes that account's API calls to go through the proxy instead of Telegram. Steps:

  • Create a throwaway bot from BotFather.
  • Add it as a second Telegram account in config, bound to the same agent.
  • Set only that account's apiRoot to a local logging proxy.
  • Proxy logs the request body, forwards to api.telegram.org, returns the response.
  • Production accounts keep real tokens and default apiRoot — nothing else routes through it.

About 120 lines of stdlib Python suffice for the proxy.

Ad

The results

Test one: Plain prose with no delimiters. Wire payload was completely clean. But the agent's reply mentioned that its input had arrived with the full runtime context block appended — so the block reaches the model even when outbound is clean.

Test two: The user sent the stripped preamble text. The wire payload showed &lt;&lt;&lt;BEGIN_OPENCLAW_INTERNAL_CONTEXT&gt;&gt;&gt; (HTML-escaped), but what copied out was the literal <<<BEGIN\_OPENCLAW\_INTERNAL\_CONTEXT>>>. The literal delimiter was never transmitted — the agent quoted it while describing the block, OpenClaw HTML-escaped it (parse_mode is HTML), Telegram rendered it back to the literal string, and copying gave the unescaped version.

The takeaway

Any transcript pasted into a bug report has already gone through render and copy — it cannot prove transmission vs quoting. Several reports rest on such weak evidence. This debugging method proves more reliable. Also, while reading the fixes, the user found something worse — a separate architectural issue — which they plan to report separately.

📖 Read the full source: r/openclaw

Ad

👀 See Also