Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kiloclaw/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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@7.1.13

# Install Go (available at runtime for users to `go install` additional tools)
ENV GO_VERSION=1.26.0
Expand Down
2 changes: 1 addition & 1 deletion kiloclaw/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -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@7.1.13

# Install Go (available at runtime for users to `go install` additional tools)
ENV GO_VERSION=1.26.0
Expand Down
22 changes: 22 additions & 0 deletions kiloclaw/controller/src/index.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Auto-upgrade is still disabled on non-kilo-cli instances

instance-features.md documents KILOCLAW_KILO_CLI as a config-only flag because the kilo binary is always present in the image. Gating the background npm install -g @kilocode/cli@latest behind this flag means instances without that feature stay on the baked-in 7.1.13, so they still do not pick up newer CLI releases unless the image is rebuilt.

// 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') };
Expand Down
Loading