- Use env var defaults for CLAWDBOT_DIR, WORKSPACE_DIR, REMOTE, BRANCH
- Export XDG_RUNTIME_DIR for systemctl --user on headless servers
- Tested on Hetzner VM with different directory layout
- Fix: mkdir -p for MOLT_DIR/WORKSPACE_DIR before use
- Fix: Replace broken `source --rollback-internal` with rollback() function
- Fix: Rollback now uses git checkout + reset --hard (no detached HEAD)
- Fix: Auto-switch to expected branch if on wrong branch
- Add: Recovery attempt marker prevents infinite agent loops
- Add: Capture pnpm-install.log and pnpm-build.log for agent context
- Add: Prompt injection guardrails in agent prompts (treat logs as data)
- Remove: Unused PING_TIMEOUT variable
- Change: git diff --stat now uses head -50 instead of tail -20
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace hardcoded "Corey" references with generic "the user" and
"configured channel" so the script works for any clawdbot user.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
After a successful rollback, molt now triggers the clawdbot agent to
diagnose and fix the issue. The agent receives crash logs and context,
attempts common fixes, and reports to the user if manual intervention
is needed.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Molt is a self-healing update system for self-hosted Clawdbot instances.
It handles nightly updates from upstream with automatic rollback if
something breaks.
Key features:
- Pulls from upstream, installs deps, builds, restarts gateway
- Health check with stability window (catches crash loops)
- Automatic rollback to pre-update commit on failure
- Module manifest to define what *you* care about (personalized health checks)
- Changelog generation for morning reports
- Agentic recovery philosophy: capture context, let the AI fix edge cases
Files:
- docs/molt.md: Full PRD with architecture, config schema, and rationale
- scripts/molt.sh: Reference implementation (bash)
This is an RFC seeking feedback on approach and integration strategy.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>