Part 15: Infrastructure Hardening (Stop Crashing Yourself)
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
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
Related Agents
Workflow Automate
| You are a workflow automation expert specializing in creating efficient CI/CD pipelines, GitHub Acti... | - | [wshobson/agents](https://github.com/wshobson/agents) |
DevOps & Infrastructure community terraform-specialist
| You are a Terraform/OpenTofu specialist focused on advanced infrastructure automation, state managem... | opus | [wshobson/agents](https://github.com/wshobson/agents) |
DevOps & Infrastructure community kubernetes-architect
| You are a Kubernetes architect specializing in cloud-native infrastructure, modern GitOps workflows,... | opus | [wshobson/agents](https://github.com/wshobson/agents) |
DevOps & Infrastructure community gitlab-ci-patterns
| Comprehensive GitLab CI/CD pipeline patterns for automated testing, building, and deployment. | - | [wshobson/agents](https://github.com/wshobson/agents) |
DevOps & Infrastructure community secrets-management
| Secure secrets management practices for CI/CD pipelines using Vault, AWS Secrets Manager, and other... | - | [wshobson/agents](https://github.com/wshobson/agents) |
DevOps & Infrastructure community deployment-pipeline-design
| Architecture patterns for multi-stage CI/CD pipelines with approval gates and deployment strategies. | - | [wshobson/agents](https://github.com/wshobson/agents) |
DevOps & Infrastructure community