mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:28:26 +00:00
fix: drop null-only union variants (#782) (thanks @AbhisekBasu1)
Co-authored-by: Abhi <AbhisekBasu1@users.noreply.github.com>
This commit is contained in:
@@ -103,7 +103,7 @@ describe("createClawdbotCodingTools", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("flattens simple anyOf/oneOf unions into single types", () => {
|
||||
it("drops null-only union variants without flattening other unions", () => {
|
||||
const cleaned = __testing.cleanToolSchemaForGemini({
|
||||
type: "object",
|
||||
properties: {
|
||||
@@ -125,8 +125,7 @@ describe("createClawdbotCodingTools", () => {
|
||||
| { type?: unknown; anyOf?: unknown; oneOf?: unknown }
|
||||
| undefined;
|
||||
expect(count?.anyOf).toBeUndefined();
|
||||
expect(count?.oneOf).toBeUndefined();
|
||||
expect(count?.type).toBe("string");
|
||||
expect(Array.isArray(count?.oneOf)).toBe(true);
|
||||
});
|
||||
|
||||
it("preserves action enums in normalized schemas", () => {
|
||||
|
||||
Reference in New Issue
Block a user