Compare commits
3 Commits
main
...
fix/memory
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf5567bdbe | ||
|
|
7d03436307 | ||
|
|
3a59e93f27 |
@ -15,6 +15,7 @@ Docs: https://docs.clawd.bot
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Voice wake: auto-save wake words on blur/submit across iOS/Android and align limits with macOS.
|
- 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.
|
- 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.
|
- 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.
|
- Agents: add CLI log hint to "agent failed before reply" messages. (#1550) Thanks @sweepies.
|
||||||
|
|||||||
52
src/plugins/config-state.test.ts
Normal file
52
src/plugins/config-state.test.ts
Normal 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");
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -58,7 +58,7 @@ export const normalizePluginsConfig = (
|
|||||||
deny: normalizeList(config?.deny),
|
deny: normalizeList(config?.deny),
|
||||||
loadPaths: normalizeList(config?.load?.paths),
|
loadPaths: normalizeList(config?.load?.paths),
|
||||||
slots: {
|
slots: {
|
||||||
memory: memorySlot ?? defaultSlotIdForKey("memory"),
|
memory: memorySlot === undefined ? defaultSlotIdForKey("memory") : memorySlot,
|
||||||
},
|
},
|
||||||
entries: normalizePluginEntries(config?.entries),
|
entries: normalizePluginEntries(config?.entries),
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user