fix: support explicit active-memory chat types (openclaw#66285)

Verified:
- pnpm install --frozen-lockfile
- pnpm test extensions/active-memory/config.test.ts extensions/active-memory/index.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md extensions/active-memory/index.ts extensions/active-memory/index.test.ts extensions/active-memory/config.test.ts extensions/active-memory/openclaw.plugin.json
- git diff --check

Co-authored-by: Lidang-Jiang <119769478+Lidang-Jiang@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Lidang Jiang
2026-04-28 21:43:06 +08:00
committed by GitHub
parent ba17b8b728
commit 6d539db011
5 changed files with 86 additions and 6 deletions

View File

@@ -36,6 +36,20 @@ describe("active-memory manifest config schema", () => {
expect(result.ok).toBe(true);
});
it("accepts explicit in allowedChatTypes", () => {
const result = validateJsonSchemaValue({
schema: manifest.configSchema,
cacheKey: "active-memory.manifest.allowed-chat-types.explicit",
value: {
enabled: true,
agents: ["main"],
allowedChatTypes: ["direct", "explicit"],
},
});
expect(result.ok).toBe(true);
});
it("rejects timeoutMs values above the runtime ceiling", () => {
const result = validateJsonSchemaValue({
schema: manifest.configSchema,
@@ -49,4 +63,18 @@ describe("active-memory manifest config schema", () => {
expect(result.ok).toBe(false);
});
it("rejects unknown allowedChatTypes values", () => {
const result = validateJsonSchemaValue({
schema: manifest.configSchema,
cacheKey: "active-memory.manifest.allowed-chat-types.invalid",
value: {
enabled: true,
agents: ["main"],
allowedChatTypes: ["direct", "portal"],
},
});
expect(result.ok).toBe(false);
});
});