High CPU/RAM and Gateway Restarts in OpenClaw? Disable IPv6 for Telegram

If your OpenClaw instance has been experiencing high CPU/RAM usage, sluggish responses, and periodic gateway restarts in recent versions (especially with Telegram integration), the culprit may be autoSelectFamily: true (default on Node 22+). A user on r/openclaw traced the issue to failed IPv6 connections causing resource leaks.
The Problem
OpenClaw's Telegram integration on Node 22+ defaults to autoSelectFamily: true, which attempts both IPv4 and IPv6 connections simultaneously. If your network stack isn't IPv6-capable, those connections fail with ENETUNREACH, cascading into event loop stalls. Symptoms include:
- 80-second event loop freezes
- CPU pinned at ~52%
- ~9 gateway restarts per day
sendChatActionfailures
The Fix
Set both autoSelectFamily: false (forces IPv4-only connections) and dnsResultOrder: 'ipv4first' as a belt-and-suspenders approach in your Telegram bot configuration. Example config snippet:
// In your OpenClaw Telegram bot setup
clientOptions: {
autoSelectFamily: false,
dnsResultOrder: 'ipv4first'
}
Results
After applying the fix, the user reported:
- 0 liveness warnings
- 0 ERROR-level log entries
- 0 restarts over 5+ hours
- 0
sendChatActionfailures - CPU dropped from 52% to 4.4%
- No event loop freezes
If you run multiple Telegram bots, the issue may be more pronounced. This fix is applicable to any OpenClaw version using Node 22+ with Telegram.
📖 Read the full source: r/openclaw
👀 See Also

Three Overlooked Bottlenecks in AI Agent Workflows: Ingestion, Context Management, and Model Routing
A deep dive into the three layers often skipped when optimizing AI agents: clean input ingestion, context window management across steps, and task-appropriate model routing. Practical fixes include using structured parsing, summarized step outputs, typed schemas, and matching models to task complexity.

6 Loop Types Found in Production AI Agents: A Week-Long Log Analysis
Analysis of 670 events from 5 production agents over a week reveals 6 high-severity loop patterns including decision oscillation, retry loops, ping pong loops, recall-write loops, reflection loops, and tool non-determinism.

4 Files That Made Claude Code Write Safe Prod-Database Code
A developer shares four files—CLAUDE.md, MEMORY.md, framework.md, decisions/log.md—plus a Python bridge with idempotency keys and write guards that let Claude Code safely write to a Convex prod database.

Fix Ollama Cloud Model maxTokens: Cap is 16K, Not Config Value
Ollama cloud caps output at 16,384 tokens regardless of maxTokens config. Set to 14,000 to avoid EOF errors. Restructure long outputs or route to direct provider.