Conversation
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>
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>
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>
- 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>
- Add detailed cron job prompts for nightly update and morning report - Add notify.target field to config.json (use platform user IDs, not usernames) - Add troubleshooting section for common notification issues - Document freshness check (30h window) to avoid stale reports - Explain message tool fallback behavior
- Add error handling for git fetch in Phase 0 - Add error handling for pnpm install and build in Phase 1 - Fix heredoc quoting to allow variable expansion in recovery prompt - Use time-based health check loop instead of counter-based - Standardize changelog path to ~/.clawdbot/molt/changelog.md - Make wake command syntax consistent (--mode now) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cosmo-kring
added a commit
that referenced
this pull request
Jan 26, 2026
Adds the molt update system with portable configuration: - Environment variable overrides for paths (CLAWDBOT_DIR, WORKSPACE_DIR, etc.) - XDG_RUNTIME_DIR export for systemctl --user on headless servers - Sensible defaults that work across different setups From: #2 Co-Authored-By: CoreyH <corey@example.com>
- 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
CoreyH
pushed a commit
to KRING-Ventures/cosmo-clawdbot
that referenced
this pull request
Feb 1, 2026
Adds the molt update system with portable configuration: - Environment variable overrides for paths (CLAWDBOT_DIR, WORKSPACE_DIR, etc.) - XDG_RUNTIME_DIR export for systemctl --user on headless servers - Sensible defaults that work across different setups From: CoreyH#2 Co-Authored-By: CoreyH <corey@example.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Molt is a self-healing update system for self-hosted Clawdbot instances. It handles nightly updates from upstream with automatic rollback if something breaks.
The Problem
Running Clawdbot on a self-hosted server means you want automatic updates. But updates can break things:
pnpm installfails (network, deps)Currently: bot goes silent, you discover hours later, SSH in, diagnose, fix.
The Solution
Molt runs nightly and:
Key Design Decisions
Agentic Recovery
Traditional self-updaters are deterministic (blue/green, staging dirs). Molt is simpler: try, verify, rollback if broken. If rollback also fails, capture context for the AI (or human) to fix it.
Module Manifest
Personalized health checks. If you only use Slack, a broken Discord adapter isn't worth rolling back for:
{ "modules": { "channels": ["slack"] }, "healthCriteria": { "channels": "all" } }Files Changed
docs/molt.md— Full PRD with architecture and rationalescripts/molt.sh— Reference implementation (bash).gitignore— Ignore local workspace filesStatus
Running in production. Successfully updated 289 commits this morning:
Open Questions
RFC — seeking feedback before formal upstream PR.