diff --git a/src/commands/doctor-gateway-health.test.ts b/src/commands/doctor-gateway-health.test.ts index 3a84d6170eb..4cd21a5dd94 100644 --- a/src/commands/doctor-gateway-health.test.ts +++ b/src/commands/doctor-gateway-health.test.ts @@ -96,6 +96,25 @@ describe("probeGatewayMemoryStatus", () => { }); }); + it("propagates checked: false when gateway skipped the embedding probe", async () => { + // Gateway returns checked: false when called with probe: false and no cached + // availability data (SKIPPED_MEMORY_EMBEDDING_PROBE shape). + callGateway.mockResolvedValue({ + embedding: { + ok: false, + checked: false, + error: + "memory embedding readiness not checked; run `openclaw memory status --deep` to probe", + }, + }); + + await expect(probeGatewayMemoryStatus({ cfg })).resolves.toEqual({ + checked: false, + ready: false, + error: expect.stringContaining("not checked"), + }); + }); + it("keeps gateway request timeouts as explicit failures", async () => { callGateway.mockRejectedValue(new Error("gateway request timeout for doctor.memory.status")); diff --git a/src/commands/doctor-gateway-health.ts b/src/commands/doctor-gateway-health.ts index 12469d383c2..86a78131978 100644 --- a/src/commands/doctor-gateway-health.ts +++ b/src/commands/doctor-gateway-health.ts @@ -86,8 +86,14 @@ export async function probeGatewayMemoryStatus(params: { timeoutMs, config: params.cfg, }); + // Propagate the gateway's checked flag. When the gateway skips the embedding + // probe (probe: false path), it returns checked: false to signal that no + // readiness determination was made. Mapping that to checked: true here would + // cause the renderer to treat a skipped probe as a checked-but-not-ready + // failure and emit a false-positive warning for key-optional providers. + const gatewayChecked = payload.embedding.checked !== false; return { - checked: true, + checked: gatewayChecked, ready: payload.embedding.ok, error: payload.embedding.error, };