To Reproduce
- Go to any project environment in Dokploy
- Click "AI Assistant" to create a custom template
- Fill in your needs in Step 1 and proceed to Step 2
- The error appears immediately at Step 2 "Choose a Variant"
Error message:
Invalid schema for response_format 'response': In context=('properties', 'suggestions', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'configFiles'.
Dokploy version: v0.29.1
Current vs. Expected behavior
Current behavior: The AI Assistant fails at Step 2 "Choose a Variant" with a schema validation error. The configFiles field is defined in the suggestions.items.properties of the JSON Schema sent to the OpenAI API as response_format, but it is NOT listed in the required array. Modern OpenAI models (e.g. gpt-4o) enforce strict mode and require ALL properties to be listed in required.
Root cause: In packages/server/src/services/ai.ts, the Zod schema marks configFiles as .optional(), but when converted to JSON Schema for response_format, OpenAI strict mode requires every key in properties to be present in required (with optional fields using anyOf: [{...}, {type: 'null'}] instead).
Expected behavior: The AI Assistant should generate variant suggestions without error.
Provide environment information
Operating System:
OS: Ubuntu 22.04
Arch: x64
Dokploy version: v0.29.1
VPS Provider: Hostinger
AI Provider: OpenAI (gpt-4o)
What applications/services are you trying to deploy?
Any service via AI Assistant template generator
Which area(s) are affected? (Select all that apply)
Application
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
The fix should be in packages/server/src/services/ai.ts. The configFiles field in the fullSchema Zod object is marked as .optional(), but OpenAI strict mode requires all properties to be in required. The fix is to either:
- Add
configFiles to required and use z.nullable() or anyOf with null type
- Or disable strict mode for this specific
response_format call
Will you send a PR to fix it?
No
To Reproduce
Error message:
Dokploy version: v0.29.1
Current vs. Expected behavior
Current behavior: The AI Assistant fails at Step 2 "Choose a Variant" with a schema validation error. The
configFilesfield is defined in thesuggestions.items.propertiesof the JSON Schema sent to the OpenAI API asresponse_format, but it is NOT listed in therequiredarray. Modern OpenAI models (e.g. gpt-4o) enforce strict mode and require ALL properties to be listed inrequired.Root cause: In
packages/server/src/services/ai.ts, the Zod schema marksconfigFilesas.optional(), but when converted to JSON Schema forresponse_format, OpenAI strict mode requires every key inpropertiesto be present inrequired(with optional fields usinganyOf: [{...}, {type: 'null'}]instead).Expected behavior: The AI Assistant should generate variant suggestions without error.
Provide environment information
Operating System: OS: Ubuntu 22.04 Arch: x64 Dokploy version: v0.29.1 VPS Provider: Hostinger AI Provider: OpenAI (gpt-4o) What applications/services are you trying to deploy? Any service via AI Assistant template generatorWhich area(s) are affected? (Select all that apply)
Application
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
The fix should be in
packages/server/src/services/ai.ts. TheconfigFilesfield in thefullSchemaZod object is marked as.optional(), but OpenAI strict mode requires all properties to be inrequired. The fix is to either:configFilestorequiredand usez.nullable()oranyOfwith null typeresponse_formatcallWill you send a PR to fix it?
No