fix: remove gateway restart from installer, let user restart manually

Root cause: installer called 'openclaw gateway restart' (async via systemd)
then immediately validated model visibility — race condition caused validation
to fail and rollback the correct config.

Fix: remove restart + validation from script entirely. Script only writes config.
User restarts gateway manually after install completes.

Also fix CONFIG.example.json: contextWindow 4096->200000, maxTokens 64->8192
(OpenClaw requires minimum 16000 contextWindow).
This commit is contained in:
zhi
2026-02-26 08:45:37 +00:00
parent 15975e3970
commit fd6c4dd3a2
3 changed files with 16 additions and 18 deletions

View File

@@ -45,18 +45,6 @@ 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 });
@@ -174,17 +162,15 @@ if (mode === "install") {
};
setJson(PATH_PROVIDERS, providers);
runOpenclaw(["gateway", "restart"]);
validateNoReplyModelAvailable();
const after = {
[PATH_PLUGINS_LOAD]: getJson(PATH_PLUGINS_LOAD),
[PATH_PLUGIN_ENTRY]: getJson(PATH_PLUGIN_ENTRY),
[PATH_PROVIDERS]: getJson(PATH_PROVIDERS),
};
writeRecord("install", before, after);
console.log("[whispergate] install ok");
console.log("[whispergate] install ok (config written)");
console.log(`[whispergate] record: ${RECORD_PATH}`);
console.log("[whispergate] >>> restart gateway to apply: openclaw gateway restart");
} catch (e) {
fs.copyFileSync(BACKUP_PATH, OPENCLAW_CONFIG_PATH);
console.error(`[whispergate] install failed; rollback complete: ${String(e)}`);