Skip to content

AI Assistant: migrate to zod4 - #35610

Open
bit-byte0 wants to merge 3 commits into
DevExpress:mainfrom
bit-byte0:chore/ai-assistant-zod4-main
Open

bit-byte0 wants to merge 3 commits into
DevExpress:mainfrom
bit-byte0:chore/ai-assistant-zod4-main

Conversation

@bit-byte0

Copy link
Copy Markdown
Contributor

What

DataGrid and TreeList AI Assistant moved to zod 4. zod-to-json-schema dependency removed

How

Response schema built with native z.toJSONSchema, makeOpenAICompatible override keeps OpenAI rules (all fields required, additionalProperties: false). Shared sub-schemas now inlined instead of $ref, filter value descriptions now reach the AI

@bit-byte0
bit-byte0 requested a review from a team as a code owner October 9, 2026 18:00
@bit-byte0 bit-byte0 added the 26_2 label Oct 9, 2026
Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:00
@bit-byte0 bit-byte0 self-assigned this Oct 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The OpenAI compatibility override can preserve unsupported additionalProperties values instead of enforcing false.

1 open finding
What changed in this PR

Migrates the DataGrid and TreeList AI Assistant to Zod 4’s native JSON Schema generation and removes the direct zod-to-json-schema dependency.

Changes:

  • Upgrades Zod and removes zod-to-json-schema.
  • Adds OpenAI schema normalization and updates Zod 4 typings.
  • Adds comprehensive response-schema tests.
File Description
pnpm-workspace.yaml Updates the Zod catalog dependency.
pnpm-lock.yaml Refreshes resolved dependencies.
packages/​devextreme/​testing/​runner/​lib/​importMap.ts Removes the obsolete shim mapping.
packages/​devextreme/​testing/​helpers/​esm-shims/​zod.js Stubs native JSON Schema conversion.
packages/​devextreme/​testing/​helpers/​esm-shims/​zod-to-json-schema.js Removes the obsolete shim.
packages/​devextreme/​package.json Removes the converter dependency.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_assistant/​utils.ts Adds OpenAI schema normalization.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_assistant/​types.ts Updates empty-schema type inference.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_assistant/​grid_commands.ts Uses native Zod JSON Schema generation.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_assistant/​commands/​utils.ts Migrates nullable optional schema typing.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_assistant/​__tests__/​utils.test.ts Tests OpenAI normalization.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_assistant/​__tests__/​grid_commands.test.ts Updates schema-generation tests.
packages/​devextreme/​js/​__internal/​grids/​data_grid/​ai_assistant/​__tests__/​response_schema.test.ts Verifies complete generated schemas.
NOTICE.txt Removes the former dependency notice.
e2e/​wrappers/​package.json Removes the converter dependency.
apps/​demos/​package.json Removes the converter dependency.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants