Loading...
Loading...
Post-restart smoke tests + auto-fix for gbrain and OpenClaw environments. Tests critical services, auto-fixes known issues, extensible via user-defined test scripts in ~/.gbrain/smoke-tests.d/*.sh.
npx skill4agent add garrytan/gbrain smoke-testRunorgbrain smoke-testafter any container restart.bash scripts/smoke-test.sh
~/.gbrain/smoke-tests.d/*.sh/tmp/gbrain-smoke-test.log| # | Test | Auto-Fix |
|---|---|---|
| 1 | Bun runtime | Install from bun.sh |
| 2 | GBrain CLI loads | Reinstall deps |
| 3 | GBrain database (doctor) | — |
| 4 | GBrain worker process | Start worker |
| 5 | OpenClaw Codex plugin (Zod CJS) | |
| 6 | OpenClaw gateway | — (may not be started yet) |
| 7 | Embedding API key | — (check .env) |
| 8 | Brain repo exists | — |
gbrain smoke-testbash scripts/smoke-test.shensure-services.shbash /path/to/gbrain/scripts/smoke-test.sh >> /tmp/bootstrap.log 2>&1exec: bash /data/gbrain/scripts/smoke-test.sh~/.gbrain/smoke-tests.d/# ~/.gbrain/smoke-tests.d/check-redis.sh
#!/bin/bash
redis-cli ping | grep -q PONGcheck-redischeck-redis.shscripts/smoke-test.sh# ── N. [Service Name] ──────────────────────────────────────
if [test condition]; then
pass "[Service Name]"
else
# Auto-fix attempt
[fix command]
if [re-test condition]; then
fixed "[What was fixed]"
pass "[Service Name] (after fix)"
else
fail "[Service Name] — [error detail]"
fi
fitimeout Npass()fail()fixed()skip()skip()| Var | Default | Description |
|---|---|---|
| | Log file path |
| (auto-detect) | Force gbrain install path |
| (from .env) | Database connection URL |
| | Gateway port to test |
| | Brain repo path |
Cannot find module './core.cjs'core.cjsnpm install zod@4 --forceGBRAIN_DATABASE_URLDATABASE_URLGBRAIN_DATABASE_URLtimeout Npass → fail-detected → fix → re-testskipfailGBRAIN_DATABASE_URLHOMEResults: N/M passed, F auto-fixed, S skipped$GBRAIN_SMOKE_LOG/tmp/gbrain-smoke-test.log