Skip to content

fix(ai): use nullable instead of optional for configFiles in AI suggestion schema#4732

Merged
Siumauricio merged 1 commit into
canaryfrom
fix/ai-configfiles-strict-schema
Jul 5, 2026
Merged

fix(ai): use nullable instead of optional for configFiles in AI suggestion schema#4732
Siumauricio merged 1 commit into
canaryfrom
fix/ai-configfiles-strict-schema

Conversation

@Siumauricio

Copy link
Copy Markdown
Contributor

Summary

  • OpenAI strict mode for response_format requires every property in the JSON Schema to be listed in required. Optional Zod fields (.optional()) don't satisfy this, causing the AI Assistant template generator to fail at Step 2 with gpt-4o and other strict-mode models.
  • Changed configFiles from .optional() to .nullable() in packages/server/src/services/ai.ts, which keeps the key in required while allowing null/no config files.

Fixes #4267

…stion schema

OpenAI strict mode for response_format requires every property to be
listed in 'required'. Optional fields must instead be modeled as
nullable so the key stays required while still allowing no value.

Fixes #4267
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jul 5, 2026
@Siumauricio Siumauricio merged commit 3e11c0a into canary Jul 5, 2026
1 of 4 checks passed
@Siumauricio Siumauricio deleted the fix/ai-configfiles-strict-schema branch July 5, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AI Assistant fails with "Invalid schema for response_format": Missing 'configFiles' in required array

1 participant