feat(installer): restart gateway and validate custom no-reply model visibility after install
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user