From 44f7aa61469e703f6e9c7e89ae9945ed3a415dc6 Mon Sep 17 00:00:00 2001 From: Remon Oldenbeuving Date: Tue, 31 Mar 2026 17:55:49 +0200 Subject: [PATCH 1/2] chore(kiloclaw): unpin @kilocode/cli version in Dockerfiles Install @kilocode/cli@latest instead of pinning to 7.0.46 so the image always picks up the newest release at build time. --- kiloclaw/Dockerfile | 2 +- kiloclaw/Dockerfile.local | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kiloclaw/Dockerfile b/kiloclaw/Dockerfile index 49b8daad51..0e3ef7de2d 100644 --- a/kiloclaw/Dockerfile +++ b/kiloclaw/Dockerfile @@ -58,7 +58,7 @@ RUN npm install -g github:Kilo-Org/openclaw-channel-streamchat#catrielmuller/att RUN npm install -g @steipete/summarize@0.12.0 # Install Kilo CLI (agentic coding assistant for the terminal) -RUN npm install -g @kilocode/cli@7.0.46 +RUN npm install -g @kilocode/cli@latest # Install Go (available at runtime for users to `go install` additional tools) ENV GO_VERSION=1.26.0 diff --git a/kiloclaw/Dockerfile.local b/kiloclaw/Dockerfile.local index aec68d3005..d669074d5e 100644 --- a/kiloclaw/Dockerfile.local +++ b/kiloclaw/Dockerfile.local @@ -59,7 +59,7 @@ RUN npm install -g github:Kilo-Org/openclaw-channel-streamchat#catrielmuller/att RUN npm install -g @steipete/summarize@0.12.0 # Install Kilo CLI (agentic coding assistant for the terminal) -RUN npm install -g @kilocode/cli@7.0.46 +RUN npm install -g @kilocode/cli@latest # Install Go (available at runtime for users to `go install` additional tools) ENV GO_VERSION=1.26.0 From 430b668b331da8d7bf96de3b064676de30b95285 Mon Sep 17 00:00:00 2001 From: Remon Oldenbeuving Date: Wed, 1 Apr 2026 11:57:36 +0200 Subject: [PATCH 2/2] chore(kiloclaw): bump @kilocode/cli to 7.1.13 and auto-upgrade at startup Update both Dockerfiles to pin @kilocode/cli@7.1.13 (latest today). Add a fire-and-forget background upgrade in the controller that runs npm install -g @kilocode/cli@latest after the gateway is ready, so every instance picks up the newest release without needing an image rebuild. The baked-in version serves as a fallback if the upgrade fails. --- kiloclaw/Dockerfile | 2 +- kiloclaw/Dockerfile.local | 2 +- kiloclaw/controller/src/index.ts | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/kiloclaw/Dockerfile b/kiloclaw/Dockerfile index 0e3ef7de2d..70f1857064 100644 --- a/kiloclaw/Dockerfile +++ b/kiloclaw/Dockerfile @@ -58,7 +58,7 @@ RUN npm install -g github:Kilo-Org/openclaw-channel-streamchat#catrielmuller/att RUN npm install -g @steipete/summarize@0.12.0 # Install Kilo CLI (agentic coding assistant for the terminal) -RUN npm install -g @kilocode/cli@latest +RUN npm install -g @kilocode/cli@7.1.13 # Install Go (available at runtime for users to `go install` additional tools) ENV GO_VERSION=1.26.0 diff --git a/kiloclaw/Dockerfile.local b/kiloclaw/Dockerfile.local index d669074d5e..d32324c6e7 100644 --- a/kiloclaw/Dockerfile.local +++ b/kiloclaw/Dockerfile.local @@ -59,7 +59,7 @@ RUN npm install -g github:Kilo-Org/openclaw-channel-streamchat#catrielmuller/att RUN npm install -g @steipete/summarize@0.12.0 # Install Kilo CLI (agentic coding assistant for the terminal) -RUN npm install -g @kilocode/cli@latest +RUN npm install -g @kilocode/cli@7.1.13 # Install Go (available at runtime for users to `go install` additional tools) ENV GO_VERSION=1.26.0 diff --git a/kiloclaw/controller/src/index.ts b/kiloclaw/controller/src/index.ts index 1ddfdc5910..8814b067cb 100644 --- a/kiloclaw/controller/src/index.ts +++ b/kiloclaw/controller/src/index.ts @@ -1,4 +1,5 @@ import http from 'node:http'; +import { execFile } from 'node:child_process'; import { Duplex, Readable } from 'node:stream'; import { Hono } from 'hono'; import { @@ -416,6 +417,27 @@ export async function startController(env: NodeJS.ProcessEnv = process.env): Pro console.log( `[controller] Ready version=${CONTROLLER_VERSION} commit=${CONTROLLER_COMMIT} requireProxyToken=${config.requireProxyToken} wsIdleTimeoutMs=${config.wsIdleTimeoutMs} wsHandshakeTimeoutMs=${config.wsHandshakeTimeoutMs} maxWsConnections=${config.maxWsConnections}` ); + + // ── Background: upgrade Kilo CLI ──────────────────────────────────── + // The Docker image bakes in a pinned version; this upgrades to the + // latest release in the background so the instance always has the + // newest CLI without requiring an image rebuild. + if (env.KILOCLAW_KILO_CLI === 'true') { + // Strip NPM_CONFIG_PREFIX so the install overwrites the system-wide + // binary in /usr/local/bin instead of writing to the per-user prefix. + const upgradeEnv = { ...process.env }; + delete upgradeEnv.NPM_CONFIG_PREFIX; + execFile('npm', ['install', '-g', '@kilocode/cli@latest'], { env: upgradeEnv }, err => { + if (err) { + console.warn( + '[kilo-cli] Background upgrade failed (using baked-in version):', + err.message + ); + } else { + console.log('[kilo-cli] Upgraded to latest version'); + } + }); + } } catch (err) { const fullError = err instanceof Error ? err.message : String(err); controllerState.current = { state: 'degraded', error: toPublicDegradedError('gateway-start') };