fix(llm): emit OpenAI strict JSON schemas#2807
Conversation
|
This change is now the remaining upstream release blocker for a fail-closed production deployment that uses only official |
|
Fresh fail-closed deployment evidence from July 19, 2026 isolates this PR as the blocker:
So this is not an OAuth, routing, or bank-configuration failure; it is exactly the strict schema producer corrected here. The PR remains mergeable with all checks green. Please include it in the next signed stable release; downstream qualification will consume the official release artifacts directly. |
|
Fresh live qualification evidence from July 19, 2026: Will dev promotion run The failure is on the currently deployed strict-schema Hindsight path and is exactly the producer defect fixed by this PR. We are keeping the gate fail-closed; staging and production did not advance. The downstream organizational fork is archived, so we will not publish another patched fork artifact. Merge into a signed upstream release is now the only production cutover path. |
|
@benfrank241 @dcbouius could one of you review this strict-schema fix for merge? The PR is clean and green, and two independent fail-closed dev promotions on July 19, 2026 reproduced the exact retain failure it fixes: OpenAI rejects the generated response schema because the root object omits |
koriyoshi2041
left a comment
There was a problem hiding this comment.
Verified the strict-schema serializer closes every object in the real FactExtractionResponse schema, requires all declared fields while preserving nullable unions, and is wired through OpenAI-compatible, LiteLLM, Codex, and batch-retain paths. I also ran the strict-schema/provider/fact-extraction regression set locally: 33 passed.
Summary
additionalProperties: falseRoot cause
HINDSIGHT_API_LLM_STRICT_SCHEMA=truecurrently sends rawmodel_json_schema()output. OpenAI-compatible strict structured-output endpoints reject those schemas because objects are not closed and defaulted fields are omitted fromrequired. This was previously identified in the review of #1954 and is reproducible during native retain fact extraction.The fix does not coerce incoming data or add a fallback. Typed response models are serialized directly through Pydantic into the provider-required strict wire schema.
Validation
git diff --checkpassed