feat(installer): restart gateway and validate custom no-reply model visibility after install

This commit is contained in:
2026-02-26 06:14:06 +00:00
parent 1746fb33ad
commit 875cd66d34
2 changed files with 17 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ The script:
- writes via `openclaw config set ... --json`
- creates config backup first
- restores backup automatically if any install step fails
- restarts gateway during install, then validates `whisper-gateway/no-reply` is visible via `openclaw models list/status`
- writes a change record for every install/uninstall:
- directory: `~/.openclaw/whispergate-install-records/`
- latest pointer: `~/.openclaw/whispergate-install-record-latest.json`

View File

@@ -45,6 +45,19 @@ function runOpenclaw(args, { allowFail = false } = {}) {
}
}
function validateNoReplyModelAvailable() {
const modelRef = `${NO_REPLY_PROVIDER_ID}/${NO_REPLY_MODEL_ID}`;
const list = runOpenclaw(["models", "list"], { allowFail: true }) || "";
if (!list.includes(modelRef)) {
throw new Error(`post-install validation failed: model not listed: ${modelRef}`);
}
const status = runOpenclaw(["models", "status", "--json"], { allowFail: true }) || "";
if (!status.includes(NO_REPLY_PROVIDER_ID)) {
throw new Error(`post-install validation failed: provider not visible in models status: ${NO_REPLY_PROVIDER_ID}`);
}
}
function getJson(pathKey) {
const out = runOpenclaw(["config", "get", pathKey, "--json"], { allowFail: true });
if (out == null || out === "") return { exists: false };
@@ -158,6 +171,9 @@ if (mode === "install") {
],
});
runOpenclaw(["gateway", "restart"]);
validateNoReplyModelAvailable();
const after = {
[PATH_PLUGINS_LOAD]: getJson(PATH_PLUGINS_LOAD),
[PATH_PLUGIN_ENTRY]: getJson(PATH_PLUGIN_ENTRY),