[BUG] Task output schema in the prompt marks Optional fields as required and strips null, so the model cannot express “not applicable”
![[BUG] Task output schema in the prompt marks Optional fields as required and strips null, so the model cannot express "not applicable"](https://www.chat-gpts.plus/wp-content/uploads/2026/09/6774-15a8d678-768x403.jpg)
这个报错通常出现在 CrewAI 使用 output_pydantic 定义任务输出、并在 prompt 内嵌 JSON Schema 时:prompt 里的 schema 把 Pydantic 模型中的 Optional 字段强行标成 required 且去掉 null ,导致模型无法表达“不适用








