Part 15: Infrastructure Hardening (Stop Crashing Yourself) banner
OnlyTerp OnlyTerp

Part 15: Infrastructure Hardening (Stop Crashing Yourself)

DevOps & Infrastructure community intermediate

Description

Your OpenClaw setup probably has hidden landmines that cause crash loops, GPU contention, and rate limit spirals. We found all of ours in one session. Here's what to check and how to fix each one. ---

Installation

Terminal
claude install-skill https://github.com/OnlyTerp/openclaw-optimization-guide

README

Part 15: Infrastructure Hardening (Stop Crashing Yourself)

Your OpenClaw setup probably has hidden landmines that cause crash loops, GPU contention, and rate limit spirals. We found all of ours in one session. Here's what to check and how to fix each one.


The Compaction Crash Loop

The Problem

OpenClaw uses a model to "compact" (summarize) old conversation history when sessions get long. By default, this uses whatever model your Google plugin provides — usually **Gemini 2.5 Flash**.

When you hit Gemini's rate limit (1M tokens/min), compaction starts failing with 429 errors. Instead of backing off, it **retries immediately** — creating an infinite loop:

compaction: Full summarization failed (429 quota exceeded)
compaction: Partial summarization also failed (429)
compaction: Full summarization failed (429)
... every 2 seconds, forever

This makes OpenClaw "crash" when you open a chat — the gateway is stuck in a compaction retry loop.

The Fix

Set an explicit compaction model that won't rate-limit you:

{
  "agents": {
    "defaults": {
      "compaction": {
        "model": "cerebras/qwen-3-235b-a22b-instruct-2507",
        "mode": "safeguard",
        "reserveTokens": 15000
      }
    }
  }
}

**Why Cerebras?** 3,000 tokens/second, generous rate limits, and the 235B MoE model produces quality summaries.

**Never use for compaction:** Gemini Flash (rate limits), expensive models like Opus (waste of money for summarization).


The Gemini Flash Trap

The Problem

Gemini 2.5 Flash sneaks into more places than you realize:

Subsystem What It Does Why Flash Is Bad Here
Compaction Summarizes old messages Rate limits → crash loop
Slug generation Names your sessions Timeouts → errors in logs
Session memory hooks Saves session context Rate limits → data loss
Auto-capture hooks Extracts learnings Rate limits → missed captures
Agent fallbacks Backup when primary fails Also rate-limited when you need it most
Web search grounding Powers web_search tool Shares quota with everything else

When multiple subsystems hit Flash simultaneously, you blow through the quota instantly. One agent doing research + compaction + session saves = 3+ concurrent Flash calls = instant rate limit.

The Fix

**1. Audit every Flash reference:**

Select-String -Path ~/.openclaw/openclaw.json -Pattern "gemini-2.5-flash"

**2. Replace in priority order:**

    undefined

GPU Contention: The Embedding Server Problem

The Problem

If you run a local embedding server on the same GPU you game/infer on:

    undefined