From f9ad193d28d4162282f88b5d2355c652561e79ff Mon Sep 17 00:00:00 2001 From: DJTBOT Date: Thu, 5 Feb 2026 13:04:53 -0800 Subject: [PATCH] chore: remove legacy moltbot/clawdbot compatibility What: - drop MOLTBOT_* and CLAWDBOT_* env wiring from HM + wrappers - update gateway log-dir patch to target current upstream logger.ts - update config options generator to require OpenClawSchema only - update hello-world plugin example env var + module path - rename RFC filename to remove moltbot naming Why: - upstream is OpenClaw; keep nix-openclaw opinionated + clean Tests: - bash -n scripts/update-pins.sh --- ...x.md => 2026-01-02-declarative-openclaw-nix.md} | 0 examples/hello-world-plugin/AGENTS.md | 2 +- examples/hello-world-plugin/go.mod | 2 +- examples/hello-world-plugin/main.go | 2 +- nix/modules/home-manager/openclaw/config.nix | 14 -------------- nix/scripts/gateway-install.sh | 3 +-- nix/scripts/gateway-postpatch.sh | 6 +++--- nix/scripts/gateway-tests-check.sh | 1 - nix/scripts/generate-config-options.ts | 4 ++-- 9 files changed, 9 insertions(+), 25 deletions(-) rename docs/rfc/{2026-01-02-declarative-moltbot-nix.md => 2026-01-02-declarative-openclaw-nix.md} (100%) diff --git a/docs/rfc/2026-01-02-declarative-moltbot-nix.md b/docs/rfc/2026-01-02-declarative-openclaw-nix.md similarity index 100% rename from docs/rfc/2026-01-02-declarative-moltbot-nix.md rename to docs/rfc/2026-01-02-declarative-openclaw-nix.md diff --git a/examples/hello-world-plugin/AGENTS.md b/examples/hello-world-plugin/AGENTS.md index 4113470..1cd4e92 100644 --- a/examples/hello-world-plugin/AGENTS.md +++ b/examples/hello-world-plugin/AGENTS.md @@ -3,5 +3,5 @@ This plugin is intentionally tiny. Knobs -- MOLTBOT_USER (optional): name to greet +- OPENCLAW_USER (optional): name to greet diff --git a/examples/hello-world-plugin/go.mod b/examples/hello-world-plugin/go.mod index 7996701..403ad20 100644 --- a/examples/hello-world-plugin/go.mod +++ b/examples/hello-world-plugin/go.mod @@ -1,3 +1,3 @@ -module github.com/acme/hello-world-moltbot +module github.com/acme/hello-world-openclaw go 1.22 diff --git a/examples/hello-world-plugin/main.go b/examples/hello-world-plugin/main.go index 9b184d1..0385fc1 100644 --- a/examples/hello-world-plugin/main.go +++ b/examples/hello-world-plugin/main.go @@ -6,7 +6,7 @@ import ( ) func main() { - name := os.Getenv("MOLTBOT_USER") + name := os.Getenv("OPENCLAW_USER") if name == "" { name = "human" } diff --git a/nix/modules/home-manager/openclaw/config.nix b/nix/modules/home-manager/openclaw/config.nix index 1abc80d..50a1564 100644 --- a/nix/modules/home-manager/openclaw/config.nix +++ b/nix/modules/home-manager/openclaw/config.nix @@ -154,14 +154,6 @@ let OPENCLAW_STATE_DIR = inst.stateDir; OPENCLAW_IMAGE_BACKEND = "sips"; OPENCLAW_NIX_MODE = "1"; - MOLTBOT_CONFIG_PATH = inst.configPath; - MOLTBOT_STATE_DIR = inst.stateDir; - MOLTBOT_IMAGE_BACKEND = "sips"; - MOLTBOT_NIX_MODE = "1"; - CLAWDBOT_CONFIG_PATH = inst.configPath; - CLAWDBOT_STATE_DIR = inst.stateDir; - CLAWDBOT_IMAGE_BACKEND = "sips"; - CLAWDBOT_NIX_MODE = "1"; }; }; }; @@ -182,12 +174,6 @@ let "OPENCLAW_CONFIG_PATH=${inst.configPath}" "OPENCLAW_STATE_DIR=${inst.stateDir}" "OPENCLAW_NIX_MODE=1" - "MOLTBOT_CONFIG_PATH=${inst.configPath}" - "MOLTBOT_STATE_DIR=${inst.stateDir}" - "MOLTBOT_NIX_MODE=1" - "CLAWDBOT_CONFIG_PATH=${inst.configPath}" - "CLAWDBOT_STATE_DIR=${inst.stateDir}" - "CLAWDBOT_NIX_MODE=1" ]; StandardOutput = "append:${inst.logPath}"; StandardError = "append:${inst.logPath}"; diff --git a/nix/scripts/gateway-install.sh b/nix/scripts/gateway-install.sh index 7ea5d1c..f1a0a1e 100755 --- a/nix/scripts/gateway-install.sh +++ b/nix/scripts/gateway-install.sh @@ -80,5 +80,4 @@ if [ -n "$hasown_src" ]; then fi fi -bash -e -c '. "$STDENV_SETUP"; makeWrapper "$NODE_BIN" "$out/bin/openclaw" --add-flags "$out/lib/openclaw/dist/index.js" --set-default OPENCLAW_NIX_MODE "1" --set-default MOLTBOT_NIX_MODE "1" --set-default CLAWDBOT_NIX_MODE "1"' -ln -s "$out/bin/openclaw" "$out/bin/moltbot" +bash -e -c '. "$STDENV_SETUP"; makeWrapper "$NODE_BIN" "$out/bin/openclaw" --add-flags "$out/lib/openclaw/dist/index.js" --set-default OPENCLAW_NIX_MODE "1"' diff --git a/nix/scripts/gateway-postpatch.sh b/nix/scripts/gateway-postpatch.sh index f86366f..8dd3742 100755 --- a/nix/scripts/gateway-postpatch.sh +++ b/nix/scripts/gateway-postpatch.sh @@ -4,9 +4,9 @@ if [ -f package.json ]; then "$REMOVE_PACKAGE_MANAGER_FIELD_SH" package.json fi -if [ -f src/logging.ts ]; then - if ! grep -q "OPENCLAW_LOG_DIR" src/logging.ts; then - sed -i 's/export const DEFAULT_LOG_DIR = "\/tmp\/moltbot";/export const DEFAULT_LOG_DIR = process.env.OPENCLAW_LOG_DIR ?? "\/tmp\/moltbot";/' src/logging.ts +if [ -f src/logging/logger.ts ]; then + if ! grep -q "OPENCLAW_LOG_DIR" src/logging/logger.ts; then + sed -i 's/export const DEFAULT_LOG_DIR = "\/tmp\/openclaw";/export const DEFAULT_LOG_DIR = process.env.OPENCLAW_LOG_DIR ?? "\/tmp\/openclaw";/' src/logging/logger.ts fi fi diff --git a/nix/scripts/gateway-tests-check.sh b/nix/scripts/gateway-tests-check.sh index 2d369aa..21ea20b 100755 --- a/nix/scripts/gateway-tests-check.sh +++ b/nix/scripts/gateway-tests-check.sh @@ -13,7 +13,6 @@ export HOME="$(mktemp -d)" export TMPDIR="${HOME}/tmp" mkdir -p "$TMPDIR" export OPENCLAW_LOG_DIR="${TMPDIR}/openclaw-logs" -export MOLTBOT_LOG_PATH="${OPENCLAW_LOG_DIR}/openclaw-gateway.log" mkdir -p "$OPENCLAW_LOG_DIR" mkdir -p /tmp/openclaw || true chmod 700 /tmp/openclaw || true diff --git a/nix/scripts/generate-config-options.ts b/nix/scripts/generate-config-options.ts index 93ace0e..be7f249 100644 --- a/nix/scripts/generate-config-options.ts +++ b/nix/scripts/generate-config-options.ts @@ -17,9 +17,9 @@ const schemaUrl = pathToFileURL(schemaPath).href; const loadSchema = async (): Promise> => { const mod = await import(schemaUrl); - const schema = mod.OpenClawSchema ?? mod.MoltbotSchema; + const schema = mod.OpenClawSchema; if (!schema || typeof schema.toJSONSchema !== "function") { - console.error(`OpenClawSchema/MoltbotSchema not found at ${schemaPath}`); + console.error(`OpenClawSchema not found at ${schemaPath}`); process.exit(1); } return schema.toJSONSchema({