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:
@@ -40,8 +40,8 @@
|
|||||||
"reasoning": false,
|
"reasoning": false,
|
||||||
"input": ["text"],
|
"input": ["text"],
|
||||||
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
|
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
|
||||||
"contextWindow": 4096,
|
"contextWindow": 200000,
|
||||||
"maxTokens": 64
|
"maxTokens": 8192
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
12
no-reply-api/package-lock.json
generated
Normal file
12
no-reply-api/package-lock.json
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "whispergate-no-reply-api",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "whispergate-no-reply-api",
|
||||||
|
"version": "0.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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) {
|
function getJson(pathKey) {
|
||||||
const out = runOpenclaw(["config", "get", pathKey, "--json"], { allowFail: true });
|
const out = runOpenclaw(["config", "get", pathKey, "--json"], { allowFail: true });
|
||||||
@@ -174,17 +162,15 @@ if (mode === "install") {
|
|||||||
};
|
};
|
||||||
setJson(PATH_PROVIDERS, providers);
|
setJson(PATH_PROVIDERS, providers);
|
||||||
|
|
||||||
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),
|
||||||
[PATH_PROVIDERS]: getJson(PATH_PROVIDERS),
|
[PATH_PROVIDERS]: getJson(PATH_PROVIDERS),
|
||||||
};
|
};
|
||||||
writeRecord("install", before, after);
|
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] record: ${RECORD_PATH}`);
|
||||||
|
console.log("[whispergate] >>> restart gateway to apply: openclaw gateway restart");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
fs.copyFileSync(BACKUP_PATH, OPENCLAW_CONFIG_PATH);
|
fs.copyFileSync(BACKUP_PATH, OPENCLAW_CONFIG_PATH);
|
||||||
console.error(`[whispergate] install failed; rollback complete: ${String(e)}`);
|
console.error(`[whispergate] install failed; rollback complete: ${String(e)}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user