smoke-test
यह क्या करती है
यह स्किल आपके GBrain सेटअप पर हेल्थ टेस्ट का एक सेट चलाती है, जैसे डेटाबेस, कमांड लाइन टूल और बैकग्राउंड वर्कर। यह उन लोगों के लिए है जो रीस्टार्ट के बाद पक्का करना चाहते हैं कि सब काम कर रहा है।
कब इस्तेमाल करें
- ✓जब आप अपना कंप्यूटर या कंटेनर रीस्टार्ट करें और देखना चाहें कि ब्रेन काम कर रहा है।
- ✓जब ब्रेन में कुछ टूटा लगे और आप जल्दी जांच चाहें।
- ✓जब आप मानक टेस्ट के साथ अपने खुद के हेल्थ चेक जोड़ना चाहें।
Skill का लिंक
https://github.com/garrytan/gbrain/blob/master/plugin/skills/smoke-test/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैंने अभी अपना कंप्यूटर रीस्टार्ट किया है। मेरे ब्रेन पर हेल्थ टेस्ट चलाइए और जो छोटी चीज़ टूटी हो उसे ठीक कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट आठ मुख्य जांचें चलाता है और सीमित स्थानीय समस्याएँ ठीक करता है, जैसे खराब डेटाबेस इंडेक्स। जो ठीक न हो सके उसकी रिपोर्ट देता है। वर्कर की स्थिति बताई जाती है, पर अपने-आप शुरू नहीं की जाती।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Smoke Test Skillpack
Run
gbrain smoke-testafter any machine or container restart, or whenever something seems broken.
Contract
This skill guarantees:
- 8 core tests verify gbrain health after restart (plus OpenClaw services when present; skipped otherwise)
- Bounded local failures are auto-fixed before reporting; worker repair is explicit because process topology and shell-job policy are operator choices
- User-extensible via
~/.gbrain/smoke-tests.d/*.shdrop-in scripts - Results logged to
/tmp/gbrain-smoke-test.log - Exit code = number of unfixed failures (0 = all pass)
Built-in Tests
| # | Test | Auto-Fix |
|---|---|---|
| 1 | Bun runtime | Install from bun.sh |
| 2 | GBrain CLI loads | Reinstall deps |
| 3 | GBrain database (engine identity via gbrain engine status --json, then doctor --json's connection check) |
gbrain db-repair --yes, re-test |
| 4 | GBrain worker process | — (native supervisor status + duplicate detection) |
| 5 | OpenClaw Codex plugin (Zod CJS); skips if OpenClaw absent | npm install zod@4 --force |
| 6 | OpenClaw gateway; skips if OpenClaw absent | — (may not be started yet) |
| 7 | Embedding API key | — (check .env) |
| 8 | Brain repo exists | — |
Usage
CLI
gbrain smoke-test
This is the invocation for all installs; it resolves the test script from the installed package.
From any startup script or login hook
gbrain smoke-test >> /tmp/bootstrap.log 2>&1
From OpenClaw bootstrap (OpenClaw deployments only)
Add to your ensure-services.sh or equivalent:
bash /path/to/gbrain/scripts/smoke-test.sh >> /tmp/bootstrap.log 2>&1
From an agent
exec: gbrain smoke-test
Contributor note: inside a gbrain repo checkout you can also run the script
directly with bash scripts/smoke-test.sh.
Adding Custom Tests
Create executable scripts in ~/.gbrain/smoke-tests.d/:
# ~/.gbrain/smoke-tests.d/check-redis.sh
#!/bin/bash
redis-cli ping | grep -q PONG
Rules:
- Exit 0 = pass, non-zero = fail
- Filename becomes the test name (e.g.
check-redisfromcheck-redis.sh) - Keep tests fast (< 10s each)
- Tests run in alphabetical order
Adding Built-in Tests (gbrain contributors)
This section is for contributors working in the gbrain source repo. Plugin
installs ship the script read-only and upgrades overwrite it; if you just want
extra checks, use the ~/.gbrain/smoke-tests.d/ drop-in scripts above.
Edit scripts/smoke-test.sh. Follow this pattern:
# ── 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
fi
Design rules:
- Test first — never fix without confirming broken
- Re-test after fix — verify the fix worked
- Timeout everything —
timeout Non any command that could hang - Use helpers —
pass(),fail(),fixed(),skip() - Idempotent fixes — safe to run repeatedly
- Skip gracefully —
skip()when a prerequisite is missing, don't fail
Environment Variables
| Var | Default | Description |
|---|---|---|
GBRAIN_SMOKE_LOG |
/tmp/gbrain-smoke-test.log |
Log file path |
GBRAIN_DIR_OVERRIDE |
(auto-detect) | Force gbrain install path |
GBRAIN_BUN_PATH |
(auto-detect) | Force Bun binary path |
GBRAIN_DATABASE_URL |
(from .env) | Database connection URL |
GBRAIN_SMOKE_WORKER_PID_FILE |
/tmp/gbrain-worker.pid |
Legacy bare-worker PID path |
OPENCLAW_GATEWAY_PORT |
18789 |
Gateway port to test |
GBRAIN_BRAIN_PATH |
(deployment-specific) | Brain repo path. Container deployments default to /data/brain; set it to your brain repo path otherwise. Test 8 skips (not fails) when unset. |
Known Issues & Their Auto-Fixes
Codex Zod core.cjs Missing (discovered 2026-04-23)
(OpenClaw gateway deployments only: this concerns OpenClaw's Codex ACP plugin, not the OpenAI Codex CLI.)
- Symptom:
Cannot find module './core.cjs'→ all Codex ACP sessions fail - Cause: Zod v4 npm package ships without
core.cjsin some installs - Auto-fix:
npm install zod@4 --forcein the codex extension's zod dir - Persistence: Does NOT survive container restart (gateway reinstalls deps)
- This is why smoke tests must run on every rest
अक्सर पूछे जाने वाले सवाल
क्या यह बैकग्राउंड सेवाएँ शुरू करती है?
नहीं। यह वर्कर की स्थिति बताती है, पर डेमन खुद से शुरू नहीं करती।
क्या मैं अपनी जांच जोड़ सकता हूँ?
हाँ। अतिरिक्त टेस्ट स्क्रिप्ट एक फ़ोल्डर में रखी जा सकती हैं और मानक टेस्ट के साथ चलाई जा सकती हैं।
नतीजे कहाँ दर्ज होते हैं?
नतीजे एक लॉग फ़ाइल में लिखे जाते हैं, और एग्ज़िट कोड बताता है कि कितनी समस्याएँ बिना ठीक हुए बची हैं।
जानकारी
लेखक का मूल विवरण
Health smoke tests + auto-fix for gbrain installs (and OpenClaw services when present). Run after machine/container restarts or whenever something seems broken. Tests critical services, auto-fixes bounded local issues, and reports worker topology without starting daemons. Extensible via user-defined test scripts in ~/.gbrain/smoke-tests.d/*.sh.
repo: garrytan/gbrain
लोकप्रियता
- GitHub स्टार
- 31k
- रैंकिंग में स्थान
- #9315
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
gbrain
31kयह आपके एजेंट को लोगों, प्रोजेक्ट और फ़ैसलों के बारे में तथ्य खोजने के लिए साझा कंपनी ज्ञान ब्रेन में खोजने और उसमें स्थायी नोट सहेजने देती है।
brain-ingest-gate
31kयह आपके एजेंट को नई सामग्री जोड़ने से पहले मौजूदा ज्ञान ब्रेन से जाँचने देती है, ताकि डुप्लिकेट न बनें और नामित इकाइयाँ पहले सुलझें।
brain-link-discipline
31kयह सुनिश्चित करती है कि आपका एजेंट हर उस ब्रेन पेज का काम करने वाला लिंक उसी संदेश में दे, जिसकी वह रिपोर्ट करता है, ताकि आप उसे तुरंत खोल सकें।
brain-ops
31kयह आपके एजेंट को ज्ञान ब्रेन की मुख्य दिनचर्या देती है: पहले मौजूदा संदर्भ जाँचना, स्पष्ट नोट उनके स्रोत के साथ सहेजना, और संबंधित पेज जोड़ना।
मिलती-जुलती skills
knowledge-automation
394kयह आपके एजेंट को एक नियमित काम सेट करने देती है जो समय-सारणी पर Knowledge vault में नई सामग्री जोड़ता है, फिर जांचता है कि काम चल रहा है।
knowledge-source-ingest
394kयह आपके एजेंट को चैट चैनल, फ़ीड या मेलबॉक्स से आई नई चीज़ों से Knowledge vault अपडेट रखने देती है, बिना वह दोबारा जोड़े जो पहले से है।
benchmark
280kयह आपके एजेंट को code की speed और performance नापने में मदद करता है। यह पक्का करने और धीमेपन की समस्याएँ ढूँढने में काम आता है।