Install
openclaw skills install @orionshaowswmw/sandbox-selfheal-guardAnti-stuck/anti-snapshot-wipe guard for agentic sandboxes with actual selfheal_runner.sh library, byte-verified GGUF manifest, native CPU rebuild +7-10%, har...
openclaw skills install @orionshaowswmw/sandbox-selfheal-guardSandboxes (Arena 128 MB/10k-file snapshots, containers) evict binaries and GGUF models; small scripts survive and call missing files → agents appear to "think forever". This skill's scripts detect and repair that without ever hanging.
Default SELFHEAL_MODE=check: fully read-only — zero persistent writes;
probes report to stderr only, and repairs surface as DRY: would ... lines.
In fix mode events persist to ~/.selfheal/selfheal.log. Run
repairs ONLY after the human consents: prefix commands with
SELFHEAL_MODE=fix . Exact system effects (nothing else is touched):
| Effect | Where | When |
|---|---|---|
| writes | none in check mode; ~/.selfheal/ (log, state, cache), ~/.shim/npx, model dir ($SELFHEAL_MODELS_DIR) in fix mode | fix mode only |
| network | huggingface.co only, exact URLs + sha256 pins in manifest.json | fix mode, circuit-broken, hash-verified after download |
| system packages | sudo -n apt-get (never interactive, stamp-throttled) | fix mode, only if binary missing |
| prompt content | processed locally, stored only in local cache (fix mode) | never sent anywhere |
sh scripts/selfheal_runner.sh preflight → rc 0 healthy, rc 5 degraded (log has reason), never hangs. Read-only.SELFHEAL_MODE=fix sh scripts/run_guarded.sh "PROMPT" ROLE N (ROLE = scout/spark/forge/sage/auto; auto + ≤8 words = light-swarm scout path and N is clamped to ≤96; words = wc -w whitespace tokens). In check mode this still runs inference if a model already exists, but downloads/heals only with consent.python3 scripts/prompt_cache.py stats to inspect; delete ~/.selfheal/cache/ to reset.sh scripts/selfheal_tune.sh → budgets re-derive from measured t/s.sh scripts/test_selfheal.sh (hermetic, never touches real $HOME).| File | Load when |
|---|---|
manifest.json | you need model bytes/URLs/roles/timeouts — it is the single source of truth |
scripts/selfheal_runner.sh | you call functions directly (run_with_timeout, selfheal_ensure_model) |
scripts/run_guarded.sh | one full guarded call: cache → preflight → timeout → fallback |
scripts/prompt_cache.py | cache hits must skip inference entirely |
scripts/selfheal_tune.sh | budgets should match this host's real speed |
scripts/test_selfheal.sh | after any edit of this skill |
| Role | File | Speed | Use for |
|---|---|---|---|
| scout | Qwen_Qwen3-0.6B-Q4_K_M | ~34 t/s | casual/light-swarm |
| spark | Qwen2.5-0.5B-Instruct-Q5_K_M | ~30 t/s | general instruct |
| forge | Qwen2.5-Coder-0.5B-Instruct-Q4_K_M | ~31 t/s | code |
| sage | DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M | ~14 t/s | deep reasoning only |
Timeout budget = base + n × ms/token, scaled by measured t/s, hard-capped
(150 s light roles, 300 s sage). Inference runs under timeout --kill-after=5.
Fallback chain: primary flags → minimal-flags retry → scout → exit 2.
timeout(1); if timeout is unavailable, refuse (do not run unbounded).GGUF magic before use (size-only checks accept 15-byte HTML error pages); every download is additionally sha256-pinned against manifest.json (HF LFS oids — content-addressed, defeats upstream mutation). Deep re-verify of existing files: SELFHEAL_DEEP_VERIFY=1.-fa, --no-warmup) from --help; never assume.sudo on stdin-closed sandboxes; use sudo -n or skip+warn.$SELFHEAL_HOME/selfheal.log; state lives outside the package so upgrades keep it.manifest.json.evidence with verification method + date.run_guarded.sh collapses failures after its final fallback to rc 2.)check (report-only). MUST obtain explicit human consent before SELFHEAL_MODE=fix; NEVER silently enable it.github.com/ggml-org/llama.cpp) — building unverified source is a supply-chain hole. Consent override: SELFHEAL_LLAMA_ANY_REMOTE=1.run_guarded.sh appends wall-clock per call to state/history.jsonl;
selfheal_tune.sh measures real generation speed per role and EMA-updates
state/state.json; selfheal_budget() prefers EMA over manifest defaults →
timeouts get tighter and more accurate with use, and drift is visible in the
log. Human can reset: delete ~/.selfheal/state/state.json.
Any agent runtime with a POSIX shell + coreutils (timeout, curl, wc); python3 optional (only enables JSON manifest parsing, cache, EMA — scripts degrade to compiled-in defaults without it). No model-specific prompting idioms anywhere; all commands are copy-paste literal. Works sourced from sh/bash/zsh.