Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ai-openai-files-status-details-null.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/ai-openai": patch
---

Fix decode failures when OpenAI returns `null` for fields the OpenAPI spec marks as optional but not nullable. Affects `OpenAIFile.status_details` (Files API: `createFile` / `retrieveFile` / `listFiles`) and `Batch.model` / `Batch.output_file_id` / `Batch.error_file_id` (Batch API: `createBatch` / `retrieveBatch` / `listBatches`). All four sites previously raised `SchemaError(Expected string, got null)` against responses OpenAI actually returns. Patched the codegen spec to mark each field nullable.
4 changes: 4 additions & 0 deletions packages/ai/openai/codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ patches:
- '[{"op":"add","path":"/components/schemas/ModelResponseProperties/properties/safety_identifier/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/ModelResponseProperties/properties/prompt_cache_key/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/Response/allOf/2/properties/usage/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/OpenAIFile/properties/status_details/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/Batch/properties/model/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/Batch/properties/output_file_id/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/Batch/properties/error_file_id/nullable","value":true}]'
- '[{"op":"remove","path":"/components/schemas/ResponseFunctionCallArgumentsDoneEvent/required/2"}]'
- '[{"op":"remove","path":"/components/schemas/WebSearchActionSearch/required/1"}]'
- '[{"op":"add","path":"/components/schemas/ModelResponseProperties/properties/prompt_cache_retention/anyOf/0/enum/1","value":"in_memory"}]'
Expand Down
Loading