-
Notifications
You must be signed in to change notification settings - Fork 118
Codex provider fails on nullable anyOf output schemas #146
Copy link
Copy link
Closed
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
No fields configured for issues without a type.
Summary
clawpatch ci --provider codexfails against Codex CLI / OpenAI-compatible Responses strict structured output when the provider schema contains nullable fields emitted asanyOf.The failure occurs before model reasoning. Codex CLI rejects the generated schema:
Environment
0.7.0(latest npm at time of report)0.142.3codexgpt-5.5Minimal reproduction
Observed result:
Root cause
dist/provider-schema.jscurrently generates provider schemas via:For nullable fields like
evidenceLineSchema:Clawpatch emits JSON Schema like:
{ "anyOf": [ { "type": "integer" }, { "type": "null" } ] }That is valid generic JSON Schema, but Codex CLI's
--output-schema/ Responses strict schema path does not accept it. I isolated the compatibility issue with direct Codex CLI probes:anyOf: [{"type":"integer"},{"type":"null"}]fails with the same...endLine.typeerror."type": ["integer", "null"]succeeds.Locally validated fix
I patched the installed package locally to normalize the exact nullable
anyOfpattern into a strict-compatibletypearray before handing the schema to Codex.Conceptual patch:
Called from
stripProviderUnsupportedSchemaKeywords()after recursively stripping nested schema fields.After applying that local normalization, the same real Codex-path smoke test passed:
Expected behavior
clawpatch ci --provider codexshould emit a Codex/Responses-compatible strict schema for nullable fields, or otherwise avoid using nullableanyOfin the Codex provider schema path.Notes
This may also be valid to fix in Codex CLI by accepting/normalizing nullable
anyOf, but Clawpatch can make its Codex provider path robust today by normalizing this common nullable shape itself.