mirror of https://github.com/openclaw/openclaw.git
fix: harden legacy plugin schema compatibility tests (#24933) (thanks @pandego)
This commit is contained in:
parent
9f4764cd41
commit
7a42558a3e
|
|
@ -10,6 +10,7 @@ Docs: https://docs.openclaw.ai
|
|||
|
||||
### Fixes
|
||||
|
||||
- Plugins/Config schema: support legacy plugin schemas without `toJSONSchema()` by falling back to permissive object schema generation. (#24933) Thanks @pandego.
|
||||
- Cron/Isolated sessions: use full prompt mode for isolated cron runs so skills/extensions are available during cron execution. (#24944)
|
||||
- Discord/Reasoning: suppress reasoning/thinking-only payload blocks from Discord delivery output. (#24969)
|
||||
- Sessions/Reasoning: persist `reasoningLevel: "off"` explicitly instead of deleting it so session overrides survive patch/update flows. (#24406, #24559)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { z } from "zod";
|
||||
import { buildChannelConfigSchema } from "./config-schema.js";
|
||||
|
||||
|
|
@ -14,4 +14,23 @@ describe("buildChannelConfigSchema", () => {
|
|||
const result = buildChannelConfigSchema(legacySchema);
|
||||
expect(result.schema).toEqual({ type: "object", additionalProperties: true });
|
||||
});
|
||||
|
||||
it("passes draft-07 compatibility options to toJSONSchema", () => {
|
||||
const toJSONSchema = vi.fn(() => ({
|
||||
type: "object",
|
||||
properties: { enabled: { type: "boolean" } },
|
||||
}));
|
||||
const schema = { toJSONSchema } as unknown as Parameters<typeof buildChannelConfigSchema>[0];
|
||||
|
||||
const result = buildChannelConfigSchema(schema);
|
||||
|
||||
expect(toJSONSchema).toHaveBeenCalledWith({
|
||||
target: "draft-07",
|
||||
unrepresentable: "any",
|
||||
});
|
||||
expect(result.schema).toEqual({
|
||||
type: "object",
|
||||
properties: { enabled: { type: "boolean" } },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue