Smart Debug & Bug Fix
Kirim error ke AI, dia trace call chain find root cause give fix—10x faster dari Stack Overflow
Debugging buang berapa banyak waktu
Liat error, cek stack trace, ternyata point ke satu baris tapi baris itu nggak ada masalah. Mulai add console.log, trace layer-by-layer, setengah jam nanti ketemu parameter di tiga layer atas yang salah. Paling scary adalah intermittent bug—sekali-kali muncul, susah di-reproduce, cuma bisa tebak. Bug di production lebih parah: user ngomel di belakang, lo baca log sambil gugup.
Suruh AI bantu, cepet dan akurat
Lo cukup kasih error info atau abnormal behavior description ke OpenClaw, dia auto-analyze stack trace, trace call chain, check related code, terus bilang problem-nya dimana, kenapa terjadi, gimana cara fix. Bukan "mungkin ini reason" yang gajelas—ini pinpoint exact code line, kasih usable diff. Intermittent bug? Dia analisis race condition, edge case, concurrency issue yang lo sering skip.
Debug Prompt, ambil langsung pake
Dari simple error fix sampai nightmare intermittent bug, semua punya Prompt corresponding.
Kode gw error message begini:
[paste complete error message dan stack trace disini]
Code file ada di current project. Please:
1. Analyze error reason
2. Locate exact problem code
3. Provide fix solution (give me the corrected code)
4. Explain kenapa error ini terjadi, cara avoid next time
Node.js app gw memory terus naik setelah jalan beberapa waktu, suspect memory leak.
Phenomena:
- Startup pakai 200MB, setelah 24 jam naik jadi 1.5GB
- Restart normal lagi, tapi akan naik lagi
Please analyze project code, focus check:
1. Uncleaned event listener (EventEmitter leak)
2. Variable reference di closure
3. Global variable atau cache tanpa limit
4. Database connection pool nggak release
5. Interval timer (setInterval) nggak clear
Setelah find issue, provide fix code, recommend monitoring strategy prevent repeat.
API endpoint gw kadang return 500 error, roughly setiap 100 request ada 1-2 kali.
Endpoint path: [your API path]
Error log: [paste relevant log]
Please analyze endpoint code di project, investigate possibilities:
1. Race condition—concurrent request cause state inconsistent
2. Database connection timeout atau connection pool exhausted
3. Third-party service call timeout nggak handle proper
4. Edge value atau null nggak ada defensive check
5. Async operation error nggak di-catch
Give most probable root cause, fix code, cara add monitoring catch intermittent problem type ini.
Debug scenario recommend config
Debug harus cepat, config harus bikin AI see enough context.
# .openclaw/skill_config.yaml
debug:
model: claude-opus-4-6 # Complex bug pake Opus, reasoning ability terbaik
fallback_model: gpt-4o # Simple error pake GPT-4o, cepet
context_depth: full # Need see complete call chain
include_logs: true # Auto-read recent log file
output:
show_diff: true # Direct kasih modification diff
explain_cause: true # Explain root cause
suggest_prevention: true # Suggest prevent happen lagi
OpenClaw vs ChatGPT — debug ability comparison
- Direct read project code, see complete context
- Trace problem along call chain, bukan cuma liat code yang lo paste
- Analyze interaction between multiple file simultaneously
- Give fix yang langsung usable diff
- Only see code snippet yang lo paste, context limited
- Often give "mungkin ini reason" suggestion yang gajelas
- Nggak paham architecture sama file dependency project lo
- Fix suggestion maybe inconsistent dengan code style lo
Detail comparison lebih lengkap 👉 OpenClaw vs ChatGPT · OpenClaw vs Claude Code
Real scenario: production bug urgent fix
Model mana buat debug
Simple error sama complex bug pake different model, jangan buang duit.
- Claude Opus 4.6 —— First choice intermittent bug, concurrency issue, memory leak etc complex scenario
- GPT-4o —— Regular error, syntax error, type error kind direct problem
- Gemini 2.5 Pro —— Long log analysis, big context window is advantage