Automatically analyse user's complete OpenClaw setup, detect ALL available models, perform deep technical analysis, identify root cause with expert precision, and apply PERMANENT fixes that prevent recurrence forever.
Automatic activation when user mentions:
NO manual intervention needed — skill auto-runs full diagnosis.
powershell
# Get complete config
openclaw config.get
# Extract specifically:
- models.providers (all providers with URLs, API keys status)
- agents.defaults.model.primary (current active model)
- agents.list (all agent-specific overrides)
- channels (which models bound to which channels)
- tools.deny (any restricted tools affecting models)
- skills.entries (evolution settings, etc.)
For EACH provider in config:
:free suffix detection)Create internal database:
json
{
"totalProviders": 5,
"totalModels": 19,
"primaryModel": "qwen/qwen3.5-397b-a17b",
"providersByReliability": [
{"name": "zai", "tier": "S", "models": 3, "stability": "95%"},
{"name": "NVIDIA", "tier": "A", "models": 7, "stability": "85%"},
{"name": "OpenRouter", "tier": "B", "models": 9, "stability": "70%"}
],
"recommendedFallbacks": ["zai/zai_glm-5-turbo", "minimaxai/minimax-m2.7"]
}
powershell
# Last 200 lines for patterns
Get-Content "C:\Users\IDL\.openclaw-autoclaw\logs\gateway.log" -Tail 200
# Extract:
- Error timestamps (frequency analysis)
- Error types (JSON, timeout, auth, connection)
- Provider-specific patterns
- Request/response latency
- Streaming chunk failures
Error SignatureRoot CauseConfidencePermanent Fix"Unexpected end of JSON" + event: errorNVIDIA streaming chunk corruption95%Switch provider OR add chunk validation retry"401 Unauthorized"API key expired/rotated99%Refresh API key from provider dashboard"429 Too Many Requests"Rate limit (free tier)98%Upgrade tier OR switch to paid model"timeout" after 30sModel too slow for workload90%Switch to faster model (GLM-5-Turbo)"connection refused"Endpoint down / firewall85%Check network, switch provider"model not found"Typo in model ID99%Correct model ID from provider docsRepeated errors same time dailyProvider maintenance window80%Schedule around downtime
For each provider:
text
1. Check baseUrl accessibility
2. Verify API key format (not expired)
3. Test with smallest model first
4. Measure response time
5. Check for rate limiting headers
Health Score:
Based on root cause, apply ONE of these PERMANENT fixes:
When: Current provider unreliable (NVIDIA streaming errors, OpenRouter rate limits)
Action:
agents.defaults.model.primary to that modelopenclaw config.patchResult: User permanently on stable provider.
When: 401 errors, expired keys
Action:
openclaw config.patch with new keyResult: Fresh key, no auth errors for next validity period.
When: "Unexpected end of JSON" from streaming APIs
Action:
Update config to enable compaction: json
{
"agents": {
"defaults": {
"compaction": {
"reserveTokensFloor": 40000
},
"timeoutSeconds": 1800
}
}
}
If using NVIDIA/OpenRouter, add fallback logic:
Apply config + restart
Add permanent safeguard: Evolution rule to detect early warnings
Result: Streaming errors handled gracefully, no user-visible failures.
When: 429 errors from free tier models
Action:
openclaw config.patchResult: No more rate limit blocks.
When: Connection refused, timeouts from specific endpoint
Action:
Result: Always-connected model access.
powershell
# Test new configuration
openclaw sessions.list --limit 1
# Watch logs for 2 minutes
Get-Content "C:\Users\IDL\.openclaw-autoclaw\logs\gateway.log" -Tail 20 -Wait
# Confirm: NO errors in test period
Before declaring "fixed forever":
openclaw.jsonAdd safeguards:
text
🔍 [COMPLETE MODEL ANALYSIS - EXPERT MODE]
## Your Setup Summary
- **Total Providers:** X (ZAI: ✔, NVIDIA: ✔, OpenRouter: ✔)
- **Total Models:** Y available
- **Current Model:** [model name] from [provider]
- **Provider Health:** [Excellent/Good/Fair/Poor]
## Root Cause Identified
**Error:** [exact error message]
**Type:** [JSON parsing / Auth / Rate limit / Timeout / Network]
**Root Cause:** [technical explanation - e.g., "NVIDIA streaming chunks corrupted due to incomplete SSE events"]
**Confidence:** [95%]
## Permanent Fix Applied
✅ [Action taken]
- Changed: [old config] → [new config]
- Restarted: Gateway (PID: XXXX)
- Verified: Test request successful
## Why This is Forever
- [Explained why root cause eliminated]
- [Safeguard added: monitoring/retry/fallback]
- [Alternative ready if needed]
## Your Model Rankings (Auto-Detected)
1. ⭐ [Best model from YOUR config] - Stability: 95%
2. 🥈 [Second best] - Stability: 88%
3. 🥉 [Third option] - Stability: 82%
## If This Ever Returns (Won't)
Warning signs to watch:
- [Early symptom 1]
- [Early symptom 2]
Immediate action: Run this skill again or switch to #[1]
## Status: RESOLVED FOREVER ✅
Auto-used tools:
gateway (config.get, config.patch, restart)exec (log analysis, file operations)read (config files, logs)session_status (model verification)sessions_list (test active session)No manual commands needed — skill runs full automation.
This skill operates at:
Equivalent to: Senior DevOps Engineer + SRE + AI Infrastructure Specialist combined.
After each successful fix:
Skill gets smarter with every use.
If automated fix fails 3 times:
Worst case: User gets complete troubleshooting guide + config backup to restore.
VERSION: 2.0 (Expert System)
AUTHOR: AutoClaw (VIRAT KUMAR)
LICENSE: Open for Claw Hub community