feat(installer): restart gateway and validate custom no-reply model visibility after install
This commit is contained in:
@@ -66,6 +66,7 @@ The script:
|
|||||||
- writes via `openclaw config set ... --json`
|
- writes via `openclaw config set ... --json`
|
||||||
- creates config backup first
|
- creates config backup first
|
||||||
- restores backup automatically if any install step fails
|
- 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:
|
- writes a change record for every install/uninstall:
|
||||||
- directory: `~/.openclaw/whispergate-install-records/`
|
- directory: `~/.openclaw/whispergate-install-records/`
|
||||||
- latest pointer: `~/.openclaw/whispergate-install-record-latest.json`
|
- latest pointer: `~/.openclaw/whispergate-install-record-latest.json`
|
||||||
|
|||||||
@@ -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) {
|
function getJson(pathKey) {
|
||||||
const out = runOpenclaw(["config", "get", pathKey, "--json"], { allowFail: true });
|
const out = runOpenclaw(["config", "get", pathKey, "--json"], { allowFail: true });
|
||||||
if (out == null || out === "") return { exists: false };
|
if (out == null || out === "") return { exists: false };
|
||||||
@@ -158,6 +171,9 @@ if (mode === "install") {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
runOpenclaw(["gateway", "restart"]);
|
||||||
|
validateNoReplyModelAvailable();
|
||||||
|
|
||||||
const after = {
|
const after = {
|
||||||
[PATH_PLUGINS_LOAD]: getJson(PATH_PLUGINS_LOAD),
|
[PATH_PLUGINS_LOAD]: getJson(PATH_PLUGINS_LOAD),
|
||||||
[PATH_PLUGIN_ENTRY]: getJson(PATH_PLUGIN_ENTRY),
|
[PATH_PLUGIN_ENTRY]: getJson(PATH_PLUGIN_ENTRY),
|
||||||
|
|||||||
Reference in New Issue
Block a user