Commit 615d37a
fix(codex): normalize output schemas for OpenAI Structured Outputs compliance
OpenAI's Structured Outputs API requires `additionalProperties: false`
on every object node and `required` to list ALL property keys. Claude
doesn't enforce either, so workflow authors writing provider-agnostic
YAML typically omit both — causing 400 errors when switching to the
Codex provider.
Add `normalizeSchemaForOpenAI()` in the Codex provider that recursively
walks the schema tree and fills in the missing constraints before passing
to the SDK. This makes all existing workflows work with Codex without
any YAML changes.
Fixes the `invalid_json_schema` error on `output_format` nodes when
using `provider: codex` in workflow definitions.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 7bdf931 commit 615d37a
2 files changed
Lines changed: 53 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | | - | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
686 | 692 | | |
687 | 693 | | |
688 | 694 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
270 | 314 | | |
271 | 315 | | |
272 | 316 | | |
| |||
282 | 326 | | |
283 | 327 | | |
284 | 328 | | |
285 | | - | |
| 329 | + | |
286 | 330 | | |
287 | 331 | | |
288 | | - | |
| 332 | + | |
289 | 333 | | |
290 | 334 | | |
291 | 335 | | |
| |||
0 commit comments