Update: harden control UI asset handling in update flow (#10146)

* Update: harden control UI asset handling in update flow

* fix: harden update doctor entrypoint guard (#10146) (thanks @gumadeiras)
This commit is contained in:
Gustavo Madeira Santana
2026-02-06 01:14:00 -05:00
committed by GitHub
parent 50e687d17d
commit c75275f109
9 changed files with 424 additions and 15 deletions

View File

@@ -2,6 +2,10 @@ import fs from "node:fs/promises";
import path from "node:path";
import type { RuntimeEnv } from "../runtime.js";
import type { DoctorPrompter } from "./doctor-prompter.js";
import {
resolveControlUiDistIndexHealth,
resolveControlUiDistIndexPathForRoot,
} from "../infra/control-ui-assets.js";
import { resolveOpenClawPackageRoot } from "../infra/openclaw-root.js";
import { runCommandWithTimeout } from "../process/exec.js";
import { note } from "../terminal/note.js";
@@ -21,7 +25,11 @@ export async function maybeRepairUiProtocolFreshness(
}
const schemaPath = path.join(root, "src/gateway/protocol/schema.ts");
const uiIndexPath = path.join(root, "dist/control-ui/index.html");
const uiHealth = await resolveControlUiDistIndexHealth({
root,
argv1: process.argv[1],
});
const uiIndexPath = uiHealth.indexPath ?? resolveControlUiDistIndexPathForRoot(root);
try {
const [schemaStats, uiStats] = await Promise.all([