mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 04:42:10 +03:00
Codex Responses API strict mode forces every "optional" tool property into `required`, so a model that intends to OMIT an optional enum property (no declared `default`, e.g. Agent.isolation: enum["worktree","remote"]) must still emit a concrete value. Neither of the two ops shipped in #6992 (drop-if-default, generalized drop-if-empty) can catch this: drop-if-default needs a declared default (none exists); drop-if-empty needs an empty string/array (the emitted value is non-empty). Adds a paired request/response transform scoped strictly to targetFormat === OPENAI_RESPONSES: - Request side: injectOptionalEnumOmissionSentinel/-ForTools widen no-default optional enum properties to accept `null` (OpenAI's own documented nullable-union idiom for this exact strict-mode limitation). - Response side: isDroppableNullEntry drops the key when the model emits `null` for a non-required, schema-declared property, reusing the existing #6992 toolSchemas plumbing (no new tracking structure needed).