mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 19:14:33 +00:00
fix(doctor): skip embedding provider check when QMD backend is active (openclaw#17295) thanks @miloudbelarebia
Verified: - pnpm build - pnpm check (fails on baseline formatting drift in files identical to origin/main) - pnpm test:macmini Co-authored-by: miloudbelarebia <52387093+miloudbelarebia@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
|
- Commands/Doctor: skip embedding-provider warnings when `memory.backend` is `qmd`, because QMD manages embeddings internally and does not require `memorySearch` providers. (#17263) Thanks @miloudbelarebia.
|
||||||
- Security/Webhooks: harden Feishu and Zalo webhook ingress with webhook-mode token preconditions, loopback-default Feishu bind host, JSON content-type enforcement, per-path rate limiting, replay dedupe for Zalo events, constant-time Zalo secret comparison, and anomaly status counters.
|
- Security/Webhooks: harden Feishu and Zalo webhook ingress with webhook-mode token preconditions, loopback-default Feishu bind host, JSON content-type enforcement, per-path rate limiting, replay dedupe for Zalo events, constant-time Zalo secret comparison, and anomaly status counters.
|
||||||
- Security/Plugins: add explicit `plugins.runtime.allowLegacyExec` opt-in to re-enable deprecated `runtime.system.runCommandWithTimeout` for legacy modules while keeping runtime command execution disabled by default. (#20874) Thanks @mbelinky.
|
- Security/Plugins: add explicit `plugins.runtime.allowLegacyExec` opt-in to re-enable deprecated `runtime.system.runCommandWithTimeout` for legacy modules while keeping runtime command execution disabled by default. (#20874) Thanks @mbelinky.
|
||||||
- Gateway/WebChat: block `sessions.patch` and `sessions.delete` for WebChat clients so session-store mutations stay restricted to non-WebChat operator flows. Thanks @allsmog for reporting.
|
- Gateway/WebChat: block `sessions.patch` and `sessions.delete` for WebChat clients so session-store mutations stay restricted to non-WebChat operator flows. Thanks @allsmog for reporting.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const resolveDefaultAgentId = vi.hoisted(() => vi.fn(() => "agent-default"));
|
|||||||
const resolveAgentDir = vi.hoisted(() => vi.fn(() => "/tmp/agent-default"));
|
const resolveAgentDir = vi.hoisted(() => vi.fn(() => "/tmp/agent-default"));
|
||||||
const resolveMemorySearchConfig = vi.hoisted(() => vi.fn());
|
const resolveMemorySearchConfig = vi.hoisted(() => vi.fn());
|
||||||
const resolveApiKeyForProvider = vi.hoisted(() => vi.fn());
|
const resolveApiKeyForProvider = vi.hoisted(() => vi.fn());
|
||||||
|
const resolveMemoryBackendConfig = vi.hoisted(() => vi.fn());
|
||||||
|
|
||||||
vi.mock("../terminal/note.js", () => ({
|
vi.mock("../terminal/note.js", () => ({
|
||||||
note,
|
note,
|
||||||
@@ -25,6 +26,10 @@ vi.mock("../agents/model-auth.js", () => ({
|
|||||||
resolveApiKeyForProvider,
|
resolveApiKeyForProvider,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
vi.mock("../memory/backend-config.js", () => ({
|
||||||
|
resolveMemoryBackendConfig,
|
||||||
|
}));
|
||||||
|
|
||||||
import { noteMemorySearchHealth } from "./doctor-memory-search.js";
|
import { noteMemorySearchHealth } from "./doctor-memory-search.js";
|
||||||
import { detectLegacyWorkspaceDirs } from "./doctor-workspace.js";
|
import { detectLegacyWorkspaceDirs } from "./doctor-workspace.js";
|
||||||
|
|
||||||
@@ -50,6 +55,24 @@ describe("noteMemorySearchHealth", () => {
|
|||||||
resolveAgentDir.mockClear();
|
resolveAgentDir.mockClear();
|
||||||
resolveMemorySearchConfig.mockReset();
|
resolveMemorySearchConfig.mockReset();
|
||||||
resolveApiKeyForProvider.mockReset();
|
resolveApiKeyForProvider.mockReset();
|
||||||
|
resolveMemoryBackendConfig.mockReset();
|
||||||
|
resolveMemoryBackendConfig.mockReturnValue({ backend: "builtin", citations: "auto" });
|
||||||
|
});
|
||||||
|
|
||||||
|
it("does not warn when QMD backend is active", async () => {
|
||||||
|
resolveMemoryBackendConfig.mockReturnValue({
|
||||||
|
backend: "qmd",
|
||||||
|
citations: "auto",
|
||||||
|
});
|
||||||
|
resolveMemorySearchConfig.mockReturnValue({
|
||||||
|
provider: "auto",
|
||||||
|
local: {},
|
||||||
|
remote: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
await noteMemorySearchHealth(cfg);
|
||||||
|
|
||||||
|
expect(note).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does not warn when remote apiKey is configured for explicit provider", async () => {
|
it("does not warn when remote apiKey is configured for explicit provider", async () => {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { resolveMemorySearchConfig } from "../agents/memory-search.js";
|
|||||||
import { resolveApiKeyForProvider } from "../agents/model-auth.js";
|
import { resolveApiKeyForProvider } from "../agents/model-auth.js";
|
||||||
import { formatCliCommand } from "../cli/command-format.js";
|
import { formatCliCommand } from "../cli/command-format.js";
|
||||||
import type { OpenClawConfig } from "../config/config.js";
|
import type { OpenClawConfig } from "../config/config.js";
|
||||||
|
import { resolveMemoryBackendConfig } from "../memory/backend-config.js";
|
||||||
import { note } from "../terminal/note.js";
|
import { note } from "../terminal/note.js";
|
||||||
import { resolveUserPath } from "../utils.js";
|
import { resolveUserPath } from "../utils.js";
|
||||||
|
|
||||||
@@ -22,6 +23,13 @@ export async function noteMemorySearchHealth(cfg: OpenClawConfig): Promise<void>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QMD backend handles embeddings internally (e.g. embeddinggemma) — no
|
||||||
|
// separate embedding provider is needed. Skip the provider check entirely.
|
||||||
|
const backendConfig = resolveMemoryBackendConfig({ cfg, agentId });
|
||||||
|
if (backendConfig.backend === "qmd") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If a specific provider is configured (not "auto"), check only that one.
|
// If a specific provider is configured (not "auto"), check only that one.
|
||||||
if (resolved.provider !== "auto") {
|
if (resolved.provider !== "auto") {
|
||||||
if (resolved.provider === "local") {
|
if (resolved.provider === "local") {
|
||||||
|
|||||||
Reference in New Issue
Block a user