Compare commits

...

3 Commits

Author SHA1 Message Date
Peter Steinberger
cf5567bdbe docs: update changelog for memory slot none (#1554) (thanks @andreabadesso) 2026-01-24 03:08:02 +00:00
André Abadesso
7d03436307
test: add tests for normalizePluginsConfig memory slot handling 2026-01-23 23:56:52 -03:00
André Abadesso
3a59e93f27
fix: respect "none" value for plugins.slots.memory 2026-01-23 23:56:51 -03:00
3 changed files with 54 additions and 1 deletions

View File

@ -15,6 +15,7 @@ Docs: https://docs.clawd.bot
### Fixes
- Voice wake: auto-save wake words on blur/submit across iOS/Android and align limits with macOS.
- Plugins: honor `plugins.slots.memory = "none"` when normalizing config. (#1554) Thanks @andreabadesso.
- UI: keep the Control UI sidebar visible while scrolling long pages. (#1515) Thanks @pookNast.
- Tailscale: retry serve/funnel with sudo only for permission errors and keep original failure details. (#1551) Thanks @sweepies.
- Agents: add CLI log hint to "agent failed before reply" messages. (#1550) Thanks @sweepies.

View File

@ -0,0 +1,52 @@
import { describe, expect, it } from "vitest";
import { normalizePluginsConfig } from "./config-state.js";
describe("normalizePluginsConfig", () => {
it("uses default memory slot when not specified", () => {
const result = normalizePluginsConfig({});
expect(result.slots.memory).toBe("memory-core");
});
it("respects explicit memory slot value", () => {
const result = normalizePluginsConfig({
slots: { memory: "custom-memory" },
});
expect(result.slots.memory).toBe("custom-memory");
});
it("disables memory slot when set to 'none'", () => {
const result = normalizePluginsConfig({
slots: { memory: "none" },
});
expect(result.slots.memory).toBeNull();
});
it("disables memory slot when set to 'None' (case insensitive)", () => {
const result = normalizePluginsConfig({
slots: { memory: "None" },
});
expect(result.slots.memory).toBeNull();
});
it("trims whitespace from memory slot value", () => {
const result = normalizePluginsConfig({
slots: { memory: " custom-memory " },
});
expect(result.slots.memory).toBe("custom-memory");
});
it("uses default when memory slot is empty string", () => {
const result = normalizePluginsConfig({
slots: { memory: "" },
});
expect(result.slots.memory).toBe("memory-core");
});
it("uses default when memory slot is whitespace only", () => {
const result = normalizePluginsConfig({
slots: { memory: " " },
});
expect(result.slots.memory).toBe("memory-core");
});
});

View File

@ -58,7 +58,7 @@ export const normalizePluginsConfig = (
deny: normalizeList(config?.deny),
loadPaths: normalizeList(config?.load?.paths),
slots: {
memory: memorySlot ?? defaultSlotIdForKey("memory"),
memory: memorySlot === undefined ? defaultSlotIdForKey("memory") : memorySlot,
},
entries: normalizePluginEntries(config?.entries),
};