Normalize required fields in agent JSON schemas for OpenAI

OpenAI rejects schemas where optional properties are absent from the
required array. Promote all properties to required and mark formerly
optional ones nullable so the model knows it may pass null.

Also upgrade tool error log level from Warn to Error.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-06-22 08:40:10 +02:00
parent 982509416e
commit e2219c9d1a
4 changed files with 163 additions and 9 deletions

View File

@@ -1279,7 +1279,7 @@ func executeSingleTool(
content = content[:200] + "... (truncated)"
}
logger.WarnCtx(
logger.ErrorCtx(
ctx,
"tool returned error",
log.String("tool", tool.Name()),