Skip to content

feat: auto-update system for clawctl#30

Merged
TimBeyer merged 15 commits intomainfrom
feat/pluggable-capability-config
Mar 18, 2026
Merged

feat: auto-update system for clawctl#30
TimBeyer merged 15 commits intomainfrom
feat/pluggable-capability-config

Conversation

@TimBeyer
Copy link
Owner

@TimBeyer TimBeyer commented Mar 18, 2026

Summary

  • Pre-command hook checks GitHub releases (4h cached TTL, 3s timeout, silent degradation)
  • Prompts user with per-version dismissal
  • clawctl update downloads the new binary, atomically replaces itself, then re-execs to push the new embedded claw to running VMs
  • Stopped VMs get pendingClawUpdate flag, applied on next clawctl start
  • New claw migrate command runs only capability migration chains (not full re-provisioning)
  • Dev mode guard prevents clawctl-dev update from overwriting the bun binary
  • Migration failures keep pendingClawUpdate set for retry — avoids bricking setups
  • Versioning and migration evolution strategy documented in docs/capabilities.md
  • CLAUDE.md expanded with TASK.md structure guidance and plan mode handover rules

Test plan

  • All 274 unit tests pass (bun test)
  • Typecheck clean (tsc --noEmit)
  • Lint clean (eslint .)
  • Manual: build with version 0.0.1, run any command, verify update prompt appears
  • Manual: dismiss update, verify no re-prompt; bump "latest", verify prompt returns
  • Manual: clawctl update downloads, replaces, pushes claw to running VM
  • Manual: update with stopped VM, verify pendingClawUpdate set, start, verify claw pushed
  • Manual: clawctl-dev update prints dev mode message and exits
  • Manual: network disconnect → command runs with no prompt/error

🤖 Generated with Claude Code

@TimBeyer TimBeyer force-pushed the feat/pluggable-capability-config branch from a184849 to ce1a245 Compare March 18, 2026 20:59
@TimBeyer TimBeyer changed the title feat: pluggable capability config + auto-update system feat: pluggable capability config, auto-update system, and review fixes Mar 18, 2026
@TimBeyer TimBeyer changed the title feat: pluggable capability config, auto-update system, and review fixes feat: auto-update system with pluggable capability config Mar 18, 2026
TimBeyer and others added 14 commits March 18, 2026 22:41
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add semver dependency for version comparison
- Add update-state.ts: cached update state with 4h TTL
- Add update-check.ts: GitHub release checker with silent degradation
- Add update-apply.ts: binary download/replace + VM update push
- Add clawVersion/pendingClawUpdate fields to RegistryEntry
- Export deployClaw from provision module

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add `clawctl update` command (check + download + re-exec for VM updates)
- Add `--apply-vm` internal flag for the new binary to push claw to VMs
- Add pre-command update hook with user prompt and per-version dismissal
- Skip update check for update/daemon/completions commands and dev mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Runs migration chains for capabilities with version drift after a
claw binary update. Skips capabilities where the version bump has
no explicit migration (binary update is sufficient). Supports --json
for structured output consumed by the host.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a VM was stopped during a clawctl update, pendingClawUpdate is set.
On next `clawctl start`, the new claw binary is pushed and `claw migrate`
is run before notifying the daemon.

Also removes unused tmpdir import from update-apply.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Running `clawctl-dev update` via bun would overwrite the bun binary
itself with the clawctl release zip. Add a dev mode check (same as
the pre-command hook) to bail early with a helpful message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Context section to TASK.md template. Expand Plan section to
require design rationale (alternatives, trade-offs, rejected
approaches) rather than just implementation steps. Clarify that
Notes are for implementation-time discoveries, not design decisions.

Add explicit guidance that plan mode plans must include all context
needed for the TASK.md, since context is cleared before implementation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Keep the flag set so migrations are retried on next start. A future
clawctl update may ship a fixed claw binary that unblocks it. This
avoids bricking a setup if a migration has a bug.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The empty-array return from findMigrationPath is handled differently
by runner.ts (falls through to re-provision) and migrate.ts (skips).
Update the JSDoc to document both paths and note that explicit
re-provisioning during updates should be a dedicated capability hook
if ever needed, not a silent fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simplify findMigrationPath JSDoc to just describe the function. Add
a "Versioning and migrations" section to docs/capabilities.md that
explains the two contexts (full provision vs binary update), when
migrations are needed vs skipped, divergence risk, and the escape
hatch (re-provision from scratch).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Version

- Move semver dependency from root to @clawctl/host-core where it's used
- Wrap preAction update hook in try/catch so failures don't crash the
  user's command with a raw stack trace
- Actually set clawVersion in the registry on successful update (was
  always left undefined despite the comment saying callers would set it)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TimBeyer TimBeyer changed the title feat: auto-update system with pluggable capability config feat: auto-update system for clawctl Mar 18, 2026
@TimBeyer TimBeyer force-pushed the feat/pluggable-capability-config branch from 5f764c0 to 9650088 Compare March 18, 2026 21:43
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TimBeyer TimBeyer merged commit 0689d2d into main Mar 18, 2026
4 checks passed
@TimBeyer TimBeyer deleted the feat/pluggable-capability-config branch March 18, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant