molecule-mcp-server/tests/__tests__
Molecule AI Plugin-Dev 8429fb7de2 fix(mcp): KI-006 — prevent anyOf in plugin tool schemas via order-safe nullable
Change `string().nullable().optional()` → `string().optional().nullable()` in
`update_workspace` parent_id schema. The `optional().nullable()` chain is
documented to produce `anyOf` in the zod-to-json-schema output; reordering to
`nullable().optional()` is the minimal fix that preserves the same type
surface (string | null | undefined).

Also adds a regression guard test in `tests/__tests__/plugins-schema.test.ts`
that mirrors all plugin tool schemas and asserts no anyOf appears in their
JSON Schema output. Includes a control test documenting the known
`optional().nullable()` zod-to-json-schema quirk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 08:03:22 +00:00
..
api.test.ts test(api): add Jest unit tests for apiCall, platformGet, toMcpResult, isApiError (#4) 2026-04-21 06:17:36 +00:00
plugins-schema.test.ts fix(mcp): KI-006 — prevent anyOf in plugin tool schemas via order-safe nullable 2026-04-21 08:03:22 +00:00