mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
fix(gateway): include build identity in status JSON (#123917)
* fix(gateway): preserve build id in status probes * chore: leave release notes to release automation
This commit is contained in:
committed by
GitHub
parent
b5957982e7
commit
784fac53b8
@@ -23,14 +23,14 @@ const callGatewayStatusProbe = vi.fn<
|
||||
ok: boolean;
|
||||
url?: string;
|
||||
error?: string | null;
|
||||
server?: { version?: string | null; connId?: string | null };
|
||||
server?: { version?: string | null; buildId?: string | null; connId?: string | null };
|
||||
version?: string | null;
|
||||
}>
|
||||
>(async (_opts?: unknown) => ({
|
||||
ok: true,
|
||||
url: "ws://127.0.0.1:19001",
|
||||
error: null,
|
||||
server: { version: "2026.5.6", connId: "conn-1" },
|
||||
server: { version: "2026.5.6", buildId: "build-2026.5.6", connId: "conn-1" },
|
||||
}));
|
||||
const isDefaultInstallIdentity = vi.fn((_env?: NodeJS.ProcessEnv) => true);
|
||||
const isGatewayExternallySupervised = vi.fn((_env?: NodeJS.ProcessEnv) => false);
|
||||
@@ -473,7 +473,11 @@ describe("gatherDaemonStatus", () => {
|
||||
expect(status.gateway?.version).toBe("2026.5.6");
|
||||
expect(status.rpc?.url).toBe("wss://127.0.0.1:19001");
|
||||
expect(status.rpc?.ok).toBe(true);
|
||||
expect(status.rpc?.server).toEqual({ version: "2026.5.6", connId: "conn-1" });
|
||||
expect(status.rpc?.server).toEqual({
|
||||
version: "2026.5.6",
|
||||
buildId: "build-2026.5.6",
|
||||
connId: "conn-1",
|
||||
});
|
||||
expect(status.cli?.version).toBe(VERSION);
|
||||
if (process.argv[1]) {
|
||||
expect(status.cli?.entrypoint).toBe(process.argv[1]);
|
||||
@@ -482,6 +486,26 @@ describe("gatherDaemonStatus", () => {
|
||||
expect(inspectWindowsGatewayFirewall).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("preserves probe build identity in deep JSON output", async () => {
|
||||
const status = await gatherStatus({ deep: true });
|
||||
const writeJson = vi.spyOn(defaultRuntime, "writeJson").mockImplementation(() => {});
|
||||
try {
|
||||
printDaemonStatus(status, { json: true, deep: true });
|
||||
expect(writeJson).toHaveBeenCalledOnce();
|
||||
expect(writeJson.mock.calls[0]?.[0]).toMatchObject({
|
||||
rpc: {
|
||||
server: {
|
||||
version: "2026.5.6",
|
||||
buildId: "build-2026.5.6",
|
||||
connId: "conn-1",
|
||||
},
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
writeJson.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
it("batches daemon and CLI port status inspection when ports differ", async () => {
|
||||
await gatherStatus();
|
||||
|
||||
|
||||
@@ -342,6 +342,7 @@ export type DaemonStatus = {
|
||||
};
|
||||
server?: {
|
||||
version?: string | null;
|
||||
buildId?: string | null;
|
||||
connId?: string | null;
|
||||
};
|
||||
version?: string | null;
|
||||
|
||||
@@ -65,6 +65,7 @@ function createProbe(
|
||||
},
|
||||
server: {
|
||||
version: "2026.4.24",
|
||||
buildId: "build-test",
|
||||
connId: "conn-test",
|
||||
},
|
||||
health: null,
|
||||
@@ -449,6 +450,11 @@ describe("gateway status output", () => {
|
||||
scopes: ["operator.read"],
|
||||
capability: "read_only",
|
||||
},
|
||||
server: {
|
||||
version: "2026.4.24",
|
||||
buildId: "build-test",
|
||||
connId: "conn-test",
|
||||
},
|
||||
self: null,
|
||||
config: null,
|
||||
health: null,
|
||||
|
||||
@@ -190,6 +190,7 @@ export function writeGatewayStatusJson(params: {
|
||||
close: entry.probe.close,
|
||||
},
|
||||
auth: entry.probe.auth,
|
||||
server: entry.probe.server,
|
||||
self: entry.self,
|
||||
config: entry.configSummary,
|
||||
health: entry.probe.health,
|
||||
|
||||
@@ -16,6 +16,7 @@ const gatewayClientState = vi.hoisted(() => ({
|
||||
} as { role?: string; scopes?: string[] } | undefined,
|
||||
helloServer: {
|
||||
version: "2026.4.24",
|
||||
buildId: "build-test",
|
||||
connId: "conn-test",
|
||||
},
|
||||
connectError: "scope upgrade pending approval (requestId: req-123)",
|
||||
@@ -414,6 +415,7 @@ describe("probeGateway", () => {
|
||||
});
|
||||
expect(result.server).toEqual({
|
||||
version: "2026.4.24",
|
||||
buildId: "build-test",
|
||||
connId: "conn-test",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -47,6 +47,7 @@ export type GatewayProbeAuthSummary = {
|
||||
|
||||
export type GatewayProbeServerSummary = {
|
||||
version: string | null;
|
||||
buildId?: string;
|
||||
connId: string | null;
|
||||
};
|
||||
|
||||
@@ -440,6 +441,9 @@ export async function probeGateway(opts: {
|
||||
authMetadataPresent = typeof hello?.auth === "object" && hello.auth !== null;
|
||||
server = {
|
||||
version: typeof hello?.server?.version === "string" ? hello.server.version : null,
|
||||
...(typeof hello?.server?.buildId === "string"
|
||||
? { buildId: hello.server.buildId }
|
||||
: {}),
|
||||
connId: typeof hello?.server?.connId === "string" ? hello.server.connId : null,
|
||||
};
|
||||
auth = resolveProbeAuthSummary({
|
||||
|
||||
Reference in New Issue
Block a user