mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-24 06:33:01 -04:00
98310eb310
The JSON Schema advertised for tools renders optional fields as `X | null` because JSON cannot express undefined, so callers (models, Code Mode agents) legitimately pass null meaning "omit" and were rejected with 'Expected string | undefined'. Decode now retries with null-valued object properties removed when the first attempt fails: schemas that genuinely accept null succeed on the first attempt, array elements stay positional, and the original error is reported when the retry cannot help.
@opencode-ai/core
Core runtime services for OpenCode.