fix(doctor): propagate gateway skipped-probe flag through adapter

clawsweeper P1: probeGatewayMemoryStatus always returned checked: true
on successful RPC, silently discarding payload.embedding.checked === false
from the SKIPPED_MEMORY_EMBEDDING_PROBE gateway response. The renderer
guard in noteMemorySearchHealth (added in prior commit) never saw checked:
false in real execution — only on timeout paths.

Fix: propagate checked flag from payload.embedding.checked so a skipped
gateway probe surfaces as checked: false to the renderer, allowing the
key-optional provider guard to suppress the false-positive warning.

Add adapter-level regression test that verifies the skipped payload shape
from doctor.memory.status reaches GatewayMemoryProbe as checked: false.
This commit is contained in:
HCL
2026-04-30 07:07:01 +08:00
committed by Peter Steinberger
parent 45082aaed3
commit 34d62b0650
2 changed files with 26 additions and 1 deletions

View File

@@ -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"));

View File

@@ -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,
};