fix: clarify gateway version mismatch warnings

This commit is contained in:
sallyom
2026-05-08 00:20:45 -04:00
committed by Sally O'Malley
parent 9e58cc82c8
commit 397cf2b9ff
6 changed files with 44 additions and 24 deletions

View File

@@ -157,7 +157,7 @@ describe("printDaemonStatus", () => {
expect(runtime.log).toHaveBeenCalledWith(expect.stringContaining("Capability: write-capable"));
});
it("prints CLI and gateway versions with stale wrapper guidance when they differ", () => {
it("prints CLI and gateway versions with readable guidance when they differ", () => {
printDaemonStatus(
{
cli: {
@@ -195,10 +195,12 @@ describe("printDaemonStatus", () => {
);
expect(runtime.log).toHaveBeenCalledWith(expect.stringContaining("Gateway version: 2026.5.6"));
expect(runtime.error).toHaveBeenCalledWith(
expect.stringContaining("CLI/runtime version skew detected"),
expect.stringContaining("this OpenClaw command is version 2026.4.23"),
);
expect(runtime.error).toHaveBeenCalledWith(
expect.stringContaining("stale PATH/global wrappers"),
expect.stringContaining(
"if this mismatch is unexpected, update PATH so `openclaw` points to the version you want",
),
);
});

View File

@@ -193,12 +193,12 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
if (status.cli?.version && status.cli.version !== gatewayVersion) {
defaultRuntime.error(
warnText(
`Warning: CLI/runtime version skew detected. CLI is ${status.cli.version}; gateway is ${gatewayVersion}.`,
`Warning: this OpenClaw command is version ${status.cli.version}, but the running Gateway is version ${gatewayVersion}.`,
),
);
defaultRuntime.error(
warnText(
`Fix: check for stale PATH/global wrappers with \`command -v openclaw\`, \`readlink -f "$(command -v openclaw)"\`, and \`openclaw --version\`; reinstall the gateway service from the intended binary if needed.`,
"Check `openclaw --version`, `which openclaw`, and `openclaw gateway status --deep`; if this mismatch is unexpected, update PATH so `openclaw` points to the version you want, or reinstall the Gateway service from that same OpenClaw install.",
),
);
}