feat(ops): add openclaw-triage tool, instant diagnostic playbook, and simplicity invariant

This commit is contained in:
Moritz Graf
2026-10-10 14:25:16 +02:00
parent 5b3dfe2a50
commit bb5ca769db
3 changed files with 309 additions and 0 deletions
+22
View File
@@ -92,6 +92,18 @@ OpenClaw connects to three foundational Git repositories:
Whenever troubleshooting or maintaining OpenClaw, agents MUST adhere to these rules:
0. **Rapid Incident Triaging & Information Gathering (< 2s)**:
- When any issue, silence, or strange bot behavior is reported, **run the one-shot triage tool first**:
```bash
kubectl exec openclaw-0 -n openclaw -c openclaw -- python3 /home/node/.openclaw/scripts/triage.py --topic <topicId>
```
- Do NOT run piecemeal SQLite queries, guess table/column names, or scan the container filesystem.
- **Path Anchors (Never run `find /` or broad `grep -r` on rotational disk):**
- Knowledge Wiki: `/home/node/.openclaw/wiki/main`
- Agent Databases: `/home/node/.openclaw/agents/<agent>/agent/openclaw-agent.sqlite`
- Gateway State DB: `/home/node/.openclaw/state/openclaw.sqlite`
- Standalone Triage Script: `/home/node/.openclaw/scripts/triage.py` (Repo: `k8s/openclaw/scripts/openclaw-triage.py`)
1. **Verify Before Declaring Dead (Turn In-Flight Diagnostics)**:
- When a user reports that a Telegram topic is "not answering" or "silent", **NEVER assume the container or gateway has crashed**.
- Always inspect live pod logs (`kubectl logs openclaw-0 -n openclaw -c openclaw --tail=100`) and the agent's SQLite database (`session_nodes` and `transcript_events`) first.
@@ -112,6 +124,16 @@ Whenever troubleshooting or maintaining OpenClaw, agents MUST adhere to these ru
- Host `haumdaucher` uses rotational mechanical disks (`/dev/sda2`, `rotational: 1`).
- Whenever the pod or container restarts, SQLite databases MUST be sequentially streamed to `/dev/null` (`cat ... > /dev/null`) to pre-warm the Linux page cache, avoiding single-threaded event loop starvation on cold seeks.
6. **Zero-Downtime Wiki Prompt Updates vs. Heavy Pod Rollouts**:
- Subagent prompt instructions, tone, and tool guidelines live in `knowledge-wiki/agents/<name>.md`. Edits made there are read live by OpenClaw on git sync without any pod restart.
- Avoid modifying `openclaw-instance.secret.yaml` unless modifying container limits, environment variables, or global operator configuration. A CR edit triggers a 7-init-container rolling update (~3 minutes).
7. **Continuous Troubleshooting Evolution & The Simplicity Invariant (The 98% Rule)**:
- **Post-Fix Dual Reflection**: At the end of every troubleshooting cycle and fix, the AI MUST proactively evaluate:
1. *Troubleshooting Optimization*: How can the diagnostic process be made faster or codified into `triage.py` / `openclaw-ops`?
2. *System Maturity*: How can the root cause be hardened permanently to prevent recurrence?
- **Simplicity First**: Simplicity and straightforward architecture are the central design principles. A simple, pragmatic solution that cleanly reaches **98% of the goal** is strictly preferred over an over-engineered abstraction attempting 100%. Never introduce background workers, multi-stage state machines, or silent fallbacks when a transparent single-step tool or direct alert suffices.
For known issues, resolved bugs, and specific failure playbooks, consult [TROUBLESHOOTING.md](./TROUBLESHOOTING.md).
### 1. Verify Deployment Health