Skip to content

feat: opt-in auto-update for openclaw on container boot#307

Open
isaacrowntree wants to merge 1 commit intocloudflare:mainfrom
isaacrowntree:feat/auto-update-on-boot
Open

feat: opt-in auto-update for openclaw on container boot#307
isaacrowntree wants to merge 1 commit intocloudflare:mainfrom
isaacrowntree:feat/auto-update-on-boot

Conversation

@isaacrowntree
Copy link

Summary

  • Adds opt-in auto-update for openclaw on container cold start
  • Gated behind OPENCLAW_AUTO_UPDATE=true env var (no behavior change by default)
  • On boot, runs npm install -g openclaw@latest to pick up bug fixes without a full wrangler deploy
  • Falls back gracefully to the Dockerfile-pinned version if npm is unreachable

Changes

  • start-openclaw.sh: New self-update section before onboarding, gated by OPENCLAW_AUTO_UPDATE
  • src/types.ts: Add OPENCLAW_AUTO_UPDATE to MoltbotEnv
  • src/gateway/env.ts: Pass OPENCLAW_AUTO_UPDATE through to container

Usage

wrangler secret put OPENCLAW_AUTO_UPDATE
# Enter: true

Test plan

  • Without OPENCLAW_AUTO_UPDATE set: no change in behavior, skips update
  • With OPENCLAW_AUTO_UPDATE=true: logs version check, updates if newer version available
  • With npm unreachable: logs warning, continues with pinned version

🤖 Generated with Claude Code

When OPENCLAW_AUTO_UPDATE=true is set, start-openclaw.sh runs
npm install -g openclaw@latest on every cold start. This lets bug
fixes and new features land without a full wrangler deploy.

The Dockerfile-pinned version serves as a fallback if npm is
unreachable during boot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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