fix(update): honor update.channel for update.run

This commit is contained in:
Peter Steinberger
2026-02-03 17:57:44 -08:00
parent 61a7fc5e0e
commit bbe9cb3022
5 changed files with 98 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import type { GatewayRequestHandlers } from "./types.js";
import { loadConfig } from "../../config/config.js";
import { resolveOpenClawPackageRoot } from "../../infra/openclaw-root.js";
import {
formatDoctorNonInteractiveHint,
@@ -6,6 +7,7 @@ import {
writeRestartSentinel,
} from "../../infra/restart-sentinel.js";
import { scheduleGatewaySigusr1Restart } from "../../infra/restart.js";
import { normalizeUpdateChannel } from "../../infra/update-channels.js";
import { runGatewayUpdate } from "../../infra/update-runner.js";
import {
ErrorCodes,
@@ -48,6 +50,8 @@ export const updateHandlers: GatewayRequestHandlers = {
let result: Awaited<ReturnType<typeof runGatewayUpdate>>;
try {
const config = loadConfig();
const configChannel = normalizeUpdateChannel(config.update?.channel);
const root =
(await resolveOpenClawPackageRoot({
moduleUrl: import.meta.url,
@@ -58,6 +62,7 @@ export const updateHandlers: GatewayRequestHandlers = {
timeoutMs,
cwd: root,
argv1: process.argv[1],
channel: configChannel ?? undefined,
});
} catch (err) {
result = {